Skip to main content

Receiving BLE data

4 years ago

Receiving BLE data

Posted bydavid.millan0 points 3 replies
0 upvotes

Hi, I'm working on an application where I need to send and receive data between multiple DA14580 modules, I have already managed to send data with notifications, but I dont know how to set up a certain set of instructions to trigger when I receive a packet from other BLE module,so I would like to know if there's any example that you could give me where the data is correctly received and stored in a variable, or something like that.

4 years ago

MT_dialog -30 points

Hi david.millan,

I am sorry i dont quite get what you would like to do, can you please clarify ? Regarding the Notifications and Indications, every time you send a notification, you should get a GATTC_CMP_EVT message, this indicates that the notification was correctly left from your device. In case of an indication you should get the same message with the difference that this message (GATTC_CMP_EVT) will be received as soon as the other device responds that the packet was received.

Thanks MT_dialog

4 years ago

david.millan 0 points

Sorry, I will try to explain myself.
Right now I'm working on a project with two da14580 expert DevKits, and I'm correctly connecting one with the other one and sending data through notifications of the custom sevice, but now I want to know what should I do to store the data coming from the other board in the one who should be receiving it. So I would like to know how to manage a BLE packet reception.

Thanks for your time.

4 years ago

MT_dialog -30 points

你好大卫,

I suppose that you mean on a central that accepts the notifications of the peripheral, when you receive notifications or indications on the central side the message that will rise from the stack is a GATTC_EVENT_IND (the type of the message will differentiate if what you received is a notification or an indication) and this message will also include the received data. After that is up to your application how to handle the data and store it in a variable or push it in a buffer. You can have a look at the DSPS example that when a notification is triggered the gattc_event_ind_handler() will be triggered and accoring to the handle of the message (which characteristic is updated) a proper action is decided. If the data concerns the RX value of the characteristic then the sps_client_indicate_data_rx() is called and eventually the data are pushed in the buffer. For more info you can check the Serial Port application User Manual.

Thanks MT_dialog