-
Notifications
You must be signed in to change notification settings - Fork 6
/
aggregate.h
26 lines (19 loc) · 1.12 KB
/
aggregate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef AGGREGATE_H_
#define AGGREGATE_H_
#include "platform.h"
// #define ENABLE_DOWNLINK false // Uplink data only
#define ENABLE_DOWNLINK true // Uplink data and request for downlink
// Send a message to network every 20,000 milliseconds = 20 seconds.
#define SEND_INTERVAL ((unsigned long) 20 * 1000)
BEGIN_EXTERN_C // Allows functions below to be called by C and C++ code.
struct NetworkContext; // Forward declaration
struct NetworkCmd; // Forward declaration
struct SensorMsg; // Forward declaration
void setup_aggregate(void); // Init the sensor data aggregator.
bool aggregate_sensor_data( // Aggregate the received sensor data. Return true if we should send to network now.
NetworkContext *context, // Context storage for the Network Task.
SensorMsg *msg, // Sensor Data Message just received. Contains sensor name and sensor values.
NetworkCmd cmdList[], // Upon return, will be populated by the list of AT Commands to be executed.
int cmdListSize); // How many commands may be stored in cmdList.
END_EXTERN_C // End of extern C scope.
#endif // AGGREGATE_H_