MATLAB: Can you change the Baud rate of the Android BLE block

androidble blockhardware package'simulink

I am trying to receive a 256 samples per second signal from a HM10 bluetooth device using the custom characteristic of the HM10. I have successfully sampled a 1hz sine wave that is not distorted at that sample rate. However when I try to sample a 128Hz sine wave it is all over the place (which is the signal I actually need for my project). The custom characteristic of the HM10 sends a maximum of 20 characters. Im assuming one of the issues is that the 9600 baud rate is not high enough and I need 57600 to get the whole signal ie 20(characters) x 8 (bits) x 256 (samples per second)…please correct if Im wrong. I can change the baud on the HM10 easily enough but does anyone know how can I match it with the simulink driven android device? ie change the baud for the android BLE block to 57600

Best Answer

Hi Matthew,
Maximum data sent through BLE characteristic is 20 bytes. Android BLE receive blocks can receive the characteristic for every 0.1 second, if the sample time parameter of the BLE Receive block is set to 0.1. You can set the sample time according to your needs. Two things you control in BLE Receive BLE block is Sample time and Data Size(it depends on peripheral/central device i.e sender data size ).
Related Question