你好
我修改da1458x_sdk \ 5.0.4 \ projects \ target_apps \ ble_examples \ prox_reporter。
Please explain the difference between indication and notify in prox_reporter project.
迹象是如何解决数据包丢失问题。
Please tell me the calling process of the indication function.
Thanks!
Keywords:
Device:
你好Lewuyouc.,
The difference is indication has confirmation of data receiving, but notify does not.
嗨pw_dialog.
DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\prox_reporter how to confirmation of data receiving ?
如果发送失败,如何解决它?
Thanks
你好Lewuyouc.,
为了确认数据很好,数据接收器可以将ACK发送到发件人,并且发送方如果在某个时段之后无法获得ACK,则可以再次发送数据。
嗨pw_dialog.
谢谢您的支持。
如果断开连接,则发件人将数据发送到手机始终失败,因此从设备将再次发送数据?或断开连接,从属使用指示错误?
" 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?
你好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).
嗨pw_dialog.
谢谢,但我需要一个完整的例子。
DA1458x_SDK\5.0.4\projects\target_apps\ble_examples\ble_app_all_in_one about indication is incomplete .
Thanks!
你好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.
发送一个人,GATTC_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
你好
我使用Infimate将我的数据发送到手机。
" 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!
你好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.
你好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!
你好Lewuyouc.,
不到
BR
cyibin.
你好
“不同之处在于指示已经确认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)
案例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
{
///连接句柄
uint16_t conhdl;
/// Handle of the attribute that has been updated
uint16_t handle;
///确认状态
uint8_t status;
};
为什么我们可以获得通知反馈状态?
如果通知发送成功,则msg_param-> status = 0x00,否则msg_param-> status = 0x8b。
notify also can confirmation of data receiving?
你好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
嗨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?
期待你的答复!
你好Lewuyouc.,
您可以使用指示而不是通知,以便确认数据接收。要从迹象开始,从外设启动(就像通知,而是使用应用程序确认当值达到外围设备时)而不是中央,外围设备只能向中央发送指示而不是相反的方式。因此,为了从外设发送迹象,您只需从应用程序发送该消息,中央不会读取可指示的值,它只是指示中央的价值,中央的外围设备只是确认他收到从外设发送的消息。发送指示时,您应该发出gattc_send_evt_cmd,该消息应该具有响应GattC_CMP_EVT。之后,gattc_cmp_evt将从custs1_task.c中触发gattc_cmp_evt_handler()。请注意,当中央正确接收的中央确认时,将触发指示。为了看看如何申报可滥用的特征,请查看SDK的BLE_APP_PERITEDAL示例。
Thanks, PM_Dialog
嗨pw_dialog.
谢谢,我会尝试这样做。
Can we use malloc() function? I need to create a long link.
你好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