le_wifiAp_interface.h File Reference

#include "legato.h"
#include "le_wifiDefs_interface.h"
#include "le_wifiAp_common.h"

Go to the source code of this file.

Typedefs

typedef void(* le_wifiAp_DisconnectHandler_t) (void *)
 

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

Legato c_le_wifiAp include file.

Typedef Documentation

◆ le_wifiAp_DisconnectHandler_t

typedef void(* le_wifiAp_DisconnectHandler_t) (void *)

Type for handler called when a server disconnects.

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.