CW
198
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
Transceiver
#define
RECEIVE_ADDR 0x08, 0x00, 0x28, 0x5A, 0x72, 0x3C
#define
TRANSMITTER_ADDR 0x08, 0x00, 0x28, 0x5a, 0x78, 0x1e
#define
BSSID_ADDR 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
#define
FRAME_NUMBER
0x00, 0x00
#define
QOS_CTRL 0x00, 0x00
_i32 NumOfBytes =0;
_i32 Soc=0;
_i16 Status =0;
_u32 numFrames=20;
/* Mac header */
char
buff[1536];
char
FrameBaseData[] = {
FRAME_TYPE,
/* version, type sub type */
FRAME_CONTROL,
/* Frame control flag */
DURATION,
/* duration */
RECEIVE_ADDR,
/* Receiver ADDr */
TRANSMITTER_ADDR,
/* Transmitter Address */
BSSID_ADDR,
/* destination */
FRAME_NUMBER,
/* Frame number */
QOS_CTRL};
/* Transmitter */
memcpy(buff,FrameBaseData,
sizeof
(FrameBaseData));
/* Example data */
memcpy (buff +
sizeof
(FrameBaseData), data,
sizeof
(buff ) -
sizeof
(FrameBaseData));
Soc = sl_Socket(SL_AF_RF, SL_SOCK_RAW, 1);
/* Set 20 frames to transmit */
Status = sl_SetSockOpt(Soc, SL_SOL_PHY_OPT,SL_SO_PHY_NUM_FRAMES_TO_TX,
&numFrames,
sizeof
(numFrames));
if
(Status)
{
/* Error */
}
/* Send 20 packet with the same buffer */
NumOfBytes = sl_Send(Soc,buff,
sizeof
(buff),SL_WLAN_RAW_RF_TX_PARAMS(CHANNEL_1,
SL_WLAN_RATE_1M,1,
SL_WLAN_LONG_PREAMBLE));
}
13.5 CW
The SimpleLink Wi-Fi device can transmit infinite carrier-wave signals using the sl_Send API, with NULL
buffer and 0 (zero) length.
The flags parameter in the sl_Send API is used to signal the tone offset (–25 to 25).
The CW is continuously transmitted until stopped. Stopping CW transmission is done by triggering another
sl_Send API with flags= –128 (decimal).
13.6 Changing Socket Properties
The SimpleLink Wi-Fi device offers multiple transceiver socket configurations by using the sl_SetSockOpt
API. All configurations must be set after successfully opening the socket. The configurations are not
persistent, and are deleted after the socket is closed.
13.6.1 Change Operating Channel
Change the transceiver operational channel if changing the channel during packet transmission results in
changing the channel, only after all packet transmission completes.
Example:
_i16 Status;
_i16 channel = 9;