SWRU368C May 2018 – January 2021 CC3100 , CC3100MOD , CC3200 , CC3200MOD
The user can open and close the transceiver using two commands. To start the traffic flow, use the sl_Send command to transmit and the sl_Recv command to receive.
sl_Send(soc ,RawData ,len ,flags);
soc – Socket ID
RawData – The char *array holds the data to send, beginning with the first byte of the 802.11 MAC header.
len – The size of the data in bytes
flags – Usually the user sets this parameter to 0, but the user can change any of the default channel/rate/tx-power/11b-preamble parameters using this parameter. Use the SL_RAW_RF_TX_PARAMS macro to specify the mentioned parameters.
Returns – The number of bytes sent
For example, to transmit a frame on channel 1 using the 1MBPS data rate with Tx power setting of 1 and short preamble (valid only for 11b), use:
sl_Send(soc,buf,len,SL_RAW_RF_TX_PARAMS(CHANNEL_1, RATE_1M,1, TI_SHORT_PREAMBLE));
sl_Recv(soc,buffer,500,0);
soc – Socket ID
buffer – The char *array used for containing the received packet
500 – The maximum size of the packet received. The maximum size is 1472: if the packet is longer, the rest are discarded.
The last argument should always be 0, which indicates no flags.
Return – The number of bytes received