HAN-FUN API  1.5.3
This project provides the common implementation of ULE Alliance's HAN-FUN application protocol.
node.cpp
Go to the documentation of this file.
1 // =============================================================================
16 // =============================================================================
17 #include <iostream>
18 #include <iomanip>
19 #include <sstream>
20 #include <fstream>
21 
22 #include "node.h"
23 
24 #include "common.h"
25 
26 // #define HF_LOG_LEVEL HF_LOG_LEVEL_TRACE
27 #include "application.h"
28 
29 // =============================================================================
30 // Node
31 // =============================================================================
32 
38 // =============================================================================
39 // Node::receive
40 // =============================================================================
44 // =============================================================================
45 void Node::receive(HF::Protocol::Packet &packet, HF::Common::ByteArray &payload, uint16_t offset)
46 {
47  LOG(DEBUG) << ">>>>>>>>>>>>> Message Received <<<<<<<<<<<<<" << NL;
48 
49  LOG(TRACE) << "Payload : " << payload << NL;
50 
51  LOG(DEBUG) << packet << NL;
52 
54 }
55 
56 // =============================================================================
57 // Simple Light
58 // =============================================================================
59 
61 {
63  LOG(INFO) << ">>>>>>>>>>>>> SimpleLight : ON <<<<<<<<<<<<<" << NL;
64 }
65 
67 {
69  LOG(INFO) << ">>>>>>>>>>>>> SimpleLight : OFF <<<<<<<<<<<<<" << NL;
70 }
71 
73 {
75  LOG(INFO) << ">>>>>>>>>>>>> SimpleLight : TOGGLE <<<<<<<<<<<<<" << NL;
76 }
77 
void toggle(HF::Protocol::Address &source)
Callback that is called when a TOGGLE_CMD message is received.
Definition: node.cpp:72
This file contains the definition of the Node class that represents the HAN-FUN Node on the applicati...
This file contains the definitions for the HAN-FUN example applications.
void on(HF::Protocol::Address &source)
Callback that is called when a ON_CMD message is received.
Definition: node.cpp:60
Helper template class to implement units.
Definition: units.h:196
This class represents a byte array.
#define NL
Helper define for new-line and stream clear.
Definition: debug.h:34
Network Address.
Definition: protocol.h:201
void receive(HF::Protocol::Packet &packet, HF::Common::ByteArray &payload, uint16_t offset)
Callback to deliver a packet received from the transport layer.
Definition: node.cpp:45
HAN-FUN Protocol Packet.
Definition: protocol.h:298
void off(HF::Protocol::Address &source)
Callback that is called when a OFF_CMD message is received.
Definition: node.cpp:66
This file contains the definitions for the common functionality in the HAN-FUN example applications...
#define LOG(X)
Log messages with the level given by X.
Definition: debug.h:81
void receive(Protocol::Packet &packet, Common::ByteArray &payload, uint16_t offset) _override
Callback to deliver a packet received from the transport layer.
Definition: devices.h:446