Skip to content

Commit

Permalink
Merge pull request #2 from masa-raritan/master
Browse files Browse the repository at this point in the history
Make lib compatible with Raritan fw
  • Loading branch information
lionelains committed Jul 25, 2019
2 parents 83a4cac a6a72a4 commit f60fd51
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 51,11 @@ domain/ezsp-dongle.h \
domain/ezsp-dongle-observer.h \
domain/zigbee-tools/zigbee-networking.h \
domain/zigbee-tools/zigbee-messaging.h \
domain/zbmessage/green-power-frame.h \
domain/zigbee-tools/green-power-sink.h \
domain/zigbee-tools/green-power-sink-table.h \
domain/zbmessage/green-power-sink-table-entry.h \
domain/green-power-observer.h \
domain/zbmessage/zigbee-message.h \
domain/zbmessage/aps.h \
domain/zbmessage/apsoption.h \
Expand Down
10 changes: 9 additions & 1 deletion src/domain/zbmessage/aps.h
Original file line number Diff line number Diff line change
@@ -1,6 1,6 @@
/**
* @file aps.h
*
*
* @brief Handles encoding/decoding of the APS header
*/

Expand All @@ -12,6 12,11 @@

#include "apsoption.h"

#ifdef USE_RARITAN
/**** Start of the official API; no includes below this point! ***************/
#include <pp/official_api_start.h>
#endif // USE_RARITAN

class CAPSFrame; /* Forward declaration */
void swap(CAPSFrame& first, CAPSFrame& second); /* Declaration before qualifying ::swap() as friend for class CAPSFrame */

Expand Down Expand Up @@ -83,3 88,6 @@ class CAPSFrame
uint8_t src_ep;
};

#ifdef USE_RARITAN
#include <pp/official_api_end.h>
#endif // USE_RARITAN
9 changes: 9 additions & 0 deletions src/domain/zbmessage/zclframecontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 9,11 @@
#include <cstdint>
#include <vector>

#ifdef USE_RARITAN
/**** Start of the official API; no includes below this point! ***************/
#include <pp/official_api_start.h>
#endif // USE_RARITAN

typedef enum
{
E_DIR_CLIENT_TO_SERVER = 0,
Expand Down Expand Up @@ -106,3 111,7 @@ class CZCLFrameControl
/** software version indication, MSP : 0 for short frame (no deviceid and battery fields), 1 for long frame (generation 2.1) */
EZCLFrameCtrlSoftwareCode software_code;
};

#ifdef USE_RARITAN
#include <pp/official_api_end.h>
#endif // USE_RARITAN
9 changes: 9 additions & 0 deletions src/domain/zbmessage/zclheader.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 11,11 @@

#include "zclframecontrol.h"

#ifdef USE_RARITAN
/**** Start of the official API; no includes below this point! ***************/
#include <pp/official_api_start.h>
#endif // USE_RARITAN

#define LG_MAN_CODE 0x1021

class CZCLHeader; /* Forward declaration */
Expand Down Expand Up @@ -122,3 127,7 @@ class CZCLHeader
/** */
uint8_t cmd_id;
};

#ifdef USE_RARITAN
#include <pp/official_api_end.h>
#endif // USE_RARITAN
8 changes: 4 additions & 4 deletions src/domain/zigbee-tools/zigbee-networking.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 32,17 @@ class CZigbeeNetworking : public CEzspDongleObserver
void OpenNetwork( uint8_t i_timeout );
void CloseNetwork( void );
void LeaveNetwork( void );

void startDiscoverProduct(std::function<void (EmberNodeType i_type, EmberEUI64 i_eui64, EmberNodeId i_id)> i_discoverCallbackFct = nullptr);

// Green Power


/**
* Observer
*/
void handleDongleState( EDongleState i_state ){;}
void handleEzspRxMessage( EEzspCmd i_cmd, std::vector<uint8_t> i_msg_receive );
void handleDongleState( EDongleState /* i_state */ ){;}
void handleEzspRxMessage( EEzspCmd i_cmd, std::vector<uint8_t> i_msg_receive );

private:
CEzspDongle &dongle;
Expand Down

0 comments on commit f60fd51

Please sign in to comment.