Hi
I modify DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\prox_reporter.
Please explain the difference between indication and notify in prox_reporter project.
Indication is how to solve the problem of packet loss.
Please tell me the calling process of the indication function.
Thanks!
Keywords:
Device:
Hi lewuyouc,
The difference is indication has confirmation of data receiving, but notify does not.
Hi PW_Dialog
DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\prox_reporter how to confirmation of data receiving ?
if send fail,how to solve it?
Thanks
Hi lewuyouc,
To confirm the data is well received, data receiver could send back ack to sender, and sender may send the data again if can't get the ack after certain period.
Hi PW_Dialog
Thank you for your support.
if disconnect,the sender send data to phone is always fail, so the slave will aiways send data again? or disconnect,the slave use indication is wrong?
" To confirm the data is well received, data receiver could send back ack to sender, and sender may repeat sending the data if can't get the ack after certain period. " can you give me some source code reference?
Hi lewuyouc,
That could be regarded as a state machine flow, if disconnect the state will be changed as well, then corresponding actions (instead of resending data) will be taken in the disconnect state (e.g. preparing to be reconnected).
Hi PW_Dialog
Thanks,But I need a indication complete example.
DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\ble_app_all_in_one about indication is incomplete .
Thanks!
Hi lewuyouc,
From user's point of view, there are not any differences between IND and NOTF. What user can do is just to send a command to SDK and waiting for its feedback. User cannot see the source code of the process.
To send a NOTF, the GATTC_SEND_EVT_CMD with GATTC_NOTIFY parameter is sent from user layer to SDK layer.
发送一个印第安纳州,theGATTC_SEND_EVT_CMD with GATTC_INDICATE parameter is sent from user layer to SDK layer.
After above command has been sent, SDK layer would feedback the result to the user layer:
For NOTF, the NO_ERROR status means data has been sent from BLE peripheral. We don't know whether the BLE central has received or not.
For IND, the NO_ERROR status means data has been sent from BLE peripheral to central. There is no doubt that data has been received by central.
Br
Yibin
Hi
I use infication send my data to phone.
" After above command has been sent, SDK layer would feedback the result to the user layer: " I do not know how to get the result.
Thanks!
Hi lewuyouc,
To send the data to sdk layer, you can find the below API in SDK:
To get the result from SDK layer after sending the data, you can handler the gattc_cmp evet in the callback function:
BR
CYibin
Hi CYibin
Thanks for your support.
void user_catch_rest_hndl(ke_msg_id_t const msgid,
void const *param,
ke_task_id_t const dest_id,
ke_task_id_t const src_id)
case CUSTS1_VAL_IND_CFM: in user_catch_rest_hndl() can get the feedback result.
Thanks!
Hi lewuyouc,
不客气
BR
CYibin
Hi
“不同之处在于指示已经确认data receiving, but notify does not. "
but the function void user_catch_rest_hndl(ke_msg_id_t const msgid, void const *param, ke_task_id_t const dest_id,ke_task_id_t const src_id)
case CUSTS1_VAL_NTF_CFM:
struct custs1_val_ntf_cfm const *msg_param = (struct custs1_val_ntf_cfm const *)(param);
/// Parameters of the @ref CUSTS1_VAL_NTF_CFM massage
struct custs1_val_ntf_cfm
{
/// Connection handle
uint16_t conhdl;
/// Handle of the attribute that has been updated
uint16_t handle;
/// Confirmation status
uint8_t status;
};
why we can get notify feedback status?
if notify send success,the msg_param->status=0x00,else the msg_param->status=0x8B.
notify also can confirmation of data receiving?
Hi lewuyouc
Yes, PW_Dialog is correct, and the difference is that the indication has confirmation of data receiving but notify does not. The CUSTS1_VAL_NTF_CFM is a confirmation from the stack that you pushed successfully a CUSTS1_VAL_NTF_REQ message to the BLE stack. It is not a confirmation from the central that the data have successfully been received. Whenever you send a notification you will get a CUSTS1_VAL_NTF_CFM (for the custom profile), as soon as you get this you will know that the notification just send will be delivered to the central, so you can directly place the second notification. You will have to wait for the CUSTS1_VAL_NTF_CFM to arrive before sending the next notification for the same characteristic, if not you will update the value's database with the latter value and when the kernel pushes the notification into the buffer it will push two notifications with the same value, since the values of the notifications are acquired from the database. If you found any of the answers useful, please mark it as “accepted”.
Thanks, PM_Dialog
Hi PW_Dialog
Thank you for your reply.
So CUSTS1_VAL_IND_CFM same as CUSTS1_VAL_NTF_CFM? the CUSTS1_VAL_IND_CFM make sure send next event.
Please tell me, my ble device how to know the phone received data successfully?
Looking forward to your reply!
Hi lewuyouc,
You could use indications instead of notifications in order to have a confirmation of data receiving. To start with the indications are initiated from the peripheral (just like notifications but with application confirmation when the value reaches the peripheral) and not the central, the peripheral can only send indications towards the central and not the other way around. So in order to send an indication from a peripheral you just have to send that message from your application, the central doesn't read the indicatable value, it is just the peripheral that indicates that value to the central, the central just confirms that he received the message sent from the peripheral. When you send an indication, you should issue a GATTC_SEND_EVT_CMD and that message should have as a response a GATTC_CMP_EVT. After that, the GATTC_CMP_EVT will trigger the gattc_cmp_evt_handler() from the custs1_task.c. Be aware that the indication will be triggered when there is a confirmation from the central that the indication is correctly received by the central. In order to see how to declare an indictable characteristic, please take a look at the ble_app_peripheral example of the SDK.
Thanks, PM_Dialog
Hi PW_Dialog
谢谢,我会试着这样做。
Can we use malloc() function? I need to create a long link.
Hi lewuyouc,
I am in position to understand what you are trying to accomplish, but yes you can use it. You can use the ke_malloc as well.
Thanks, PM_Dialog