SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
//open socket dedicated to the Real-Time RSSI to start capturing the medium
SockID = sl_Socket(SL_AF_RF, SL_SOCK_RX_MTR, 0);
flag.enableDisable = 1;
//set option to receive frames of other devices in the BSS
sl_SetSockOpt(SockID,SL_SOL_PHY_OPT,SL_SO_PHY_RX_BSSID_DATA_FRAMES,&flag,1);
for(i = 0 ; i < RUN_NUMBER_OF_TIMES; i++)
{
actualLength = 1000;
actualLength = sl_Recv(SockID,buffer,actualLength,0);
/*
* Note: if receiving N bytes there might be a reminder on the socket
* belongs to an info frame.
* this example doesn't deal with this case.
*/
bufferOffset = buffer;
while(bufferOffset < buffer + actualLength)
{
tlv = (SlRxMetrics_TLV_t *)bufferOffset;
header = (SlTransceiverRxOverHead_t *)(buffer + sizeof(tlv));
WLANHeader = (buffer + sizeof(tlv) + sizeof(header));
//we use the tlv.length here because this is the indication for QOS wlan header length or legacy header
bufferOffset = bufferOffset + sizeof(tlv) + tlv->length;
}
}
sl_Close(SockID);