-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lionel AINS
committed
Nov 21, 2019
1 parent
6f70238
commit 4b7697d
Showing
2 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* @file green-power-device.cpp | ||
* | ||
* @brief Represents data for a green power device | ||
*/ | ||
|
||
#include "green-power-device.h" | ||
|
||
CGpDevice::CGpDevice(uint32_t i_source_id, const EmberKeyData& i_key) : | ||
source_id(i_source_id), | ||
key(i_key) | ||
{ | ||
} | ||
|
||
uint32_t CGpDevice::getSourceId() const | ||
{ | ||
return this->source_id; | ||
} | ||
|
||
EmberKeyData CGpDevice::getKey() const | ||
{ | ||
return this->key; | ||
} | ||
|
||
const EmberKeyData CGpDevice::UNKNOWN_KEY({0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/** | ||
* @file green-power-device.h | ||
* | ||
* @brief Represents data for a green power device | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include <cstdint> | ||
#include "../ezsp-protocol/ezsp-enum.h" | ||
|
||
/** | ||
* @brief Class to encapsulate data representing a green power device | ||
*/ | ||
class CGpDevice | ||
{ | ||
public: | ||
static const EmberKeyData UNKNOWN_KEY; | ||
|
||
/** | ||
* @brief Default constructor | ||
* | ||
* Construction without arguments is not allowed | ||
*/ | ||
CGpDevice() = delete; | ||
|
||
/** | ||
* @brief Constructor with minimal parameter | ||
* @param i_source_id : source id of gpd | ||
* @param i_key : key used by the GP device | ||
*/ | ||
CGpDevice(uint32_t i_source_id, const EmberKeyData& i_key); | ||
|
||
/** | ||
* @brief Assignment operator | ||
* | ||
* Copy construction is forbidden on this class | ||
*/ | ||
CGpDevice& operator=(const CGpDevice& other) = delete; | ||
|
||
/** | ||
* @brief Retrieve the source id for this device | ||
* | ||
* @return The source ID | ||
*/ | ||
uint32_t getSourceId() const; | ||
|
||
/** | ||
* @brief Retrieve the key for this device | ||
* | ||
* @return The key | ||
*/ | ||
EmberKeyData getKey() const; | ||
|
||
private: | ||
uint32_t source_id; /*!< The source ID for this device */ | ||
EmberKeyData key; /*!< The key for this device */ | ||
}; |