EnOcean Link  1.14.0.0
Middleware to Connect EnOcean easily to other Projects
eoSecurity Class Reference

handles EnOcean Security Telegrams More...

#include <eoSecurity.h>

Public Member Functions

eoReturn ParseTeachIn (eoMessage &msgTi, eoDevice &dev)
 
eoReturn CreateTeachIn (eoMessage &msgTi, eoDevice &dev)
 
eoReturn Decrypt (const eoMessage &msgSec, eoMessage &msgNonSec, eoDevice &dev)
 
eoReturn Encrypt (const eoMessage &msgNonSec, eoMessage &msgSec, eoDevice &dev)
 
eoReturn Encrypt (const eoMaintenanceMessage &msgNonSec, eoMaintenanceMessage &msgSec, eoDevice &dev)
 
eoReturn Decrypt (const eoMaintenanceMessage &msgSec, eoMaintenanceMessage &msgNonSec, eoDevice &dev)
 
SEC_RESULT GetLastError ()
 

Static Public Member Functions

static void SetKey (uint8_t key[16], eoSecureInfo &info)
 

Detailed Description

handles EnOcean Security Telegrams

Allows you to receive and sent secured EnOcean Telegrams. After parsing a secured TeachIN telegram with the ParseTeachIn function the security Information get stored in the eoDevice::secIn field. Using the eoDevice::secIn field Secured Telegrams can be decrypted. Outgoing messages can also be encrypted using the stored Information in the eoDevice::secOut field.

Member Function Documentation

◆ CreateTeachIn()

eoReturn eoSecurity::CreateTeachIn ( eoMessage msgTi,
eoDevice dev 
)

Create the TeachIN Message

Parameters
msgTiSecure TeachIn message to create
devdevice to store eoSecureInfo to
Returns
Examples:
Security_example.cpp.

◆ Decrypt() [1/2]

eoReturn eoSecurity::Decrypt ( const eoMessage msgSec,
eoMessage msgNonSec,
eoDevice dev 
)

Decrypt data

Parameters
msgSecMessage containing Secured data
msgNonSecMessage containing decrypted data after a success
deveoDevice containing eoSecureInfo
Returns

◆ Decrypt() [2/2]

eoReturn eoSecurity::Decrypt ( const eoMaintenanceMessage msgSec,
eoMaintenanceMessage msgNonSec,
eoDevice dev 
)

Decrypts the maintenance Message, using the MaintenanceKey provided by the device

Parameters
msgSecMessage containing encrypted data
msgNonSecMessage containing the decrypted Message after a success
deveoDevice containing eoSecureInfo
Returns

◆ Encrypt() [1/2]

eoReturn eoSecurity::Encrypt ( const eoMessage msgNonSec,
eoMessage msgSec,
eoDevice dev 
)

Encrypt data

Parameters
msgSecMessage containing encrypted data after a success
msgNonSecMessage not decrypted Message to encrypt.
deveoDevice containing eoSecureInfo
Returns
Examples:
Security_example.cpp.

◆ Encrypt() [2/2]

eoReturn eoSecurity::Encrypt ( const eoMaintenanceMessage msgNonSec,
eoMaintenanceMessage msgSec,
eoDevice dev 
)

Encrypts the maintenance Message, using the MaintenanceKey provided by the device

Parameters
msgSecMessage containing encrypted data after a success
msgNonSecMessage not decrypted Message to encrypt.
deveoDevice containing eoSecureInfo
Returns

◆ GetLastError()

SEC_RESULT eoSecurity::GetLastError ( )

Get last error code

Returns
the last error code
Examples:
Security_example.cpp.

◆ ParseTeachIn()

eoReturn eoSecurity::ParseTeachIn ( eoMessage msgTi,
eoDevice dev 
)

Parse the TeachIN Message

Parameters
msgTiTeachIn message to parse
devdevice to store eoSecureInfo to
Returns

◆ SetKey()

static void eoSecurity::SetKey ( uint8_t  key[16],
eoSecureInfo info 
)
static

Set the key info for eoSecureInfo, generates subkeys as needed

Parameters
keyaes key to set
infothe eoSecureInfo to update
Returns