Question about bluetooth

0romis
Posts: 4
Joined: Tue Apr 17, 2018 8:25 am

Question about bluetooth

Postby 0romis » Tue May 22, 2018 12:13 pm

On request from a client I want to send data from a sensor over bluetooth. The sensor uses I2C. Im quite new to programming embedded systems. I was thinking to run the bluetooth and the i2c in their own threads do you think this is a good idea or is it unnecessary?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Question about bluetooth

Postby kolban » Wed May 23, 2018 9:09 pm

I'm afraid its too broad a question to give you much in the way of experience or advice. One usually performs multi-threaded work because it offers better utilization of the device. For example while thread A is blocked I can be doing work on thread B. However adding threading for the sake of threading can introduce design complexity and errors. Assuming that the ESP32 is the I2C master and is polling the I2C sensor slave, what would be the negative effect of blocking waiting for a BLE response longer than how often you read from the sensor. For example, if a BLE call takes 50 msecs and you normally poll the sensor every 10msecs ... what does that mean to your overall solution? If the answer is nothing ... then maybe multi-threading isn't needed?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

0romis
Posts: 4
Joined: Tue Apr 17, 2018 8:25 am

Re: Question about bluetooth

Postby 0romis » Thu May 24, 2018 8:38 am

Thanks for your answer this makes sense and will help me with my project. :)

Who is online

Users browsing this forum: Baidu [Spider] and 122 guests