Connectino Library
Public Member Functions | List of all members
ConnectinoWlan Class Reference

WLAN module. More...

#include <ConnectinoWlan.h>

Inheritance diagram for ConnectinoWlan:
ConnectinoModule

Public Member Functions

 ConnectinoWlan (StxHwSerial &refSerial)
 WLAN module constructor. More...
 
bool moduleCallback (uint8_t subId, uint8_t reqId, uint16_t dataSize, uint8_t *data)
 Callback function for serial frames of the NET module. More...
 
uint8_t getModId ()
 Get the ID of the AJAX module. More...
 
bool enable (void)
 Activate the station interface. More...
 
bool disable (void)
 Deactivate the station interface. More...
 
bool connect (const char *ssid, const char *password, CONNECTINO_WLAN_SECURITY_T security, bool waitConnected)
 Connect to a WLAN. More...
 
bool disconnect (void)
 Disconnect from a WLAN. More...
 
bool isConnected (void)
 Check connection state. More...
 
bool openAccessPoint (void)
 Open the AP. More...
 
bool closeAccessPoint (void)
 Close the AP. More...
 
- Public Member Functions inherited from ConnectinoModule
void begin ()
 Starts the module.
 

Additional Inherited Members

- Protected Member Functions inherited from ConnectinoModule
bool append (uint8_t **buffer, uint16_t *bufferSize, const char data[], const uint8_t numOfSizeBytes=1)
 Append a string to the frames payload. More...
 
bool append (uint8_t **buffer, uint16_t *bufferSize, const uint8_t data[], const uint16_t dataSize, const uint8_t numOfSizeBytes=1)
 Append binary data to the frames payload. More...
 
bool append (uint8_t **buffer, uint16_t *bufferSize, const bool data)
 Append a boolean to the frames payload. More...
 
bool append (uint8_t **buffer, uint16_t *bufferSize, const uint8_t data)
 Append a uint8_t variable to the frames payload. More...
 
bool append (uint8_t **buffer, uint16_t *bufferSize, const uint16_t data)
 Append a uint16_t variable to the frames payload. More...
 
bool append (uint8_t **buffer, uint16_t *bufferSize, const uint32_t data)
 Append a uint32_t variable to the frames payload. More...
 

Detailed Description

WLAN module.

The WLAN module handles the connection to a configured WLAN. There are two interfaces available on the Connectino. The access point and the station interface. The station interface can be configured to connect to any WLAN, the AP provides a WLAN the user can connect to. The AP can be optionally disabled.

Constructor & Destructor Documentation

◆ ConnectinoWlan()

ConnectinoWlan::ConnectinoWlan ( StxHwSerial &  refSerial)

WLAN module constructor.

Instantiates the WLAN module and connects it to the hardware serial.

Parameters
refSerialA reference to the hardware serial.

Member Function Documentation

◆ moduleCallback()

bool ConnectinoWlan::moduleCallback ( uint8_t  subId,
uint8_t  reqId,
uint16_t  dataSize,
uint8_t *  data 
)
virtual

Callback function for serial frames of the NET module.

This function will be called for messages sent by the WiFi module which are targeted at the NET module.

Parameters
subIdSub ID of the message.
reqIdRequest ID of the message.
dataSizeSize of the received data.
dataReference to the received data.
Return values
Returnswhether or not to block the current frame.

Implements ConnectinoModule.

◆ getModId()

uint8_t ConnectinoWlan::getModId ( )
virtual

Get the ID of the AJAX module.

This function will return the module ID of the AJAX module defined in MODULE.h.

Return values
Themodule ID.

Implements ConnectinoModule.

◆ enable()

bool ConnectinoWlan::enable ( void  )

Activate the station interface.

This function will activate the station interface and use the current configuration to connect if it was connected before deactivation.

Return values
Trueif success, false otherwise.

◆ disable()

bool ConnectinoWlan::disable ( void  )

Deactivate the station interface.

This function will deactivate the station interface.

Return values
Trueif success, false otherwise.

◆ connect()

bool ConnectinoWlan::connect ( const char *  ssid,
const char *  password,
CONNECTINO_WLAN_SECURITY_T  security,
bool  waitConnected 
)

Connect to a WLAN.

This function will activate the station interface and connect to the WLAN given by the parameters.

Parameters
ssidSSID of the network.
passwordPassword of the network.
securitySecurity level of the network (CONNECTINO_WLAN_SECURITY_T).
waitConnectedIf true this function will block until connected.
Return values
Trueif success, false otherwise.

◆ disconnect()

bool ConnectinoWlan::disconnect ( void  )

Disconnect from a WLAN.

This function will disconnect from the WLAN. Connect function needs to be called again to connect.

Return values
Trueif success, false otherwise.

◆ isConnected()

bool ConnectinoWlan::isConnected ( void  )

Check connection state.

Check whether or not the module is connected to a network.

Return values
Trueif connected, false otherwise.

◆ openAccessPoint()

bool ConnectinoWlan::openAccessPoint ( void  )

Open the AP.

Activates the access point of the WLAN module.

Return values
Trueif success, false otherwise.

◆ closeAccessPoint()

bool ConnectinoWlan::closeAccessPoint ( void  )

Close the AP.

Deactivates the access point of the WLAN module.

Return values
Trueif success, false otherwise.

The documentation for this class was generated from the following files: