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.

CCS/BOOSTXL-CC3135: issue with p2p in network terminal

Part Number: BOOSTXL-CC3135
Other Parts Discussed in Thread: CC3135

Tool/software: Code Composer Studio

Hello,

i'm trying to connect two CC3135 via p2p with the network terminal example. For that i use the command "p2pstart" with both devices. Is this correct? They only tell me that they have found a device and waiting for negotiation. After that nothing else happens. Am i doing something wrong?

  • Hey Christoph,

    This should work and connect automatically. One thing you can try is setting one device to SL_WLAN_P2P_NEG_INITIATOR_ACTIVE and the other to SL_WLAN_P2P_NEG_INITIATOR_PASSIVE in the setP2Pparam function in wlan_cmd.c. It should be working with SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF but that is not what you're seeing. If what I suggested above does not work I will have to test this. Let me know.

    Also for more information you can read section 4.5.3 here: http://www.ti.com/lit/ug/swru455i/swru455i.pdf

    Jesu

  • Hi Jesu,

    thanks so far. I set one device to active and the other to passive (see code in screenshots). Is this all i have to change? They are still not connecting. In the terminal it looks exactly the same like before. I also tried several different combinations of the SL_WLAN_P2P_NEG_INITIATOR... and SL_WLAN_P2P_ROLE... (GO and Cilent). Nothing worked.

    -----------------------------------------------------------------------------------------------------------------------------------------

    Regards,

    Christoph

  • Hi Christoph,

    I just tested this and I am getting the same behavior as you. My guess is that since multiple P2P remote devices are found - none of the devices are sending negotiation request automatically because they don't know which one to send it to. I'm not in an environment that allows me to test this theory but if you are perhaps you can give it a try and let me know. 

    If you cannot, below is the alternative assuming the network_terminal example is left as is...

    Call p2pstart in one device and let it wait for a negation request. 

    In p2pconnect(), comment out the code that waits for the negotation request and initiates a connection:

    UART_PRINT("\n\r[p2pstart] : Waiting for Negotiation request ...\n\r");
    UART_PRINT(cmdPromptStr);
    ret = sem_wait(&app_CB.P2P_CB.RcvNegReq);
    
    if(ret < 0)
    {
        SHOW_WARNING(ret, OS_ERROR);
        return (NULL);
    }
    
    /* Replay with connection request */
    UART_PRINT("\n\r[p2pstart] : Connecting ...\n\r");
    ret = sendConnectionReq();
    
    if(ret < 0)
    {
        SHOW_WARNING(ret, OS_ERROR);
        return (NULL);
    }

    Now add your own code that will manually connect to the other device waiting for a connection request:

    _i16 Status;
    SlWlanSecParams_t SecParams;
    signed char* SSID = "mysimplelink_MB";
    
    SecParams.Type = SL_WLAN_SEC_TYPE_P2P_PBC;
    SecParams.Key = "";
    SecParams.KeyLen = 0;
    
    Status = sl_WlanConnect(SSID, strlen("mysimplelink_MB"), 0, &SecParams ,0);
    if( Status )
    {
        // check for error
    }
    

    I tested this and it works. If you need a more robust solution the SL_WLAN_EVENT_P2P_DEVFOUND event in the SimpleLinkWlanEventHandler will tell you the device name by checking pWlanEvent->Data.P2PDevFound.GoDeviceName in that case. You can use that device name when calling sl_WlanConnect like shown above.

    Jesu

  • Hi Jesu,

    thanks for your effort into this. I will try it out. Have a nice weekend.

    Regards,

    Christoph