Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: NetServices FatFileSystem csv_parser mbed MQTTClient RF12B DNSResolver SDFileSystem
IoTRouting Class Reference
Main IoT Gateway RFM12B payload routing class. More...
#include <IoTRouting.h>
Public Member Functions | |
| IoTRouting () | |
| Default Constructor. | |
| void | initRouting () |
| Initialise routing class. | |
| bool | writeNodeList () |
| Write a list of nodes to IOTNODE.TXT Format is: group,node,length,type Where: group, node, length are first 3 bytes of received packet type is 99 for unknown, 0 for simple, 1 for Type 1, 2 for Type 2. | |
| bool | writeRoutingList () |
| Write main routing list to file IOTRTR.TXT Format is: nodeId,sensorId,factor,outputType,param1,param2,param3,param4 Where: nodeId is the Node ID of the node to the sensor is attached to sensorId is the ID of the sensor to define factor is a conversion factor to convert from integer to real value. | |
| void | addNodeToList (uint8_t groupId, uint8_t nodeId, uint8_t length, uint8_t type) |
| Add a node to the nodelist. | |
| void | addRoutingToList (short nodeId, short sensorId, float factor, byte outType, char *param1, char *param2, char *param3, char *param4) |
| Add an item to routing list. | |
| short | getPayloadType (uint8_t *data, short dataLen) |
| get Payload type | |
| PayloadRouting * | getRouting (short nodeId, short sensorNum) |
| Get routing data for specified node/sensor combination. | |
| void | addOutput (OutputDef *output, short outType) |
| Add output definition to output list. | |
| bool | routePayload (uint8_t *payload, short payloadLen) |
| Main payload routing function. | |
Detailed Description
Main IoT Gateway RFM12B payload routing class.
Definition at line 93 of file IoTRouting.h.
Constructor & Destructor Documentation
| IoTRouting | ( | ) |
Default Constructor.
Definition at line 48 of file IoTRouting.cpp.
Member Function Documentation
| void addNodeToList | ( | uint8_t | groupId, |
| uint8_t | nodeId, | ||
| uint8_t | length, | ||
| uint8_t | type | ||
| ) |
Add a node to the nodelist.
- Parameters:
-
groupId Group ID, byte 0 of received packet nodeId Node ID, byte 1 length Length of payload, byte 2 type Type of payload, simple, v1, v2 or undefined
Definition at line 51 of file IoTRouting.cpp.
| void addOutput | ( | OutputDef * | output, |
| short | outType | ||
| ) |
Add output definition to output list.
- Parameters:
-
output Pointer to output object outType Numeric value for the output type
Definition at line 240 of file IoTRouting.cpp.
| void addRoutingToList | ( | short | nodeId, |
| short | sensorId, | ||
| float | factor, | ||
| byte | outType, | ||
| char * | param1, | ||
| char * | param2, | ||
| char * | param3, | ||
| char * | param4 | ||
| ) |
Add an item to routing list.
- Parameters:
-
nodeId ID of the node payload came from sensorId ID of the sensor within the node factor Sensor Reading conversion factor, 100, 10, 1, 0.1, 0.01, 0.001 etc outType Output type, 1 = Pachube, 2 = MQTT, 3 = emonCMS, 4 = Sen.Se param1 Parameter 1 param2 Parameter 2 param3 Parameter 3 param4 Parameter 4
Definition at line 61 of file IoTRouting.cpp.
| short getPayloadType | ( | uint8_t * | data, |
| short | dataLen | ||
| ) |
get Payload type
- Parameters:
-
data Pointer to start of payload data dataLen Length of payload data
- Returns:
- payload type, either simple, v1, v2 or unknown
Definition at line 280 of file IoTRouting.cpp.
| PayloadRouting * getRouting | ( | short | nodeId, |
| short | sensorNum | ||
| ) |
Get routing data for specified node/sensor combination.
- Parameters:
-
nodeId The ID of the node sensorNum The ID of the sensor
- Returns:
- pointer to routing data
Definition at line 259 of file IoTRouting.cpp.
| void initRouting | ( | ) |
Initialise routing class.
Definition at line 102 of file IoTRouting.cpp.
| bool routePayload | ( | uint8_t * | payload, |
| short | payloadLen | ||
| ) |
Main payload routing function.
- Parameters:
-
payload Pointer to payload data payloadLen Length of th epayload
- Returns:
- flag to indicate payload routed to output or not.
Definition at line 300 of file IoTRouting.cpp.
| bool writeNodeList | ( | ) |
Write a list of nodes to IOTNODE.TXT Format is: group,node,length,type Where: group, node, length are first 3 bytes of received packet type is 99 for unknown, 0 for simple, 1 for Type 1, 2 for Type 2.
Definition at line 188 of file IoTRouting.cpp.
| bool writeRoutingList | ( | ) |
Write main routing list to file IOTRTR.TXT Format is: nodeId,sensorId,factor,outputType,param1,param2,param3,param4 Where: nodeId is the Node ID of the node to the sensor is attached to sensorId is the ID of the sensor to define factor is a conversion factor to convert from integer to real value.
can be 100.0,10.0,1.0,0.1,0.01,0.001. For no conversion use 1.0 outputType is the type of output, 1 is Pachube, 2 is MQTT param1 is Pachube feed number or MQTT topic param2 is Pachube datastream number param3 and 4 are currently unused
Definition at line 215 of file IoTRouting.cpp.
Generated on Tue Jul 12 2022 22:07:04 by
1.7.2