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

Syntax

int SysSetWLANApInfo(
  int index,
  tstrWlanApInfo *apInfo
);

Parameters

index
[in] Specify the array number that stores the AP information of the wireless LAN (0 to 29).
apInfo
[in]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 <string.h>
#include "lib.h"

void main(void)
{
    tstrWlanApInfo apInfo;
    printf("SysSetWLANApInfo\n");
    memset(&apInfo, 0, sizeof(tstrWlanApInfo));
    apInfo.u8SecType = M2M_WIFI_SEC_WPA_PSK;
    strcpy(apInfo.au8SSID, "ssid");
    strcpy(apInfo.key.au8PSK, "password");
    if (SysSetWLANApInfo(29, &apInfo))
        printf("SUCCESS\n");
    while(1)
        Idle();
}

Last updated: 2020/11/24