This function gets the information of the connection destination AP candidate.

Syntax

int SysGetWLANApInfo(
  int index, 
  tstrWlanApInfo *apInfo 
);

Parameters

index
[in] Specify the array number where the wireless LAN AP information is stored (0 to 29).
apInfo
[out]A pointer to the tstrWlanApInfo structure.

Return value

Returns TRUE if the function succeeds, FALSE otherwise.

Remarks

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Sample

#include <stdio.h>
#include <stdlib.h>
#include "lib.h"

void main(void)
{
    tstrWlanApInfo apInfo;
    printf("SysGetWLANApInfo\n");
    if (SysGetWLANApInfo(0, &apInfo))
    {
        printf("SUCCESS\n");
        printf("SSID:%s\n",apInfo.au8SSID);
        if (apInfo.u8SecType == M2M_WIFI_SEC_OPEN)
        {
            printf("SecType:OPEN\n");
        }
        else if (apInfo.u8SecType == M2M_WIFI_SEC_WPA_PSK)
        {
            printf("SecType:WPA\n");
            printf("PSK:%s\n",apInfo.key.au8PSK);
        }
        else if (apInfo.u8SecType == M2M_WIFI_SEC_WEP)
        {
            printf("SecType:WEP\n");
            printf("Wepkey:%s\n",apInfo.key.strWepInfo.au8WepKey);
            printf("Index:%d\n",apInfo.key.strWepInfo.u8KeyIndx);
        }
    }
}

Last updated: 2020/11/24