I follow the instructions in BLE Mesh User guide, however I cannot get it working.
I am able to send command ''light on" and "light on 1" with commissioner, ( verified on sniffer that it is indeed send out )
However, the receiving side (BD_ADDR_ID = 1) didn't receive it. ( Set a break point at MeshLightServerCallback, and never triggered.)
One weird thing is that in function MeshGenericCallback, pEvent->eventData.initComplete.deviceIsCommissioned is TRUE even for the very first time, so MeshNode_Commission(&gRawCommData); is never executed. So I force the function to execute MeshNode_Commission at first entrance, but nothing happens, mesh device still cannot receive.
static meshResult_t MeshGenericCallback
(
meshGenericEvent_t* pEvent
)
{
switch (pEvent->eventType)
{
case gMeshInitComplete_c:
{
if (!pEvent->eventData.initComplete.deviceIsCommissioned)
{
/* This will trigger this callback again, but "deviceIsCommissioned" will be TRUE. */
MeshNode_Commission(&gRawCommData);
}
else
{
LED_StopFlashingAllLeds();
Led1On();
#if gAppLightBulb_d
Mesh_SetRelayState(TRUE);
#else
Mesh_SetRelayState(FALSE);
#endif
}
}
break;
default:
{
/* Ignore */
}
break;
}
return gMeshSuccess_c;
}