Loom 4 v4.5
Arduino library for Internet of Things Rapid Prototyping in environmental sensing
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Radio Class Referenceabstract

#include <Radio.h>

Inheritance diagram for Radio:
Inheritance graph
[legend]
Collaboration diagram for Radio:
Collaboration graph
[legend]

Public Member Functions

 Radio (const char *moduleName)
 
- Public Member Functions inherited from Module
 Module (const char *modName)
 
void setModuleName (const char *modName)
 
virtual const char * getModuleName ()
 
virtual void printModuleName (const char *message)
 
virtual void initialize ()=0
 
virtual void measure ()=0
 
virtual void package ()=0
 
virtual void power_up ()=0
 
virtual void power_down ()=0
 
virtual void display_data ()
 

Protected Member Functions

uint8_t getAddress () const
 
int16_t getSignalStrength ()
 
virtual bool receive (uint maxWaitTime)=0
 
virtual bool send (const uint8_t destinationAddress)=0
 
bool bufferToJson (uint8_t *buffer)
 
bool jsonToBuffer (uint8_t *buffer, JsonObjectConst json)
 

Protected Attributes

uint8_t deviceAddress
 
uint16_t maxMessageLength
 
int16_t signalStrength
 
uint8_t powerLevel
 
uint8_t retryCount
 
uint16_t retryTimeout
 
StaticJsonDocument< 300 > recvDoc
 
StaticJsonDocument< 300 > sendDoc
 

Additional Inherited Members

- Public Attributes inherited from Module
bool moduleInitialized = true
 
int module_address = -1
 

Detailed Description

Slightly abstracted Radio class to allow for all radio modules to inherit from one spot

Author
Will Richards

Constructor & Destructor Documentation

◆ Radio()

Radio::Radio ( const char *  moduleName)
inline

Construct a new Radio module

Parameters
moduleNameName of the module
maxLengthThe maximum length a packet can be

Member Function Documentation

◆ bufferToJson()

bool Radio::bufferToJson ( uint8_t *  buffer)
inlineprotected

Convert the message pack to json

◆ getAddress()

uint8_t Radio::getAddress ( ) const
inlineprotected

Get this device's address

◆ getSignalStrength()

int16_t Radio::getSignalStrength ( )
inlineprotected

Get the current signal strength of the radio

◆ jsonToBuffer()

bool Radio::jsonToBuffer ( uint8_t *  buffer,
JsonObjectConst  json 
)
inlineprotected

Convert the json to a message pack

◆ receive()

virtual bool Radio::receive ( uint  maxWaitTime)
protectedpure virtual

Receive a JSON packet from another radio, blocking until the wait time expires or a packet is received

Parameters
maxWaitTimeThe maximum time to wait before continuing execution (Set to 0 for non-blocking)

Implemented in Loom_Freewave, and Loom_LoRa.

◆ send()

virtual bool Radio::send ( const uint8_t  destinationAddress)
protectedpure virtual

Send the current JSON data to the specified address

Parameters
destinationAddressThe address we want to send the data to

Implemented in Loom_Freewave, and Loom_LoRa.


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