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.

CC3220: How to see what wlan role the cc3220 is in

Part Number: CC3220

So to set a device in to AP mode I can do 

sl_WlanSetMode(ROLE_AP);

Is there a way to read what role the device is in?  I was looking for WlanGetMode, but didn't see anything.

Thanks

  • Hi,

    For this purpose you can use this API:

    _i16 RetVal = 0;
    _u16 Len = sizeof(SlWlanConnStatusParam_t);
    SlWlanConnStatusParam_t WlanConnectInfo;
    RetVal = sl_WlanGet(SL_WLAN_CONNECTION_INFO, NULL , &Len, (_u8*)&WlanConnectInfo);

    Jan

  • Thanks, I’ll give that a try.

  • Hi parsky1,

    I believe there is no direct way (such as a sl_WlanGetMode() function) to get the current wlan role. However when you start the NWP via sl_Start(), this returns the current wlan mode / an error code, and your application needs to keep track of what is returned from sl_Start(). Please see the Host Driver API for more details: dev.ti.com/.../

    Best regards,
    Kristen
  • Hi Kristen,

    Please see:

    typedef struct
    {
        _u8 Mode;       /* ROLE_STA, ROLE_AP, ROLE_P2P */
        _u8 ConnStatus; /* SlWlanConnStatusFlags_e */
        _u8 SecType;    /* Current connection security type - (0 in case of disconnect or AP mode) SL_WLAN_SEC_TYPE_OPEN, SL_WLAN_SEC_TYPE_WEP, SL_WLAN_SEC_TYPE_WPA_WPA2, SL_WLAN_SEC_TYPE_WPA_ENT, SL_WLAN_SEC_TYPE_WPS_PBC, SL_WLAN_SEC_TYPE_WPS_PIN */
        _u8 Reserved;
        SlWlanConnectionInfo_u ConnectionInfo;
    }SlWlanConnStatusParam_t;

    in wlan.h. This structure is returned form API SL_WLAN_CONNECTION_INFO. This feature in new in CC322x, at previous gen was not available.

    Jan

  • Hi Jan,

    I didn't even see that in the API. Thanks for pointing that out!

    Best regards,
    Kristen