I create a program using the example code of simple_observer. However, there is no part to get scan data and rssi values.
I have to notify via observer through eddystone beacon's instanceid, namespace, and rssi values.
How do I modify it to read that value in the observer example
If there is a good way, please suggest it
static void SimpleObserver_processRoleEvent(gapObserverRoleEvent_t *pEvent)
{
switch ( pEvent->gap.opcode )
{
case GAP_DEVICE_INIT_DONE_EVENT:
{
Display_print0(dispHandle, 1, 0, Util_convertBdAddr2Str(pEvent->initDone.devAddr));
Display_print0(dispHandle, 2, 0, "Initialized");
// Prompt user to begin scanning.
Display_print0(dispHandle, 5, 0, "Discover ->");
}
break;
case GAP_DEVICE_INFO_EVENT:
{
SimpleObserver_addDeviceInfo(pEvent->deviceInfo.addr,
pEvent->deviceInfo.addrType);
}
break;
case GAP_DEVICE_DISCOVERY_EVENT:
{
if(pEvent->gap.hdr.status == SUCCESS)
{
// Discovery complete.
scanning = FALSE;
if(ENABLE_UNLIMITED_SCAN_RES == FALSE)
{
// Copy results.
scanRes = pEvent->discCmpl.numDevs;
memcpy(devList, pEvent->discCmpl.pDevList,
(sizeof(gapDevRec_t) * pEvent->discCmpl.numDevs));
}
Display_print1(dispHandle, 2, 0, "Devices Found %d", scanRes);
if ( scanRes > 0 )
{
Display_print0(dispHandle, 3, 0, "<- To Select");
}
// Initialize scan index.
scanIdx = -1;
// Prompt user that re-performing scanning at this state is possible.
Display_print0(dispHandle, 5, 0, "Discover ->");
}
else
{
if(pEvent->gap.hdr.status == GAP_LLERROR_INVALID_PARAMETERS)
{
Display_print0(dispHandle, 3, 0, "INVALID PARAMETERS");
}
else if(pEvent->gap.hdr.status == GAP_LLERROR_COMMAND_DISALLOWED)
{
Display_print0(dispHandle, 3, 0, "COMMAND DISALLOWED");
}
else
{
Display_print0(dispHandle, 3, 0, "ERROR");
}
}
}
break;
default:
break;
}
}