This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Stack bypass mode Tx and Rx CC3200

Other Parts Discussed in Thread: CC3200, CC3200SDK

Hi!

I am implementing the transmission from a CC3200 board configured as STA, to another C3200 configured as AP, using the stack bypass mode.

Initially the AP waits for the connection from a STA. The output until this point is:

************************************************
CC3200 WLAN AP Rx Stack bypass mode Application
************************************************

Host Driver Version: 1.0.0.1

Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
Device is configured in default state
Device started as STATION
WLAN name: mysimplelink-1130F7
Device is configured in AP mode
Connect a client to Device

At this point, I run the program in the STA, which is configured properly and successfully establishes a connection to the AP. The STA acquires an IP. The output of the STA is:

********************************************************
CC3200 WLAN STATION and Tx traffic generator Application
********************************************************

Transmission Parameters:
Channel [1:13]: 6.
Number of packets to transmitt (1,65535): 60000.
Transmit power [0:15]: 15.
Rate (1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21): 1.
Host Driver Version: 0.0.5.1
Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
Device is configured in default state
Device started as STATION
[WLAN EVENT] STA Connected to the AP: mysimplelink-1130F7 ,BSSID: 78:a5:4:11:30:f7
[NETAPP EVENT] IP Acquired: IP=192.168.1.2 , Gateway=192.168.1.1
Connection established w/ AP and IP is aquired
Stack Bypass Socket created!. Socket Descriptor: 160
Socket_Handle = 0.
Transmitting data...
Data sent: À. Data sent: À. Data sent: À. Data sent: À. Data sent: À. Data sent: À.

As you can see after the IP is acquired, I create a bypass socket, and the socket descriptor is valid. This is done with this code:

INT32 CreateStackBypassSocket()
{
INT32 socket_descriptor = -1;
socket_descriptor = sl_Socket(SL_AF_INET, SL_SOCK_RAW, 0);
unsigned long header = 1; //1; When it is enabled, the packet must contain an IP header file:///C:/ti/CC3200SDK/cc3200-sdk/docs/simplelink_api/html/group__socket.html#ga173062c9a3a1ca728e651e98aedca7fb
sl_SetSockOpt (socket_descriptor, SL_IPPROTO_IP, SL_IP_HDRINCL, &header, sizeof(header));
return socket_descriptor;
}

// Open Stack-Bypass-Socket
//
socket_descriptor = CreateStackBypassSocket();
UART_PRINT("Stack Bypass Socket created!. Socket Descriptor: %d \n\r",socket_descriptor);

Note that header is set to 1! Is this correct?

Afterwards, I follow the code in 

http://processors.wiki.ti.com/index.php/CC31xx_%26_CC32xx_Advanced_Networking#Use-cases

to transmit from the STA. The code is:

SlSockAddrIn_t Addr;
INT16 AddrSize = 0;

Addr.sin_family = SL_AF_INET;
Addr.sin_port = sl_Htons((UINT16)0); /* No concept of port-number in raw-sockets */
// Addr.sin_addr.s_addr = sl_Htonl((UINT32)<destination_ip_address>); // No IP needed in Stack bypass sockets?
Addr.sin_addr.s_addr = sl_Htonl((UINT32)"0xC0A80102"); // 192.168.1.2 //No IP needed in Stack bypass sockets?
AddrSize = sizeof(SlSockAddrIn_t);

Socket_Handle = sl_Connect(socket_descriptor, ( SlSockAddr_t *)&Addr, AddrSize);

//Note that trying to be as close as possible to the example I use sl_Connect, although the STA is already connected to the AP, I understand this maps the IP Address to the socket_descriptor. Is this correct? I am using the IP address in hex. as shown above. From this operation, I am obtaining the Socket_Handle and then I use it to transmit. Is this correct? or is the socket_descriptor the same as the socket_handle? I already tried this, deleting the sl_Connect function line, but it did not work.

Report("Socket_Handle = %d.\n\r",Socket_Handle);

lRetVal = Tx_continuous(User.channel,User.rate,User.packets,User.Txpower,0,Socket_Handle);

// with:

static int Tx_continuous(int iChannel,int rate,int iNumberOfPackets,int iTxPowerLevel,long dIntervalMiliSec,int Socket_Handle)
{
long lRetVal = -1;
long ulIndex;

UART_PRINT("Transmitting data...\r\n");
for(ulIndex = 0 ; ulIndex < iNumberOfPackets ; ulIndex++)
//while (1)
{
lRetVal = sl_Send(Socket_Handle,RawData,sizeof(RawData),SL_RAW_RF_TX_PARAMS(iChannel, rate, iTxPowerLevel, PREAMBLE));
//lRetVal = sl_Send(socket_descriptor,RawData,sizeof(RawData),0);
Report("Data sent: %s. ",RawData);
if(lRetVal < 0)
{
UART_PRINT("Transmition Failed!\r\n");
sl_Close(Socket_Handle);
ASSERT_ON_ERROR(__LINE__, lRetVal);
}
//Sleep(dIntervalMiliSec);
MAP_UtilsDelay(4000000);
}

lRetVal = sl_Close(Socket_Handle);
ASSERT_ON_ERROR(__LINE__, lRetVal);
UART_PRINT("Transmission complete.\r\n");
return SUCCESS;
}

The whole output from the STA terminal is:

********************************************************
CC3200 WLAN STATION and Tx traffic generator Application
********************************************************

Transmission Parameters:
Channel [1:13]: 6. //The channel was checked with a "sniffer", and it is working on channel 6
Number of packets to transmitt (1,65535): 60000.
Transmit power [0:15]: 15.
Rate (1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21): 1.
Host Driver Version: 0.0.5.1
Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
Device is configured in default state
Device started as STATION
[WLAN EVENT] STA Connected to the AP: mysimplelink-1130F7 ,BSSID: 78:a5:4:11:30:f7
[NETAPP EVENT] IP Acquired: IP=192.168.1.2 , Gateway=192.168.1.1
Connection established w/ AP and IP is aquired
Stack Bypass Socket created!. Socket Descriptor: 160
Socket_Handle = 0.
Transmitting data...
Data sent: À. Data sent: À. Data sent: À. Data sent: À. Data sent: À. Data sent: À.

...

At the STA we have:

#define PREAMBLE 1//1 /* Preamble value 0- short, 1- long */ //Is this correct, I am not setting preamble at the AP
char RawData[] = {0x01,0x06, 0x01}; 

At the AP, I open a socket and then try to follow the code in the webpage above. The code is:

SlSockAddrIn_t Addr;
UINT8 buffer[3]={'\0'};
INT32 recievedBytes = 0;
INT16 AddrSize = 0;

long lRetValRx = -1;
char acBuffer[5];

int pkts_to_receive = 10;

int Socket_Handle;
//
// Open Stack-Bypass-Socket
//
socket_descriptor = CreateStackBypassSocket();
UART_PRINT("Stack Bypass Socket created!. Socket Descriptor: %d \n\r",socket_descriptor);

if(socket_descriptor < 0)
{
UART_PRINT("Failed to create socket\r\n");
//ASSERT_ON_ERROR(__LINE__, socket_descriptor);
UART_PRINT("Error.\r\n");
}

Addr.sin_family = SL_AF_INET;
Addr.sin_port = sl_Htons((UINT16)0);
Addr.sin_addr.s_addr = sl_Htonl((UINT32)"0xC0A80101"); //192.168.1.1 //Is this IP correct?
AddrSize = sizeof(SlSockAddrIn_t);
Socket_Handle = sl_Connect(socket_descriptor, ( SlSockAddr_t *)&Addr, AddrSize); //Is this correct?, the STA is already connected to the AP.

while(pkts_to_receive--)
{
memset(&buffer[0], 0, sizeof(buffer));
// recievedBytes = sl_Recv(Socket_Handle, buffer, 3, 0);
recievedBytes = sl_Recv(Socket_Handle, acBuffer, 3, 0);
//recievedBytes = sl_Recv (<socket_handle>, <raw_data_packet>, <packet_szie>, 0); // How do I get <raw_data_packet>?
Report("Received data: %s",recievedBytes);
}

sl_Close(Socket_Handle);

The whole output at the AP is:

************************************************
CC3200 WLAN AP Rx Stack bypass mode Application
************************************************

Host Driver Version: 1.0.0.1
Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
Device is configured in default state
Device started as STATION
WLAN name: mysimplelink-1130F7
Device is configured in AP mode
Connect a client to Device
[NETAPP EVENT] IP Leased to Client: IP=192.168.1.2 ,
Client is connected to Device
Stack Bypass Socket created!. Socket Descriptor: 160
Socket_Handle = 0.

The receiver is stuck at:

lRetValRx = sl_Recv(socket_descriptor,acBuffer,3,0); //sl_Recv(socket_descriptor,acBuffer,3,0); //sl_Recv(iSoc,acBuffer,1470,0);

What changes do I need to do, to properly transmit from the STA to the AP in stack bypass mode?

Could you please include a working example?

