Last Updated on : 2024-05-17 02:50:37download
This topic describes the status callbacks for beacon mesh devices, allowing you to implement status indication or other logic as needed.
Notify the application layer of the status of the beacon mesh stack.
Implement the following beacon mesh status callbacks at the application layer to monitor changes in device status.
void ty_beacon2_event_cb(ty_beacon2_event_e e, void *params){
PR_DEBUG("EVENT:%d\n",e);
switch(e){
case BEACON2_EVENT_PAIR_OK:break;
case BEACON2_EVENT_RESET:break;
case BEACON2_EVENT_RECOVERY:;break;
case BEACON2_EVENT_GROUP_ADD_SUCCESS:break;
case BEACON2_EVENT_GROUP_ADD_ERR:break;
case BEACON2_EVENT_GROUP_DEL_SUCCESS:break;
default:break;
}
}
Status includes:
In the callbacks for successful pairing, successful reset, or recovery from accidental reset, avoid initiating pairing to prevent a potential logic issue.
If you have any problems with TuyaOS development, you can post your questions in the Tuya Developer Forum.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback