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.

LAUNCHCC3235MOD: LAUNCHCC3235MOD transceiver mode

Part Number: LAUNCHCC3235MOD
Other Parts Discussed in Thread: CC3235S

Hi, 

I'm using two CC3235S LaunchPads to develop a 5GHz IoT module.

Using CCS 10.4 and Simplelink SDK, I select use transceiver mode as

I don't need higher layer protocols. 

I'm using the following socket functions:

sl_Socket()

sl_SetSockOpt()

sl_Recv()

sl_Close()

for raw data reception

sl_Socket()

sl_SetSockOpt()

sl_Send()

sl_Close()

for raw data transmission.

Now I can do only one directional transmission: one LaunchPad transmits a packet and the other LaunchPad receives it only.

I can not make both Tx and Rx functions alive simultaneously.

How can I open a socket or sockets to get bidirectional transmission?

I'll appreciate any comment to help me to achieve bi-directional transmission.

BRs,

J.Y. Kim  

  • the transceiver socket is bi-directional and enables sending and/or receiving.

    What do you mean simultaneously? How exactly did you tried to use the socket and what is the failure?

  • I have to say that I'm not good at multi-threading, an old fashioned bare metal engineer.
    What I want to do is:
    - the module is idling waiting for either RF packet or uart data string,
    - when a data string from the uart comes, then I want to transmit it after parsing it.
    - when an RF packet comes, I want to process it and return
    The example codes (network_terminal_CC3235S_LAUNCHXL_tirtos_ccs) that I got from SDK
    is using multi-threading which are confusing to me.
    For example, when I call sl_Recv(), it won't return until it gets a packet. (It seems to be blocked)
    But I want it to return if there is no received data so that I can check UART data. How can I do that?
    By the same token, when I call a uart reading function like UART_radPolling(), I want it to
    return if there is no data, but it hangs there until it gets a byte.

    My codes has the following structure:

    under mainThread()

    //after initialization of resources like SPI, UART, WiFI, etc,

    while(1)
    {
       lRetVal = GetCmd((char *)&strBuffer[0], 100); => it hangs there until it gets a line of data
       if(lRetVal == 0)
       {// no uart data
        // I call sl_Socket(), sl_SetSockOpt(), sl_Redv() and sl_Close() => It doesn't come here when there is no uart data

       }
       else
       {// uart data received
           // after parsing, I call sl_Socket(), sl_SetSockOpt(), sl_Send() and sl_Close() ==> This works well
       }
       return(0);
    }

    Is there any sample codes for me to solve this issue?

  • You can set the socket as non-blocking (sl_SetSockOpt) and then the sl_Recv will return immediately but the implementation will be more complicated.

    When setting the UART to UART_MODE_CALLBACK, the UART_read (but not UART_readPolling) will not block and the received data will come through a callback in the interrupt context.

    Without changing the configuration, the GetCmd will get stuck until something is received on the UART. 

    It will not get to the receive.

    The easiest way would be to use 2 tasks:

    You should first create the raw socket (+setSockOpt if needed).

    Then create a 2nd thread to receive data (in this thread you will be calling sl_Recv in a while loop).

    On the first thread you can wait for the UART (e.g. using GetCmd) and transmit incoming data using sl_Send.

    Both the sl_Send and sl_Recv should use the same socket that was created before.

    Br,

    Kobi 

  • Dear Kobi,

    Thanks to your comment, I could go further and I'm working on parser part.

    I'm getting closer to understand the gap between the single task programming and multi-threading. 

    Thanks again.

    Regards,

    JY