Thanks!

  • Hi, 

    I modified the code, and currently I can transmit from the STA to the AP. But for each packet transmitted, I am receiving 3 packets. 

    This is the code at the STA:

    const void * RawData = "tk";

    ...

    INT32 CreateStackBypassSocket()
    {
    INT32 socket_descriptor = -1;
    socket_descriptor = sl_Socket(SL_AF_INET, SL_SOCK_RAW, 0);
    // unsigned long header = 1; //1; When it is enabled, the packet must contain an IP header file:///C:/ti/CC3200SDK/cc3200-sdk/docs/simplelink_api/html/group__socket.html#ga173062c9a3a1ca728e651e98aedca7fb
    // sl_SetSockOpt (socket_descriptor, SL_IPPROTO_IP, SL_IP_HDRINCL, &header, sizeof(header));
    sl_SetSockOpt (socket_descriptor, SL_IPPROTO_IP, SL_IP_HDRINCL, NULL, NULL);
    return socket_descriptor;
    }

    //
    // Open Stack-Bypass-Socket
    //
    socket_descriptor = CreateStackBypassSocket();
    UART_PRINT("Stack Bypass Socket created!. Socket Descriptor: %d \n\r",socket_descriptor);

    // socket_descriptor = sl_Socket(SL_AF_RF,SL_SOCK_RAW,iChannel); //This was to open a transceiver socket
    if(socket_descriptor < 0)
    {
    UART_PRINT("Failed to create socket\r\n");
    //ASSERT_ON_ERROR(__LINE__, socket_descriptor);
    }

    Addr.sin_family = SL_AF_INET;
    Addr.sin_port = sl_Htons((UINT16)0); /* No concept of port-number in raw-sockets */
    Addr.sin_addr.s_addr = sl_Htonl(SL_IPV4_VAL(192,168,1,1)); // 192.168.1.2
    AddrSize = sizeof(SlSockAddrIn_t);
    Status = sl_Connect(socket_descriptor, ( SlSockAddr_t *)&Addr, AddrSize);
    Report("sl_Connect_Status = %d\n\r",Status);

    UART_PRINT("Transmitting data...\r\n");

    while (1)
    {
    //lRetVal = sl_Send(Socket_Handle,RawData,sizeof(RawData),SL_RAW_RF_TX_PARAMS(iChannel, rate, iTxPowerLevel, PREAMBLE));
    Status= sl_Send(socket_descriptor,RawData,sizeof(RawData),0);
    Report("sl_Send_Status = %d. Data sent: %s.\n\r",Status,RawData);

    if(Status < 0)
    {
    UART_PRINT("Transmition Failed!\r\n");
    sl_Close(socket_descriptor);
    //ASSERT_ON_ERROR(__LINE__, lRetVal);
    }
    //Sleep(dIntervalMiliSec);
    MAP_UtilsDelay(40000000);
    }

    This is the code at the AP:

    //
    // Open Stack-Bypass-Socket
    //
    socket_descriptor = CreateStackBypassSocket();
    UART_PRINT("Stack Bypass Socket created!. Socket Descriptor: %d \n\r",socket_descriptor);

    // socket_descriptor = sl_Socket(SL_AF_RF,SL_SOCK_RAW,iChannel); //This was to open a transceiver socket
    if(socket_descriptor < 0)
    {
    UART_PRINT("Failed to create socket\r\n");
    //ASSERT_ON_ERROR(__LINE__, socket_descriptor);
    UART_PRINT("Error.\r\n");
    }

    Addr.sin_family = SL_AF_INET;
    Addr.sin_port = sl_Htons((UINT16)0);
    Addr.sin_addr.s_addr = sl_Htonl(SL_IPV4_VAL(192,168,1,2)); //192.168.1.2
    AddrSize = sizeof(SlSockAddrIn_t);
    sl_Connect(socket_descriptor, ( SlSockAddr_t *)&Addr, AddrSize);

    UART_PRINT("Receiving data...\r\n");

    //while(pkts_to_receive--)
    while (1)
    {
    memset(&buffer[0], 0, sizeof(buffer));
    recievedBytes = sl_Recv(socket_descriptor, buffer, sizeof(buffer), 0);
    //recievedBytes = sl_Recv (<socket_handle>, <raw_data_packet>, <packet_szie>, 0);
    Report("Received Bytes: %c. buffer: %s.\n\r",recievedBytes,buffer);
    }

    The output at the STA is:

    ********************************************************
    CC3200 WLAN STATION and Tx traffic generator Application
    ********************************************************

    Transmission Parameters:
    Channel [1:13]: 6.
    Number of packets to transmitt (1,65535): 60000.
    Transmit power [0:15]: 15.
    Rate (1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21): 1.
    Host Driver Version: 0.0.5.1
    Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
    Device is configured in default state
    Device started as STATION
    [WLAN EVENT] STA Connected to the AP: mysimplelink-1130F7 ,BSSID: 78:a5:4:11:30:f7
    [NETAPP EVENT] IP Acquired: IP=192.168.1.2 , Gateway=192.168.1.1
    Connection established w/ AP and IP is aquired
    Stack Bypass Socket created!. Socket Descriptor: 160
    sl_Connect_Status = 0
    Transmitting data...
    sl_Send_Status = 4. Data sent: tk.
    sl_Send_Status = 4. Data sent: tk.
    sl_Send_Status = 4. Data sent: tk.
    sl_Send_Status = 4. Data sent: tk.

    The output at the AP is:

    ************************************************
    CC3200 WLAN AP Rx Stack bypass mode Application
    ************************************************

    Host Driver Version: 1.0.0.1
    Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
    Device is configured in default state
    Device started as STATION
    WLAN name: mysimplelink-1130F7
    Device is configured in AP mode
    Connect a client to Device
    [NETAPP EVENT] IP Leased to Client: IP=192.168.1.2 ,
    Client is connected to Device
    Stack Bypass Socket created!. Socket Descriptor: 160
    Receiving data...
    Received Bytes: . buffer: ¨ÿ.
    Received Bytes: . buffer: tk.
    Received Bytes: . buffer: À.
    Received Bytes: . buffer: ¨ÿ.
    Received Bytes: . buffer: tk.
    Received Bytes: . buffer: À.
    Received Bytes: . buffer: ¨ÿ.
    Received Bytes: . buffer: tk.
    Received Bytes: . buffer: À.
    Received Bytes: . buffer: ¨ÿ.
    Received Bytes: . buffer: tk.
    Received Bytes: . buffer: À.

    So for each packet transmitted, I am receiving 3 packets (wrong, correct, wrong). Why? But the wrong packets are deterministic. Note that I am looking into the variable buffer at the AP.

    I guess I am missing something while receiving, what?

    Thanks!

  • A new example of the current behavior.

    At the STA, for each time the following command is executed:

    Status= sl_Send(socket_descriptor,RawData,sizeof(RawData),0);

    2 frames are being sent. The first one is incorrect, but the second one contains the correct transmitted information.

    Code for the STA:

    char RawData[] = "t";

    ...

    INT32 CreateStackBypassSocket()
    {
    INT32 socket_descriptor = -1;
    socket_descriptor = sl_Socket(SL_AF_INET, SL_SOCK_RAW, 0);
    // unsigned long header = 1; //1; When it is enabled, the packet must contain an IP header file:///C:/ti/CC3200SDK/cc3200-sdk/docs/simplelink_api/html/group__socket.html#ga173062c9a3a1ca728e651e98aedca7fb
    // sl_SetSockOpt (socket_descriptor, SL_IPPROTO_IP, SL_IP_HDRINCL, &header, sizeof(header));
    sl_SetSockOpt (socket_descriptor, SL_IPPROTO_IP, SL_IP_HDRINCL, NULL, NULL);
    return socket_descriptor;
    }

    ...

    SlSockAddrIn_t Addr;
    INT16 AddrSize = 0;
    int Status;

    /* create a raw-socket following the instructions given in the above section*/
    //
    // Open Stack-Bypass-Socket
    //
    socket_descriptor = CreateStackBypassSocket();
    UART_PRINT("Stack Bypass Socket created!. Socket Descriptor: %d \n\r",socket_descriptor);

    // socket_descriptor = sl_Socket(SL_AF_RF,SL_SOCK_RAW,iChannel); //This was to open a transceiver socket
    if(socket_descriptor < 0)
    {
    UART_PRINT("Failed to create socket\r\n");
    //ASSERT_ON_ERROR(__LINE__, socket_descriptor);
    }

    Addr.sin_family = SL_AF_INET;
    Addr.sin_port = sl_Htons((UINT16)0); /* No concept of port-number in raw-sockets */
    Addr.sin_addr.s_addr = sl_Htonl(SL_IPV4_VAL(192,168,1,1)); // 192.168.1.2
    AddrSize = sizeof(SlSockAddrIn_t);
    Status = sl_Connect(socket_descriptor, ( SlSockAddr_t *)&Addr, AddrSize);
    Report("sl_Connect_Status = %d\n\r",Status);

    UART_PRINT("Transmitting data...\r\n");

    while (1)
    {
    //lRetVal = sl_Send(Socket_Handle,RawData,sizeof(RawData),SL_RAW_RF_TX_PARAMS(iChannel, rate, iTxPowerLevel, PREAMBLE));
    // Status= sl_Send(socket_descriptor,RawData,sizeof(RawData),0);
    Status= sl_Send(socket_descriptor,RawData,sizeof(RawData),0);
    Report("sl_Send_Status = %d. Data sent: %s. sizeof(RawData):%d.\n\r",Status,RawData,sizeof(RawData));

    if(Status < 0)
    {
    UART_PRINT("Transmition Failed!\r\n");
    sl_Close(socket_descriptor);
    //ASSERT_ON_ERROR(__LINE__, lRetVal);
    }
    //Sleep(dIntervalMiliSec);
    MAP_UtilsDelay(40000000);
    }
    }

    Code for the AP:

    INT32 CreateStackBypassSocket()
    {
    INT32 socket_descriptor = -1;
    socket_descriptor = sl_Socket(SL_AF_INET, SL_SOCK_RAW, 0);
    //unsigned long header = 1; //1; When it is enabled, the packet must contain an IP header file:///C:/ti/CC3200SDK/cc3200-sdk/docs/simplelink_api/html/group__socket.html#ga173062c9a3a1ca728e651e98aedca7fb
    //sl_SetSockOpt (socket_descriptor, SL_IPPROTO_IP, SL_IP_HDRINCL, &header, sizeof(header));
    sl_SetSockOpt (socket_descriptor, SL_IPPROTO_IP, SL_IP_HDRINCL, NULL, NULL);
    return socket_descriptor;
    }

    ...

    SlSockAddrIn_t Addr;
    //int BUFFER_SIZE = 8;
    UINT8 buffer[8]={'\0'};
    //void * buffer[2];
    INT32 recievedBytes = 0;
    INT16 AddrSize = 0;

    //
    // Open Stack-Bypass-Socket
    //
    socket_descriptor = CreateStackBypassSocket();
    UART_PRINT("Stack Bypass Socket created!. Socket Descriptor: %d \n\r",socket_descriptor);

    // socket_descriptor = sl_Socket(SL_AF_RF,SL_SOCK_RAW,iChannel); //This was to open a transceiver socket
    if(socket_descriptor < 0)
    {
    UART_PRINT("Failed to create socket\r\n");
    //ASSERT_ON_ERROR(__LINE__, socket_descriptor);
    UART_PRINT("Error.\r\n");
    }

    Addr.sin_family = SL_AF_INET;
    Addr.sin_port = sl_Htons((UINT16)0);
    Addr.sin_addr.s_addr = sl_Htonl(SL_IPV4_VAL(192,168,1,2)); //192.168.1.2
    AddrSize = sizeof(SlSockAddrIn_t);
    sl_Connect(socket_descriptor, ( SlSockAddr_t *)&Addr, AddrSize);

    UART_PRINT("Receiving data...\r\n");

    //while(pkts_to_receive--)
    while (1)
    {
    memset(&buffer[0], 0, sizeof(buffer));
    //recievedBytes = sl_Recv(socket_descriptor, buffer, sizeof(buffer), 0);
    recievedBytes = sl_Recv(socket_descriptor, buffer, 8, 0);
    //recievedBytes = sl_Recv (<socket_handle>, <raw_data_packet>, <packet_szie>, 0);
    Report("Received Bytes: %d. buffer: %s. sizeof(buffer): %d.\n\r",recievedBytes,buffer,sizeof(buffer));
    }

    Output at the STA:

    ********************************************************
    CC3200 WLAN STATION and Tx traffic generator Application
    ********************************************************

    Host Driver Version: 0.0.5.1
    Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
    Device is configured in default state
    Device started as STATION
    [WLAN EVENT] STA Connected to the AP: mysimplelink-1130F7 ,BSSID: 78:a5:4:11:30:f7
    [NETAPP EVENT] IP Acquired: IP=192.168.1.2 , Gateway=192.168.1.1
    Connection established w/ AP and IP is aquired
    Stack Bypass Socket created!. Socket Descriptor: 160
    sl_Connect_Status = 0
    Transmitting data...
    sl_Send_Status = 2. Data sent: t. sizeof(RawData):2.
    sl_Send_Status = 2. Data sent: t. sizeof(RawData):2.
    sl_Send_Status = 2. Data sent: t. sizeof(RawData):2.
    sl_Send_Status = 2. Data sent: t. sizeof(RawData):2.

    Output at the AP:

    ***********************************************
    CC3200 WLAN AP Rx Stack bypass mode Application
    ***********************************************

    Host Driver Version: 1.0.0.1
    Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
    Device is configured in default state
    Device started as STATION
    WLAN name: mysimplelink-1130F7
    Device is configured in AP mode
    Connect a client to Device
    [NETAPP EVENT] IP Leased to Client: IP=192.168.1.2 ,
    Client is connected to Device
    Stack Bypass Socket created!. Socket Descriptor: 160
    Receiving data...
    Received Bytes: 8. buffer: (. sizeof(buffer): 8.
    Received Bytes: 2. buffer: t. sizeof(buffer): 8.
    Received Bytes: 8. buffer: (. sizeof(buffer): 8.
    Received Bytes: 2. buffer: t. sizeof(buffer): 8.
    Received Bytes: 8. buffer: (. sizeof(buffer): 8.
    Received Bytes: 2. buffer: t. sizeof(buffer): 8.
    Received Bytes: 8. buffer: (. sizeof(buffer): 8.
    Received Bytes: 2. buffer: t. sizeof(buffer): 8.

    Why are 2 packets being transmitted with the command

    Status= sl_Send(socket_descriptor,RawData,sizeof(RawData),0);

    ?

  • I increased the size of the receiving buffer, and now I just receive 1 frame per transmitted frame, but the useful data is starting at byte 20, why? I would like to understand this behavior.

    The RawData transmitted at the STA is now:

    char RawData[] = "123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456";

    To increase the size of the buffer at the receiver, the code was changed as follows:

    UINT8 buffer[1000]={'\0'};

    while (1)
    {
    memset(&buffer[0], 0, sizeof(buffer));
    //recievedBytes = sl_Recv(socket_descriptor, buffer, sizeof(buffer), 0);
    //Report("Buffer_before_sl_Recv: %s.\n\r",buffer);
    recievedBytes = sl_Recv(socket_descriptor, buffer, sizeof(buffer), 0);
    //recievedBytes = sl_Recv (<socket_handle>, <raw_data_packet>, <packet_szie>, 0);
    Report("Received Bytes: %d. &buffer[20]: %s. sizeof(buffer): %d.\n\r",recievedBytes,&buffer[20],sizeof(buffer));
    }

    The output at the STA is:

    ********************************************************
    CC3200 WLAN STATION and Tx traffic generator Application
    ********************************************************

    Host Driver Version: 0.0.5.1
    Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
    Device is configured in default state
    Device started as STATION
    [WLAN EVENT] STA Connected to the AP: mysimplelink-1130F7 ,BSSID: 78:a5:4:11:30:f7
    [NETAPP EVENT] IP Acquired: IP=192.168.1.2 , Gateway=192.168.1.1
    Connection established w/ AP and IP is aquired
    Stack Bypass Socket created!. Socket Descriptor: 160
    sl_Connect_Status = 0
    Transmitting data...
    sl_Send_Status = 253. Data sent: 123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456. sizeof(RawData):253.
    sl_Send_Status = 253. Data sent: 123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456. sizeof(RawData):253.

    The output at the AP is:

    ***********************************************
    CC3200 WLAN AP Rx Stack bypass mode Application
    ***********************************************

    Host Driver Version: 1.0.0.1
    Build Version 2.0.7.0.31.0.0.4.2.1.5.3.3
    Device is configured in default state
    Device started as STATION
    WLAN name: mysimplelink-1130F7
    Device is configured in AP mode
    Connect a client to Device
    [NETAPP EVENT] IP Leased to Client: IP=192.168.1.2 ,
    Client is connected to Device
    Stack Bypass Socket created!. Socket Descriptor: 160
    Receiving data...
    Received Bytes: 273. &buffer[20]: 123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456. sizeof(buffer): 1000.
    Received Bytes: 273. &buffer[20]: 123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456123456. sizeof(buffer): 1000.

    So, the data is being correctly transmitted, but at the receiver buffer, the correct data is being stored from the byte 20 on. At byte 0 an 'E' is stored and '.' is stored in the remaining positions. Therefore, it seems that 20 bytes are being added to the transmitted information, why? I am using the stack bypass mode.

    Any info to make clear this behavior is appreciated. Thanks!

  • Fernando,

    Allow me to try out this example on my platform and get back.

    -Praneet