monteslu / ble-serial

a node-serialport implementation using BLE for sending and receiving serial data.
17 stars 5 forks source link

need to regulate frequency of sending data #4

Open soundanalogous opened 7 years ago

soundanalogous commented 7 years ago

This module only works if you are sending data from a single component and the rate at which data is sent is >= the BLE connection interval (which is why the blink example works). If data is sent faster than that interval, the application running on the MCU will crash. Likewise if you try to send data from 2 or more components and one component sends data within an interval < the BLE connection interval, the application on the MCU will crash.

What is needed is a timed buffer that is flushed minimally at the same rate as the BLE connection interval. All data transmitted would need to go through this buffer. That should (hopefully) prevent crashes.