EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoDevice.h
Go to the documentation of this file.
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 #if !defined(EO_DEVICE_H)
34 #define EO_DEVICE_H
35 
36 #include "eoSecureInfo.h"
37 #include "eoProfile.h"
38 #include "eoISerialize.h"
39 #include "eoArchive.h"
40 #include <vector>
42 #define OMIT_RORG 0xFF
43 
49 class eoDevice: public eoISerialize
50 {
51 
52 public:
53  eoDevice();
58  eoDevice(uint32_t id);
59  virtual ~eoDevice();
60 
70  eoReturn SetProfile(eoProfile* myProfile);
82  eoReturn SetProfile(const uint8_t rorg, const uint8_t func, const uint8_t type);
89  eoProfile* GetProfile(const uint8_t rorg = OMIT_RORG) const;
93  int8_t dBm;
97  uint32_t ID;
107  uint32_t maintenanceRLC;
108 
109 
116  eoReturn GetMaintenanceKey(uint8_t keyNumber, uint8_t key[16]);
123  eoReturn SetMaintenanceKey(uint8_t keyNumber, uint8_t key[16]);
124 
125  uint8_t Serialize(eoArchive &a);
126 
127  void LoadProfiles(const char *,eoArchive & a);
128 
129 private:
130  void ClearProfileList();
131  //change to list? , or vector?
132  std::vector<eoProfile *> profileList;
133  std::vector<uint8_t *> keys;
134 
135 
136 };
137 #endif // !defined(EO_DEVICE_H)
uint32_t maintenanceRLC
Rolling code used by the maintenance Device.
Definition: eoDevice.h:107
contains base for Archives
Interface for storing.
Definition: eoISerialize.h:48
eoSecureInfo secIn
Definition: eoDevice.h:101
a class to describe an EnOcean Device
Definition: eoDevice.h:49
eoSecureInfo secOut
Definition: eoDevice.h:105
eoReturn SetProfile(eoProfile *myProfile)
#define OMIT_RORG
place holder for selecting 1 profile in list, old behaviour
Definition: eoDevice.h:42
eoReturn SetMaintenanceKey(uint8_t keyNumber, uint8_t key[16])
Set a specific maintenance key which will be used fore secure communication.
int8_t dBm
Definition: eoDevice.h:93
Definition: eoSecureInfo.h:100
uint32_t ID
Definition: eoDevice.h:97
eoReturn
contains all the return values from different functions
Definition: eoApiDef.h:40
uint8_t Serialize(eoArchive &a)
Serialization Function which will be called by the eoStorageManager.
base class for Profile parsing
Definition: eoProfile.h:61
eoProfile * GetProfile(const uint8_t rorg=OMIT_RORG) const
eoReturn GetMaintenanceKey(uint8_t keyNumber, uint8_t key[16])
Get a specific maintenance key.
the base Archive
Definition: eoArchive.h:46