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.

CC3220S-LAUNCHXL: How to know which channel of the AP i linked? And how to know AP's MAC address when linked AP?

Part Number: CC3220S-LAUNCHXL

which API can i get the channel of the linked AP?

Is there any API to get more information of linked AP?

  • Hi user4774248,

    Unfortunately, there is no API to explicitly get the details of the AP you are connected to and get the MAC address and channel number of an AP connected to the CC3220. However, there is still a method to get those details in a more indirect way.

    When you connect to an AP, you will get a WLAN event from the NWP. This event passes a SlWlanEvent_t struct with information on the BSSID of the AP, which is its MAC address. This struct also gives you the SSID of the AP you just connected to. You can see an example of how this works in the network_terminal example. If you look in SimpleLinkWlanEventHandler located in network_terminal.c of that project, you can see how it saves the BSSID and SSID and prints it out to the PC COM port.

    As for getting the channel number of the connected AP, you will need to do a network scan with the sl_WlanGetNetworkList API and then match your AP's BSSID with an entry in the returned list of APs. You can take a look at the cmdScanCallback() function in wlan_cmd.c of the network_terminal example for a demonstration of how you would scan for APs and save the scan results. printScanResults() would also be useful to look at as an example of how to iterate through the results and identify what you need.


    Regards,
    Michael
  • The way to getting the channel number is a little complicated. I must do a scan to extract the information of my AP.  Why not add return more information when do a connect action.