Demo HCI Implementation for WiMOD-LR Devices  V1.3.1
CayenneLPP.h
Go to the documentation of this file.
1 /*
2  * CayenneLPP.h
3  *
4  * Created on: Feb 10, 2017
5  * Author: FB
6  */
7 
8 //------------------------------------------------------------------------------
23 //------------------------------------------------------------------------------
24 
25 
26 #ifndef ARDUINO_CAYENNE_CAYENNELPP_H_
27 #define ARDUINO_CAYENNE_CAYENNELPP_H_
28 
29 //------------------------------------------------------------------------------
30 //
31 // Section Includes Files
32 //
33 //------------------------------------------------------------------------------
34 
35 #include <stdint.h>
36 
37 
38 
39 // source: https://mdswp-staging.mydevices.com/cayenne/docs/#lora
40 
41 class CayenneLPP {
42  public:
43  CayenneLPP(uint8_t* buf, uint8_t size);
44  ~CayenneLPP();
45 
46  void reset(void);
47  uint8_t getSize(void);
48  uint8_t* getBuffer(void);
49  uint8_t copy(uint8_t* buffer);
50 
51  uint8_t addDigitalInput(uint8_t channel, uint8_t value);
52  uint8_t addDigitalOutput(uint8_t channel, uint8_t value);
53 
54  uint8_t addAnalogInput(uint8_t channel, float value);
55  uint8_t addAnalogOutput(uint8_t channel, float value);
56 
57  uint8_t addLuminosity(uint8_t channel, uint16_t lux);
58  uint8_t addPresence(uint8_t channel, uint8_t value);
59  uint8_t addTemperature(uint8_t channel, float celsius);
60  uint8_t addRelativeHumidity(uint8_t channel, float rh);
61  uint8_t addAccelerometer(uint8_t channel, float x, float y, float z);
62  uint8_t addBarometricPressure(uint8_t channel, float hpa);
63  uint8_t addGyrometer(uint8_t channel, float x, float y, float z);
64  uint8_t addGPS(uint8_t channel, float latitude, float longitude, float meters);
65 
66  uint8_t addCustomValue(uint8_t channel, uint8_t type, uint8_t valueSize, uint8_t* value);
67  private:
68  uint8_t *buffer;
69  uint8_t maxsize;
70  uint8_t cursor;
71 };
72 
73 #endif /* ARDUINO_CAYENNE_CAYENNELPP_H_ */
Definition: CayenneLPP.h:41