Hello, excuse my English. I am a beginner both IAR BLE and programming. I'm using the proyect Slave Master Switch in 1.4.1 stack with the Keyfob device., (KeyFob1but the changing role is handle dynamically with a timer, step 5 seconds in peripheral role and 10 in the central role. I have another keyfob (KeyFob2) with the original MasterSlaveSwitch project, DEFAULT_DISCOVERABLE_MODE in GAP_ADTYPE_FLAGS_GENERAL to do not stop advertising to 180 seconds. Using a dongle in Sniffer mode.
My idea is that KeyFob1 receives advertising packages of KeyFob2, look at the contents of those packages, take a specific byte and store it. With that stored byte, KeyFob1 modify the content of his advertData, modifying one of its bytes for the value stored. To do this in simpleBLECentralEventCB (), I have introduced the case of GAP_DEVICE_INFO_EVENT. As a test I entered the following code (I have the variable contadorData declared and initialized to 0):
case GAP_DEVICE_INFO_EVENT:
{
advertData[7] = contadorData;
GAPRole_SetParameter( GAPROLE_ADVERT_DATA, sizeof( advertData ), advertData );
contadorData++;
}
If the central role receives a packet during their periods of scanning, the content of the advertData[7] should change . This does not happen. In the Smart RF packet sniffer I can see that KeyFob1 and KeyFob2 come to exchange ADV_SCAN_REQ and may start a connection, although these connections do not last more than 10 seconds is the maximum time that KeyFob1 is central role before moving to peripheral role and so successively. I understand, therefore, that KeyFob1 receives packets, but am not being able to receive the GAP_DEVICE_INFO_EVENT event.
Do you have any restrictions this event? Is it only occurs to a certain type of input packet?
Best wishes.
Luis G.