Only a single transceiver socket is supported. To start the transceiver mode, use the sl_Socket API with the following arguments:
- Domain – Set to SL_AF_RF; indicates transceiver mode socket. Configure this value as the family parameter.
- Type – Set to one of the following options:
- SL_SOCK_RAW – Indicates an L1 mode raw socket (no respect for 802.11 medium access policy - CCA)
- SL_SOCK_DGRAM – Indicates an L2 mode raw socket (respecting 802.11 medium access policies)
- Protocol - used for select special setting for the socket. Supports the following settings:
- Channel – Used for configuring the operational channel from which the device should start receiving or transmitting traffic. If the channel is set to 0, the channel is set as the last transceiver channel used. If this is the first time the transceiver socket is open, a channel should be applied by the sl_SetSockOpt operation, or by the flags parameter in the sl_Send operation.
- Rate range – Optional setting, lets the user ensure that the rates and power used in this socket are within a certain range. This setting is applicable for channels on the 5-GHz band, and lets the user optimize the calibration process on these channels to reduce the total system power consumption.
This command must be called only when the device is in STA role and disconnected. The command returns the socket ID, which is used from now on to reference the socket. If there is a problem with the socket, the command returns a negative error code.
Example:
_i16 sd;
_i16 channel = 6;
sd = sl_Socket(SL_AF_RF ,SL_SOCK_RAW/SL_SOCK_DGRAM, channel);