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

NET module. More...

#include <ConnectinoNet.h>

Inheritance diagram for ConnectinoNet:
ConnectinoModule

Classes

struct  ipConfig_t
 IP configuration. More...
 

Public Member Functions

 ConnectinoNet (StxHwSerial &refSerial)
 NET 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 ping (uint8_t ipAddress[4], uint16_t *pingRtt)
 Pings a destination address. 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

NET module.

The NET module can configure the IP configuration of the WiFi module and send ICMP pings to a destination IP address.

Constructor & Destructor Documentation

◆ ConnectinoNet()

ConnectinoNet::ConnectinoNet ( StxHwSerial &  refSerial)

NET module constructor.

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

Parameters
refSerialA reference to the hardware serial.

Member Function Documentation

◆ moduleCallback()

bool ConnectinoNet::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 ConnectinoNet::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.

◆ ping()

bool ConnectinoNet::ping ( uint8_t  ipAddress[4],
uint16_t *  pingRtt 
)

Pings a destination address.

This function will trigger the WiFi module to send an ICMP ping to a destination IP address the round trip time will be measured and written to the given parameter.

Parameters
ipAddressThe IP address of the destination.
pingRttReference to the parameter where the RTT will be written to.
Return values
Trueif ping was sent successfully, false otherwise.

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