SWRU368C May 2018 – January 2021 CC3100 , CC3100MOD , CC3200 , CC3200MOD
Using the host driver that controls the SimpleLink WiFi device (which includes the SimpleLink studio), the user needs only five commands to work with the abilities of the 802.11 transceiver. Because the SimpleLink WiFi device is a networking device that complies with BSD socket implementation, use the command sl_Socket with the following arguments to start the transceiver.
soc = sl_Socket(SL_AF_RF ,SL_SOCK_RAW/SL_SOCK_DGRAM,channel);
SL_AF_RF – Indicates from what level of network the user can override the frame.
SL_SOCK_RAW – Indicates an L1 raw socket (no respect for 802.11 medium access policy [CCA])
SL_SOCK_DGRAM – Indicates an L2 raw socket (respecting 802.11 medium access policies)
channel – Configures the operational channel to start receiving or transmitting traffic. Use 0 to keep the default channel.
This command returns a socket ID, a 2-byte integer that is used to reference the socket. If there is a problem with the socket, the command returns an error code.
To close the socket, use the command sl_Close:
sl_Close(soc);