EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoSerialEvents.h
1 /******************************************************************************
2  DISCLAIMER
3 
4  THIS SOFTWARE PRODUCT ("SOFTWARE") IS PROPRIETARY TO ENOCEAN GMBH, OBERHACHING,
5  GERMANY (THE "OWNER") AND IS PROTECTED BY COPYRIGHT AND INTERNATIONAL TREATIES OR
6  PROTECTED AS TRADE SECRET OR AS OTHER INTELLECTUAL PROPERTY RIGHT. ALL RIGHTS, TITLE AND
7  INTEREST IN AND TO THE SOFTWARE, INCLUDING ANY COPYRIGHT, TRADE SECRET OR ANY OTHER
8  INTELLECTUAL PROPERTY EMBODIED IN THE SOFTWARE, AND ANY RIGHTS TO REPRODUCE,
9  DISTRIBUTE, MODIFY, DISPLAY OR OTHERWISE USE THE SOFTWARE SHALL EXCLUSIVELY VEST IN THE
10  OWNER. ANY UNAUTHORIZED REPRODUCTION, DISTRIBUTION, MODIFICATION, DISPLAY OR OTHER
11  USE OF THE SOFTWARE WITHOUT THE EXPLICIT PERMISSION OF OWNER IS PROHIBITED AND WILL
12  CONSTITUTE AN INFRINGEMENT OF THE OWNER'S RIGHT AND MAY BE SUBJECT TO CIVIL OR
13  CRIMINAL SANCTION.
14 
15  THIS SOFTWARE IS PROVIDED BY THE OWNER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
16  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
17  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN PARTICULAR, THE OWNER DOES NOT WARRANT
18  THAT THE SOFTWARE SHALL BE ERROR FREE AND WORKS WITHOUT INTERRUPTION.
19 
20  IN NO EVENT SHALL THE OWNER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  ******************************************************************************/
27 
33 #ifndef EOSERIALEVENTS_H_
34 #define EOSERIALEVENTS_H_
35 #include "eoPacket.h"
36 #include <vector>
38 
39 typedef enum
40 {
42  CO_DUTYCYCLE_LIMIT_UNREACHED = 0x00,
44  CO_DUTYCYCLE_LIMIT_REACHED = 0x01
45 } CO_DUTYCYCLE_LIMIT;
46 
48 typedef enum
49 {
51  SA_RECLAIM_NOT_SUCCESSFUL = 1,
53  SA_CONFIRM_LEARN = 2,
55  SA_LEARN_ACK = 3,
57  CO_READY = 4,
59  SA_READY = 4,
61  CO_EVENT_SECUREDEVICES = 0x05,
63  SA_DUTYCYCLE_LIMIT = 6,
65  CO_EVENT_DUTYCYCLE_LIMIT = 0x06,
67  CO_EVENT_TRANSMISSION_FAILED = 0x07,
69  CO_TX_DONE = 0x08,
71  CO_LRN_MODE_DISABLED = 0x09
72 } SA_EVENT_TYPE;
73 
75 typedef enum
76 {
78  SA_LEARN_IN = 0x00,
80  SA_EEP_NOT_ACCEPTED = 0x11,
82  SA_PM_FULL = 0x12,
84  SA_CONTROLLER_FULL = 0x13,
86  SA_RSSI_NOT_GOOD = 0x14,
88  SA_LEARN_OUT = 0x20,
90  SA_NOT_SUPPORTED = 0xFF
91 } SA_CONFIRM_CODE;
92 
97 {
98 public:
104  static eoSerialEvent* parsePacket(eoPacket &packet);
109  SA_EVENT_TYPE getEventType() const { return event; };
110 protected:
111  SA_EVENT_TYPE event;
112  eoPacket* preparePacket(uint8_t u8Length) const;
113  eoSerialEvent();
114 };
119 {
120 public:
122 };
132 {
133 public:
134  static eoEventConfirmLearn* createFromPacket(eoPacket &packet);
135  eoEventConfirmLearn(uint8_t priorityOfPostMasterCandidate,uint16_t manufacturerID,uint8_t eep_rorg,uint8_t eep_func,
136  uint8_t eep_type,uint8_t rssi,uint32_t postMasterCandidate, uint32_t smartAckClient,uint8_t hopCount);
137  /*Priority of the postmaster candidate 0xnn Already post master 0b xxxx 1xxx
138  Place for mailbox 0b xxxx x1xx
139  Good RSSI 0b xxxx xx1x
140  Local 0b xxxx xxx1
141  */
142  uint8_t priorityOfPostMasterCandidate;
144  uint16_t manufacturerID;
146  uint8_t eep_rorg;
148  uint8_t eep_func;
149  uint8_t eep_type;
151  uint8_t rssi;
155  uint32_t smartAckClient;
157  uint8_t hopCount;
159  static eoPacket createResponse(uint16_t responseTime, SA_CONFIRM_CODE code);
160 };
165 {
166 public:
167  static eoEventLearnAck* createFromPacket(eoPacket& packet);
168  eoEventLearnAck(uint16_t responseTime, SA_CONFIRM_CODE confirmCode);
170  uint16_t responseTime;
172  SA_CONFIRM_CODE confirmCode;
173 };
174 
178 typedef enum
179 {
180  READY_MODE_STANDARD_SECURITY = 0,
181  READY_MODE_EXTENDED_SECURITY = 1,
182  READY_MODE_UNKNOWN,
183 } READY_MODE_t;
184 
185 typedef enum
186 {
187  RESET_VOLTATE_DROP = 0,
188  RESET_RESET_PIN = 1,
189  RESET_WATCHDOG = 2,
190  RESET_FLYWHEEL = 3,
191  RESET_PARITY = 4,
192  RESET_MEMORY_ERROR = 5,
193  RESET_INVALID_MEMORY = 6,
194  RESET_PIN0 = 7,
195  RESET_PIN1 = 8,
196  RESET_UNKOWN = 9,
197  RESET_UART = 10,
198 } WAKEUP_CAUSE_t;
199 
204 {
205 public:
206  static eoEventReady* createFromPacket(eoPacket& packet);
207  eoEventReady(WAKEUP_CAUSE_t wakeUpCause);
209  WAKEUP_CAUSE_t wakeUpCause;
211  READY_MODE_t mode;
212 };
213 
214 typedef enum
215 {
217  SEC_EVENT_TI_FAILED = 0,
219  SEC_EVENT_RESERVED = 1,
221  SEC_EVENT_RES_WRONG_KEY = 2,
223  SEC_EVENT_CONF_COUNT_TEL_CMAC = 3,
225  SEC_EVENT_CONF_TELEGRAM_CORRUPT = 0x04,
227  SEC_EVENT_NO_PSK = 0x05,
229  SEC_EVENT_NO_PSK_AVAILABLE = 0x06,
231  SEC_EVENT_RLCCMAC_INCORRECT = 0x07,
233  SEC_EVENT_STANDARD_TELEGRAM= 0x08,
235  SEC_EVENT_TI_SUCCESS = 0x09,
237  SEC_EVENT_VALID_RLC = 0x0A,
238 } SECURE_EVENT_CAUSE_t;
239 
244 {
245 public:
246  static eoEventSecureDevice* createFromPacket(eoPacket& packet);
247  eoEventSecureDevice(SECURE_EVENT_CAUSE_t eventCause, uint32_t deviceId);
249  SECURE_EVENT_CAUSE_t eventCause;
251  uint32_t deviceId;
252 };
257 {
258 public:
259  static eoEventDutyCycleLimit* createFromPacket(eoPacket& packet);
260  eoEventDutyCycleLimit(CO_DUTYCYCLE_LIMIT eventCause);
262  CO_DUTYCYCLE_LIMIT eventCause;
263 };
264 
268 typedef enum
269 {
270  EVENT_TRANSMISSION_CSMA_FAILED = 0,
271  EVENT_NO_ACK_RECEIVED = 1,
272 } EVENT_TRANSMISSION_FAILED_t;
277 {
278 public:
279  static eoEventTransmitFailed* createFromPacket(eoPacket& packet);
280  eoEventTransmitFailed(EVENT_TRANSMISSION_FAILED_t eventCause);
282  EVENT_TRANSMISSION_FAILED_t eventCause;
283 };
284 
289 {
290 public:
291  eoEventTXDone();
292 };
297 {
298 public:
300 };
301 #endif /* EOSERIALCOMMAND_H_ */
Informs Smart Acknowledge client about the result of a previous sent learn request.
Definition: eoSerialEvents.h:164
Informs the external host that the device has finished all transmissions.
Definition: eoSerialEvents.h:288
Request to external host to determine how to handle the received learn request. This event will be se...
Definition: eoSerialEvents.h:131
Informs the external host that the learn mode has been disabled due to time-out.
Definition: eoSerialEvents.h:296
SA_EVENT_TYPE getEventType() const
Returns the event type. Can be used safely to cast the packet.
Definition: eoSerialEvents.h:109
Informs external host about events regarding security processing.
Definition: eoSerialEvents.h:243
Reports about a transmission failure, this event is used mainly for long range products.
Definition: eoSerialEvents.h:276
static eoSerialEvent * parsePacket(eoPacket &packet)
Parses packet, checks if it is a serial event.
Informs external host about duty cycle limit. This event can be e.g. triggered when to many telegrams...
Definition: eoSerialEvents.h:256
Informs external host about the readiness for operation. This command is send e.g. after power on, or sleep mode.
Definition: eoSerialEvents.h:203
READY_MODE_t mode
Confirm code.
Definition: eoSerialEvents.h:211
SA_CONFIRM_CODE confirmCode
Confirm code.
Definition: eoSerialEvents.h:172
uint32_t smartAckClient
Eurid of sensor.
Definition: eoSerialEvents.h:155
uint8_t eep_func
EEP of the sensor func.
Definition: eoSerialEvents.h:148
uint32_t postMasterCandidate
Device ID of the Post master candidate.
Definition: eoSerialEvents.h:153
uint8_t rssi
Signal strength; Send case: FF Receive case: actual RSSI.
Definition: eoSerialEvents.h:151
Informs about an unsuccessful Smart Acknowledge client reclaim.
Definition: eoSerialEvents.h:118
WAKEUP_CAUSE_t wakeUpCause
Wakeup reason of the GWC.
Definition: eoSerialEvents.h:209
uint8_t hopCount
Maximal repeater counter.
Definition: eoSerialEvents.h:157
uint32_t deviceId
Device which caused this event.
Definition: eoSerialEvents.h:251
uint8_t eep_rorg
EEP of the sensor rorg.
Definition: eoSerialEvents.h:146
EVENT_TRANSMISSION_FAILED_t eventCause
reason of transmission failure
Definition: eoSerialEvents.h:282
uint16_t responseTime
Response time for Smart Ack Client in ms in which the controller can prepare the data and send it to ...
Definition: eoSerialEvents.h:170
Class which contains a Packet.
Definition: eoPacket.h:43
CO_DUTYCYCLE_LIMIT eventCause
Duty cycle event.
Definition: eoSerialEvents.h:262
SECURE_EVENT_CAUSE_t eventCause
Reported security issue.
Definition: eoSerialEvents.h:249
Serial Event base class. Use the parse Packet function to generate the right packet type...
Definition: eoSerialEvents.h:96
uint16_t manufacturerID
Manufacturer ID.
Definition: eoSerialEvents.h:144