7 posts / 0 new
Last post
Max44
Offline
Last seen:9个月5天前
加入:2016-02-08 15:58
Indication acknowledge?

DA14580, Basic Development Kit, SDK 5.0.3

Hello again Dialog,

I'm continuing work on an application based on the ble_app_peripheral example in SDK 5. I'd like to use the characteristic with read and indicate properties to send groups of stored sensor data, waiting for an acknowledge that data has been received before sending the next group. Is this proper use of indicate? The indicate property is supposed to have an acknowledge back from the client device (an Android tablet/phone in my case), but it isn't clear to me if or how this acknowledge is visible to my application. The example sets up a structure custs1_val_ind_cfm, but from reading the description of this message it just confirms the data has been sent. Can I determine if an acknowledge has been received? Is there a working example of this somewhere?

Thanks again

Device:
MT_dialog
Offline
Last seen:2 months 5 days ago
工作人员
加入:2015-06-08 11:34
Hi Max44,

Hi Max44,

Yes you can know when your notification or indication is properly send (for the notification) and properly received from the central (for the indication), when an indication or a notification is send the gattc_cmp_evt_handler() is triggered (in the custs1_task.c) via the GATTC_CMP_EVT message, the difference between the notification and the indication is that theGATTC_CMP_EVT当正确地通知发送触发from the peripheral (there is no confirmation that the notification reached the central) and for the indication is triggered when there is a confrmation from the central that the indication is correctly received by the central.

please also check the below posthttp://support.dialog-semiconductor.com/confirmation-indication

Thanks MT_dialog

Max44
Offline
Last seen:9个月5天前
加入:2016-02-08 15:58
MT,

MT,

Thanks for the info and reference to the post. I'll try to set up some trial code in my application and see if I can get it working. What CheMax was doing looks similar to what I was planning.

Max

Max44
Offline
Last seen:9个月5天前
加入:2016-02-08 15:58
OK. I added an update of an

OK. I added an update of an array of values to the 20 byte "INDICATEABLE CHAR" characteristic when I detected I was connected to my tablet. This worked as expected and I was able to read and display the data using both BlueLoupe and my own app created with Bluetooth Developer Studio. However, it doesn't appear that I'm ever getting to the user_catch_rest_hndl() section for CUSTS1_VAL_IND_CFM. Shouldn't I get to this code upon reading the data on the Android tablet?

Max44
Offline
Last seen:9个月5天前
加入:2016-02-08 15:58
I got a little further with

I got a little further with this. I found that instead of a custs1_val_set_req message, I should use a custs1_val_ind_req message. This updated the data value and got to the CUSTS1_VAL_IND_CFM section of user_catch_rest_hndl(). According to my log messages, the CUSTS1_VAL_IND_CFM happened immediately on connect, not when I click on READ on the tablet. I'm not sure this will sequence through transferring multiple 20 byte segments of data in an orderly succession, making sure the tablet receives and stores the bytes received before the next ones are sent. I was hoping the indicate property would provide this type of sequencing.

I tried sending the next 20 bytes after receiving the CUSTS1_VAL_IND_CFM message by sending another custs1_val_ind_req message, repeating this process 10 times. According to my log messages, the entire batch of 10 messages was sent immediately on connect without any user interaction on tablet. This is not what I wanted.

From this I conclude I had the wrong idea on what the indicate property does. Unless you can suggest anything better, I'm going to set up my own data acknowledge protocol with another characteristic value to control the data flow through to the tablet user application. Much more work than I was hoping for! :(

MT_dialog
Offline
Last seen:2 months 5 days ago
工作人员
加入:2015-06-08 11:34
Hi Max44,

Hi Max44,

The indications are like notifications, the only difference is that the central is obligated to answer as soon as they rereive data from the peripheral, you dont have to read the characteristic in order to get a GATTC_CMP_EVT, as previously mentioned this will be triggered in your peripheral as soon as the central receives the data, the indication's confirmation will be triggered whether you read the indication characteristic or not. At the moment there is no functionallity on the SDK that will allow to the application to know when a characteristic is being read. The only way to do that is via a seperate characteristic as you ve mentioned.

Thanks MT_dialog

Max44
Offline
Last seen:9个月5天前
加入:2016-02-08 15:58
MT,

MT,

OK. Thanks again ...... and for your patience. I'm new to BLE and the Dialog SDKand stumbling through it. Appreciate your help clarifying things.

Max

Topic locked