8 years, 6 months ago.

Read a String or Array

Hi, I have read your project Nucleo_BLE_Demo and if possible I would use it. My problem is that I should use it to read from my core a string or array, how can I change the program to insert random values into a string or array, and then read it? thank you

Question relating to:

Simple demo application demonstrating use of Nucleo_BLE_DemoApp

1 Answer

8 years, 6 months ago.

Hi,

I only edited the example/API from here: /teams/ST-Americas-mbed-Team/code/Nucleo_BLE_API/, but it is quite buggy (or maybe I'm not using it right).

BLE is something like shared memory. You specify variable (called characteristic) and define its length in bytes. Then you can write value to it and some other device can read it. There should be some mechanism to get notified when the variable was read by some other device (but I haven't tested this).

Or the remote device can get notified when your device has changed the characteristic value, but you can't be sure the value was read by the remote device in time.

So to transfer more data you write to characteristic, wait for remote device to read it and repeat it until all data is send. You also need mechanism to tell the remote device how much data it has to read. You can do this e.g. by defining some terminating character/value or using another characteristic.