-
Notifications
You must be signed in to change notification settings - Fork 5
/
wisblock_cayenne.h
45 lines (39 loc) · 1.52 KB
/
wisblock_cayenne.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* @file wisblock_cayenne.h
* @author Bernd Giesecke ([email protected])
* @brief Extend CayenneLPP class with custom channels
* @version 0.1
* @date 2022-01-29
*
* @copyright Copyright (c) 2022
*
*/
#ifndef WISBLOCK_CAYENNE_H
#define WISBLOCK_CAYENNE_H
#include <Arduino.h>
// #include <ArduinoJson.h> // Click here to install http://librarymanager/All#ArduinoJson
#include <CayenneLPP.h> // Click here to install http://librarymanager/All#CayenneLPP
#define LPP_GPS4 136 // 3 byte lon/lat 0.0001 °, 3 bytes alt 0.01 meter (Cayenne LPP default)
#define LPP_GPS6 137 // 4 byte lon/lat 0.000001 °, 3 bytes alt 0.01 meter (Customized Cayenne LPP)
#define LPP_VOC 138 // 2 byte VOC index
#define WB_DEV_ID 255 // 4 byte device ID
// Only Data Size
#define LPP_GPS4_SIZE 9
#define LPP_GPS6_SIZE 11
#define LPP_GPSH_SIZE 14
#define LPP_GPST_SIZE 10
#define LPP_VOC_SIZE 2
#define WB_DEV_ID_SIZE 4
class WisCayenne : public CayenneLPP
{
public:
WisCayenne(uint8_t size) : CayenneLPP(size) {}
uint8_t addGNSS_4(uint8_t channel, int32_t latitude, int32_t longitude, int32_t altitude);
uint8_t addGNSS_6(uint8_t channel, int32_t latitude, int32_t longitude, int32_t altitude);
uint8_t addGNSS_H(int32_t latitude, int32_t longitude, int16_t altitude, int16_t accuracy, int16_t battery);
uint8_t addGNSS_T(int32_t latitude, int32_t longitude, int16_t altitude, float accuracy, int8_t sats);
uint8_t addVoc_index(uint8_t channel, uint32_t voc_index);
uint8_t addDevID(uint8_t channel, uint32_t dev_id);
private:
};
#endif