Bluenet  5.7.0
Bluenet, firmware for nRF52 smart home devices
Loading...
Searching...
No Matches
CommandAdvHandler Class Referenceabstract

#include <cs_CommandAdvHandler.h>

Inheritance diagram for CommandAdvHandler:
Collaboration diagram for CommandAdvHandler:

Public Member Functions

void init ()
 
void handleEvent (event_t &event)
 Handle events. More...
 
- Public Member Functions inherited from EventListener
 EventListener ()
 
virtual ~EventListener ()
 unregisters the listener. More...
 
virtual void handleEvent (event_t &event)=0
 Handle events. More...
 
void listen ()
 Registers this with the EventDispatcher. More...
 

Static Public Member Functions

static CommandAdvHandlergetInstance ()
 

Private Member Functions

 CommandAdvHandler ()
 
 TYPIFY (CONFIG_SPHERE_ID) _sphereId=0
 
void parseAdvertisement (scanned_device_t *scannedDevice)
 
bool handleEncryptedCommandPayload (scanned_device_t *scannedDevice, const command_adv_header_t &header, const cs_data_t &nonce, cs_data_t &encryptedPayload, uint16_t encryptedPayloadRC5[2], uint16_t decryptedPayloadRC5[2])
 
bool decryptRC5Payload (uint16_t encryptedPayload[2], uint16_t decryptedPayload[2])
 
void handleDecryptedRC5Payload (scanned_device_t *scannedDevice, const command_adv_header_t &header, uint16_t decryptedPayload[2])
 
EncryptionAccessLevel getRequiredAccessLevel (const AdvCommandTypes type)
 
int checkSimilarCommand (uint8_t deviceToken, cs_data_t &encryptedData, uint16_t encryptedRC5, uint16_t &decryptedRC5)
 Return index of claim with this device token. More...
 
bool claim (uint8_t deviceToken, cs_data_t &encryptedData, uint16_t encryptedRC5, uint16_t decryptedRC5, int indexOfDevice)
 
void tickClaims ()
 

Private Attributes

command_adv_claim_t _claims [CMD_ADV_MAX_CLAIM_COUNT]
 

Constructor & Destructor Documentation

◆ CommandAdvHandler()

Member Function Documentation

◆ checkSimilarCommand()

int CommandAdvHandler::checkSimilarCommand ( uint8_t  deviceToken,
cs_data_t encryptedData,
uint16_t  encryptedRC5,
uint16_t &  decryptedRC5 
)
private

Return index of claim with this device token.

Parameters
[out]decryptedRC5When previous encrypted data is similar: set to previous decrypted RC5 data.

Returns -1 when the device token was not found. Returns -2 when the device token was found, but the previous encryptedData is similar.

◆ claim()

bool CommandAdvHandler::claim ( uint8_t  deviceToken,
cs_data_t encryptedData,
uint16_t  encryptedRC5,
uint16_t  decryptedRC5,
int  indexOfDevice 
)
private

◆ decryptRC5Payload()

bool CommandAdvHandler::decryptRC5Payload ( uint16_t  encryptedPayload[2],
uint16_t  decryptedPayload[2] 
)
private

◆ getInstance()

static CommandAdvHandler & CommandAdvHandler::getInstance ( )
inlinestatic

◆ getRequiredAccessLevel()

EncryptionAccessLevel CommandAdvHandler::getRequiredAccessLevel ( const AdvCommandTypes  type)
private

◆ handleDecryptedRC5Payload()

void CommandAdvHandler::handleDecryptedRC5Payload ( scanned_device_t scannedDevice,
const command_adv_header_t header,
uint16_t  decryptedPayload[2] 
)
private

◆ handleEncryptedCommandPayload()

bool CommandAdvHandler::handleEncryptedCommandPayload ( scanned_device_t scannedDevice,
const command_adv_header_t header,
const cs_data_t nonce,
cs_data_t encryptedPayload,
uint16_t  encryptedPayloadRC5[2],
uint16_t  decryptedPayloadRC5[2] 
)
private

◆ handleEvent()

void CommandAdvHandler::handleEvent ( event_t event)
virtual

Handle events.

This method is overloaded by all classes that derive from EventListener. They can receive an event_t struct and act upon it. These events are dispatched by the EventDispatcher.

Implements EventListener.

◆ init()

void CommandAdvHandler::init ( )

◆ parseAdvertisement()

void CommandAdvHandler::parseAdvertisement ( scanned_device_t scannedDevice)
private

◆ tickClaims()

void CommandAdvHandler::tickClaims ( )
private

◆ TYPIFY()

CommandAdvHandler::TYPIFY ( CONFIG_SPHERE_ID  )
privatepure virtual

Member Data Documentation

◆ _claims

command_adv_claim_t CommandAdvHandler::_claims[CMD_ADV_MAX_CLAIM_COUNT]
private

The documentation for this class was generated from the following file: