le_wifiAp API Reference

Files

file  le_wifiAp_common.h
 
file  le_wifiAp_interface.h
 

Macros

#define LE_WIFIAP_BITMASK_IEEE_STD_A   0x1
 
#define LE_WIFIAP_BITMASK_IEEE_STD_B   0x2
 
#define LE_WIFIAP_BITMASK_IEEE_STD_G   0x4
 
#define LE_WIFIAP_BITMASK_IEEE_STD_AD   0x8
 
#define LE_WIFIAP_BITMASK_IEEE_STD_D   0x10
 
#define LE_WIFIAP_BITMASK_IEEE_STD_H   0x20
 
#define LE_WIFIAP_BITMASK_IEEE_STD_N   0x40
 
#define LE_WIFIAP_BITMASK_IEEE_STD_AC   0x80
 
#define LE_WIFIAP_BITMASK_IEEE_STD_AX   0x100
 
#define LE_WIFIAP_BITMASK_IEEE_STD_W   0x200
 

Typedefs

typedef uint32_t le_wifiAp_IeeeStdBitMask_t
 
typedef struct le_wifiAp_NewEventHandler * le_wifiAp_NewEventHandlerRef_t
 
typedef void(* le_wifiAp_EventHandlerFunc_t) (le_wifiAp_Event_t event, void *contextPtr)
 
typedef void(* le_wifiAp_DisconnectHandler_t) (void *)
 

Enumerations

enum  le_wifiAp_Event_t { LE_WIFIAP_EVENT_CLIENT_CONNECTED = 0, LE_WIFIAP_EVENT_CLIENT_DISCONNECTED = 1 }
 
enum  le_wifiAp_SecurityProtocol_t { LE_WIFIAP_SECURITY_NONE = 0, LE_WIFIAP_SECURITY_WPA2 = 1 }
 

Functions

void le_wifiAp_ConnectService (void)
 
le_result_t le_wifiAp_TryConnectService (void)
 
LE_FULL_API void le_wifiAp_SetServerDisconnectHandler (le_wifiAp_DisconnectHandler_t disconnectHandler, void *contextPtr)
 
void le_wifiAp_DisconnectService (void)
 
le_wifiAp_NewEventHandlerRef_t le_wifiAp_AddNewEventHandler (le_wifiAp_EventHandlerFunc_t handlerPtr, void *contextPtr)
 
void le_wifiAp_RemoveNewEventHandler (le_wifiAp_NewEventHandlerRef_t handlerRef)
 
le_result_t le_wifiAp_Start (void)
 
le_result_t le_wifiAp_Stop (void)
 
le_result_t le_wifiAp_SetSsid (const uint8_t *ssidPtr, size_t ssidSize)
 
le_result_t le_wifiAp_SetSecurityProtocol (le_wifiAp_SecurityProtocol_t securityProtocol)
 
le_result_t le_wifiAp_SetPassPhrase (const char *LE_NONNULL passPhrase)
 
le_result_t le_wifiAp_SetPreSharedKey (const char *LE_NONNULL preSharedKey)
 
le_result_t le_wifiAp_SetDiscoverable (bool discoverable)
 
le_result_t le_wifiAp_SetIeeeStandard (le_wifiAp_IeeeStdBitMask_t stdMask)
 
le_result_t le_wifiAp_GetIeeeStandard (le_wifiAp_IeeeStdBitMask_t *stdMaskPtrPtr)
 
le_result_t le_wifiAp_SetChannel (uint16_t channelNumber)
 
le_result_t le_wifiAp_SetCountryCode (const char *LE_NONNULL countryCode)
 
le_result_t le_wifiAp_SetMaxNumberOfClients (int8_t maxNumberOfClient)
 
le_result_t le_wifiAp_SetIpRange (const char *LE_NONNULL ipAp, const char *LE_NONNULL ipStart, const char *LE_NONNULL ipStop)
 

Detailed Description

Macro Definition Documentation

◆ LE_WIFIAP_BITMASK_IEEE_STD_A

#define LE_WIFIAP_BITMASK_IEEE_STD_A   0x1

IEEE 802.11 standards Bit Mask

Typedef Documentation

◆ le_wifiAp_DisconnectHandler_t

typedef void(* le_wifiAp_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

◆ le_wifiAp_EventHandlerFunc_t

typedef void(* le_wifiAp_EventHandlerFunc_t) (le_wifiAp_Event_t event, void *contextPtr)

Handler for WiFi Access Point changes

◆ le_wifiAp_NewEventHandlerRef_t

typedef struct le_wifiAp_NewEventHandler* le_wifiAp_NewEventHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'le_wifiAp_NewEvent'

Enumeration Type Documentation

◆ le_wifiAp_Event_t

WiFi Access Point Events.

Enumerator
LE_WIFIAP_EVENT_CLIENT_CONNECTED 

Client connected to WiFi Access Point.

LE_WIFIAP_EVENT_CLIENT_DISCONNECTED 

Client disconnected from WiFi Access Point.

◆ le_wifiAp_SecurityProtocol_t

WiFi Access Point Security levels.

Enumerator
LE_WIFIAP_SECURITY_NONE 

WiFi Access Point is open and has no password.

LE_WIFIAP_SECURITY_WPA2 

WiFi Access Point has WPA2 activated.

Function Documentation

◆ le_wifiAp_AddNewEventHandler()

le_wifiAp_NewEventHandlerRef_t le_wifiAp_AddNewEventHandler ( le_wifiAp_EventHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

WiFi Access Point Events. WiFi Access Point Security levels. IEEE 802.11 standards Bit Mask Handler for WiFi Access Point changes Reference type used by Add/Remove functions for EVENT 'le_wifiAp_NewEvent' Add handler function for EVENT 'le_wifiAp_NewEvent'

These events provide information on WiFi Access Point

Parameters
[in]handlerPtr
[in]contextPtr

◆ le_wifiAp_ConnectService()

void le_wifiAp_ConnectService ( void  )

Connect the current client thread to the service providing this API. Block until the service is available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client Specific Functions.

This function is created automatically.

◆ le_wifiAp_DisconnectService()

void le_wifiAp_DisconnectService ( void  )

Disconnect the current client thread from the service providing this API.

Normally, this function doesn't need to be called. After this function is called, there's no longer a connection to the service, and the functions in this API can't be used. For details, see Client Specific Functions.

This function is created automatically.

◆ le_wifiAp_GetIeeeStandard()

le_result_t le_wifiAp_GetIeeeStandard ( le_wifiAp_IeeeStdBitMask_t *  stdMaskPtrPtr)

Get which IEEE standard was set. Default hardware mode is IEEE 802.11g.

Returns
  • LE_FAULT if the function failed.
  • LE_OK if the function succeeded.
Parameters
[out]stdMaskPtrPtrBit mask for the IEEE standard.

◆ le_wifiAp_RemoveNewEventHandler()

void le_wifiAp_RemoveNewEventHandler ( le_wifiAp_NewEventHandlerRef_t  handlerRef)

Remove handler function for EVENT 'le_wifiAp_NewEvent'

Parameters
[in]handlerRef

◆ le_wifiAp_SetChannel()

le_result_t le_wifiAp_SetChannel ( uint16_t  channelNumber)

Set which WiFi Channel to use. Default value is 7. Some legal restrictions might apply for your region. The channel number must be between 1 and 14 for IEEE 802.11b/g. The channel number must be between 7 and 196 for IEEE 802.11a. The channel number must be between 1 and 6 for IEEE 802.11ad.

Returns
  • LE_OUT_OF_RANGE if requested channel number is out of range.
  • LE_OK if the function succeeded.
Parameters
[in]channelNumberthe channel number.

◆ le_wifiAp_SetCountryCode()

le_result_t le_wifiAp_SetCountryCode ( const char *LE_NONNULL  countryCode)

Set what country code to use for regulatory domain. ISO/IEC 3166-1 Alpha-2 code is used. Default country code is US.

Returns
  • LE_FAULT if the function failed.
  • LE_OK if the function succeeded.
Parameters
[in]countryCodethe country code.

◆ le_wifiAp_SetDiscoverable()

le_result_t le_wifiAp_SetDiscoverable ( bool  discoverable)

Set if the Access Point should announce its presence. Default value is TRUE. If the value is set to FALSE, the Access Point will be hidden.

Returns
LE_OK if the function succeeded.
Parameters
[in]discoverableIf TRUE the Access Point shows up on scans, else it is hidden.

◆ le_wifiAp_SetIeeeStandard()

le_result_t le_wifiAp_SetIeeeStandard ( le_wifiAp_IeeeStdBitMask_t  stdMask)

Set which IEEE standard to use. Default hardware mode is IEEE 802.11g.

Returns
  • LE_BAD_PARAMETER if invalid IEEE standard is set.
  • LE_OK if the function succeeded.
Parameters
[in]stdMaskBit mask for the IEEE standard.

◆ le_wifiAp_SetIpRange()

le_result_t le_wifiAp_SetIpRange ( const char *LE_NONNULL  ipAp,
const char *LE_NONNULL  ipStart,
const char *LE_NONNULL  ipStop 
)

Defines the IP adresses range for the host AP.

Returns
  • LE_BAD_PARAMETER if at least one of the given IP addresses is invalid.
  • LE_FAULT if a system call failed.
  • LE_OK if the function succeeded.
Parameters
[in]ipApthe IP address of the Access Point.
[in]ipStartthe start IP address of the Access Point.
[in]ipStopthe stop IP address of the Access Point.

◆ le_wifiAp_SetMaxNumberOfClients()

le_result_t le_wifiAp_SetMaxNumberOfClients ( int8_t  maxNumberOfClient)

Set number of maximally allowed clients to connect to the Access Point at the same time.

Returns
  • LE_OUT_OF_RANGE if requested number of users exceeds the capabilities of the Access Point.
  • LE_OK if the function succeeded.
Parameters
[in]maxNumberOfClientthe maximum number of clients

◆ le_wifiAp_SetPassPhrase()

le_result_t le_wifiAp_SetPassPhrase ( const char *LE_NONNULL  passPhrase)

Set the passphrase used to generate the PSK.

Note
If the PSK is to be set directly, please use le_wifiAp_SetPreSharedKey()
Returns
  • LE_BAD_PARAMETER if parameter is invalid.
  • LE_OK if the function succeeded.
Parameters
[in]passPhrasepass-phrase for PSK

◆ le_wifiAp_SetPreSharedKey()

le_result_t le_wifiAp_SetPreSharedKey ( const char *LE_NONNULL  preSharedKey)

Set the Pre Shared Key, PSK. There is no default value, since le_wifiAp_SetPassPhrase is used as default.

Note
the difference between le_wifiAp_SetPassPhrase() and this function
Returns
  • LE_BAD_PARAMETER if parameter is invalid.
  • LE_OK if the function succeeded.
Parameters
[in]preSharedKeyPSK. Note the difference between PSK and Pass Phrase.

◆ le_wifiAp_SetSecurityProtocol()

le_result_t le_wifiAp_SetSecurityProtocol ( le_wifiAp_SecurityProtocol_t  securityProtocol)

Set the Security protocol to use. Default value is SECURITY_WPA2.

Note
that the SSID does not have to be human readable ASCII values, but often has.
Returns
  • LE_BAD_PARAMETER if some parameter is invalid.
  • LE_OK if the function succeeded.
Parameters
[in]securityProtocolThe security protocol to use.

◆ le_wifiAp_SetServerDisconnectHandler()

LE_FULL_API void le_wifiAp_SetServerDisconnectHandler ( le_wifiAp_DisconnectHandler_t  disconnectHandler,
void *  contextPtr 
)

Set handler called when server disconnection is detected.

When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants to continue without exiting, it should call longjmp() from inside the handler.

◆ le_wifiAp_SetSsid()

le_result_t le_wifiAp_SetSsid ( const uint8_t *  ssidPtr,
size_t  ssidSize 
)

Set the Service set identification (SSID) of the AccessPoint Default value is "LEGATO Access Point"

Note
that the SSID does not have to be human readable ASCII values, but often has.
Returns
  • LE_BAD_PARAMETER if some parameter is invalid.
  • LE_OK if the function succeeded.
Parameters
[in]ssidPtrThe SSID to set as a octet array.
[in]ssidSize

◆ le_wifiAp_Start()

le_result_t le_wifiAp_Start ( void  )

This function starts the WIFI Access Point.

Note
that all settings, if to be used, such as security, username, password must set prior to starting the Access Point.
Returns
  • LE_FAULT if the function failed.
  • LE_OK if the function succeeded.

◆ le_wifiAp_Stop()

le_result_t le_wifiAp_Stop ( void  )

This function stops the WIFI Access Point.

Returns
  • LE_FAULT if the function failed.
  • LE_OK if the function succeeded.

◆ le_wifiAp_TryConnectService()

le_result_t le_wifiAp_TryConnectService ( void  )

Try to connect the current client thread to the service providing this API. Return with an error if the service is not available.

For each thread that wants to use this API, either ConnectService or TryConnectService must be called before any other functions in this API. Normally, ConnectService is automatically called for the main thread, but not for any other thread. For details, see Client Specific Functions.

This function is created automatically.

Returns
  • LE_OK if the client connected successfully to the service.
  • LE_UNAVAILABLE if the server is not currently offering the service to which the client is bound.
  • LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
  • LE_COMM_ERROR if the Service Directory cannot be reached.