52 #define BayEOS_VERSION "1.6"
57 #define BayEOS_DataFrame 0x1
58 #define BayEOS_Command 0x2
59 #define BayEOS_CommandResponse 0x3
60 #define BayEOS_Message 0x4
61 #define BayEOS_ErrorMessage 0x5
68 #define BayEOS_RoutedFrame 0x6
69 #define BayEOS_DelayedFrame 0x7
70 #define BayEOS_RoutedFrameRSSI 0x8
73 #define BayEOS_TimestampFrame 0x9
74 #define BayEOS_BinaryFrame 0xa
75 #define BayEOS_OriginFrame 0xb
76 #define BayEOS_MillisecondTimestampFrame 0xc
77 #define BayEOS_RoutedOriginFrame 0xd
80 #define BayEOS_GatewayCommand 0xe
81 #define BayEOS_GatewayCommand_SetName 0x1
82 #define BayEOS_GatewayCommand_ApplyTemplate 0x2
83 #define BayEOS_GatewayCommand_SetSamplingInt 0x3
84 #define BayEOS_GatewayCommand_SetCheckDelay 0x4
88 #define BayEOS_ChecksumFrame 0xf
89 #define BayEOS_DelayedSecondFrame 0x10
90 #define BayEOS_RF24Frame 0x11
92 #define BayEOS_Action 0x12
93 #define BayEOS_ActionResponse 0x13
94 #define BayEOS_ActionSuccess 0x0
95 #define BayEOS_ActionFailed 0x1
101 #define BayEOS_Float32le 0x1
102 #define BayEOS_Int32le 0x2
103 #define BayEOS_Int16le 0x3
104 #define BayEOS_UInt8 0x4
105 #define BayEOS_Double64le 0x5
106 #define BayEOS_String 0x6
107 #define BayEOS_Binary 0x7
110 #define BayEOS_WithoutOffsetFloat32le 0x21
111 #define BayEOS_WithoutOffsetInt32le 0x22
112 #define BayEOS_WithoutOffsetInt16le 0x23
113 #define BayEOS_WithoutOffsetUInt8 0x24
114 #define BayEOS_WithoutOffsetDouble64le 0x25
116 #define BayEOS_ChannelFloat32le 0x41
117 #define BayEOS_ChannelInt32le 0x42
118 #define BayEOS_ChannelInt16le 0x43
119 #define BayEOS_ChannelUInt8 0x44
120 #define BayEOS_ChannelDouble64le 0x45
122 #define BayEOS_LabelledChannelFloat32le 0x61
123 #define BayEOS_LabelledChannelInt32le 0x62
124 #define BayEOS_LabelledChannelInt16le 0x63
125 #define BayEOS_LabelledChannelUInt8 0x64
126 #define BayEOS_LabelledChannelDouble64le 0x65
129 #define BayEOS_WithoutOffset 0x20
130 #define BayEOS_ChannelNumber 0x40
131 #define BayEOS_ChannelLabel 0x60
133 #define BayEOS_DATATYP_MASK 0x0f
134 #define BayEOS_OFFSETTYP_MASK 0xf0
142 #define BayEOS_SetCannelAddress 0x1
143 #define BayEOS_GetCannelAddress 0x2
144 #define BayEOS_SetAutoSearch 0x3
145 #define BayEOS_GetAutoSearch 0x4
146 #define BayEOS_SetPin 0x5
147 #define BayEOS_GetPin 0x6
148 #define BayEOS_GetTime 0x7
149 #define BayEOS_SetTime 0x8
150 #define BayEOS_GetName 0x9
151 #define BayEOS_SetName 0xa
152 #define BayEOS_StartData 0xb
153 #define BayEOS_StopData 0xc
156 #define BayEOS_GetVersion 0xd
157 #define BayEOS_GetSamplingInt 0xe
158 #define BayEOS_SetSamplingInt 0xf
159 #define BayEOS_TimeOfNextFrame 0x10
160 #define BayEOS_StartLiveData 0x11
161 #define BayEOS_ModeStop 0x12
162 #define BayEOS_Seek 0x13
163 #define BayEOS_StartBinaryDump 0x14
175 #define BayEOS_BufferCommand 0x15
176 #define BayEOS_GetBatStatus 0x16
177 #define BayEOS_BufferInfo 0x17
178 #define BayEOS_GetLoggingDisabled 0x18
179 #define BayEOS_SetLoggingDisabled 0x19
180 #define BayEOS_GetChannelMap 0x1a
181 #define BayEOS_GetUnitMap 0x1b
183 #ifndef BayEOS_MAX_PAYLOAD
184 #define BayEOS_MAX_PAYLOAD 100
189 #include <BayEOSBuffer.h>
231 uint8_t
createMessage(
const char* s, uint8_t checksum=0, uint8_t frametype=BayEOS_Message);
256 void startDataFrame(uint8_t subtype=BayEOS_Float32le,uint8_t checksum=0);
303 uint8_t addChecksum(
void);
312 uint8_t validateChecksum(
void);
317 void startRoutedFrame(uint16_t sourceMyID,uint16_t sourcePANID,uint8_t rssi=0);
463 uint8_t _payload[BayEOS_MAX_PAYLOAD];
466 uint8_t _failure_counter;
468 uint16_t _skip_counter;
474 if(_next<BayEOS_MAX_PAYLOAD){
Definition: BayEOSBuffer.h:70
void startCommandResponse(uint8_t cmd_api)
Definition: BayEOS.cpp:241
void startDelayedFrame(unsigned long delay)
Definition: BayEOS.cpp:216
void startDelayedSecondFrame(unsigned long delay)
Definition: BayEOS.cpp:221
void startCommand(uint8_t cmd_api)
Definition: BayEOS.cpp:236
uint8_t readBinaryFromBuffer(unsigned long pos)
Definition: BayEOS.cpp:330
virtual uint8_t sendPayload(void)=0
uint8_t sendError(const char *s)
Definition: BayEOS.cpp:289
uint8_t getPacketLength(void) const
Definition: BayEOS.cpp:431
void startDataFrameWithOrigin(uint8_t subtype, const char *o, uint8_t checksum=0, uint8_t routed=0)
Definition: BayEOS.cpp:27
void setBuffer(BayEOSBuffer &buffer, uint16_t max_skip=0)
Definition: BayEOS.h:452
uint8_t createActionResponse(uint8_t key, uint8_t status)
Definition: BayEOS.cpp:313
BayEOS(void)
Definition: BayEOS.h:193
uint8_t addChannelValue(float v, uint8_t channel_number=0)
Definition: BayEOS.cpp:61
uint8_t writeToBuffer(void)
Definition: BayEOS.cpp:322
uint8_t sendMessage(const char *s)
Definition: BayEOS.cpp:295
void startRoutedFrame(uint16_t sourceMyID, uint16_t sourcePANID, uint8_t rssi=0)
Definition: BayEOS.cpp:204
uint8_t sendFromBuffer(void)
Definition: BayEOS.cpp:394
void startFrame(void)
Definition: BayEOS.cpp:8
void startTimestampFrame(unsigned long timestamp)
Definition: BayEOS.cpp:226
void startRF24Frame(uint8_t pipe)
Definition: BayEOS.cpp:231
void startOriginFrame(const char *o, uint8_t routed=0)
Definition: BayEOS.cpp:20
uint8_t createMessage(const char *s, uint8_t checksum=0, uint8_t frametype=BayEOS_Message)
Definition: BayEOS.cpp:301
uint8_t addToPayload(uint8_t b)
Definition: BayEOS.h:469
void startDataFrame(uint8_t subtype=BayEOS_Float32le, uint8_t checksum=0)
Definition: BayEOS.cpp:12
const uint8_t * getPayload(void) const
Definition: BayEOS.cpp:435
uint8_t sendOrBuffer(void)
Definition: BayEOS.cpp:369
virtual uint8_t readIntoPayload(int timeout=5000)
Definition: BayEOS.h:206
uint8_t getPayloadLength(void) const
Definition: BayEOS.cpp:427
uint8_t getPayloadBytesLeft(void) const
Definition: BayEOS.cpp:423
virtual int available(void)
Definition: BayEOS.h:212
uint8_t readFromBuffer(void)
Definition: BayEOS.cpp:345