-
Notifications
You must be signed in to change notification settings - Fork 0
/
wisblock_cayenne.h
43 lines (37 loc) · 1.37 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
/**
* @file wisblock_cayenne.h
* @author Bernd Giesecke ([email protected])
* @brief Extend CayenneLPP class with custom channels
* @version 0.1
* @date 2022-04-10
*
* @copyright Copyright (c) 2022
*
*/
#ifndef WISBLOCK_CAYENNE_H
#define WISBLOCK_CAYENNE_H
// #include <Arduino.h>
#include <ArduinoJson.h>
#include <CayenneLPP.h>
#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, higher precision)
#define LPP_VOC 138 // 2 byte VOC index
// 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
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, uint16_t accuracy, uint16_t battery);
uint8_t addGNSS_T(int32_t latitude, int32_t longitude, int16_t altitude, float accuracy, int8_t sats);
uint8_t addGNSS_T2(int32_t latitude, int32_t longitude, int16_t sequence_id);
uint8_t addVoc_index(uint8_t channel, uint32_t voc_index);
private:
};
#endif