diff --git a/src/HAP.h b/src/HAP.h index c3c9d4a..ad19bb2 100644 --- a/src/HAP.h +++ b/src/HAP.h @@ -72,6 +72,34 @@ struct Accessory { uint8_t LTPK[crypto_sign_PUBLICKEYBYTES]; // Long Term Ed2519 Public Key }; +////////////////////////////////////////////////////////// +// Paired Controller Structure for Permanently-Stored Data + +class Controller { + friend class HAPClient; + + boolean allocated=false; // DEPRECATED (but needed for backwards compatability with original NVS storage of Controller info) + boolean admin; // Controller has admin privileges + uint8_t ID[36]; // Pairing ID + uint8_t LTPK[32]; // Long Term Ed2519 Public Key + + public: + + Controller(uint8_t *id, uint8_t *ltpk, boolean ad){ + allocated=true; + admin=ad; + memcpy(ID,id,36); + memcpy(LTPK,ltpk,32); + } + + Controller(){} + + const uint8_t *getID() const {return(ID);} + const uint8_t *getLTPK() const {return(LTPK);} + boolean isAdmin() const {return(admin);} + +}; + ///////////////////////////////////////////////// // HAPClient Structure // Reads and Writes from each HAP Client connection diff --git a/src/HomeSpan.h b/src/HomeSpan.h index e14f4d4..6798303 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -189,35 +189,6 @@ struct SpanOTA{ // manages OTA process static void error(ota_error_t err); }; - -////////////////////////////////////////////////////////// -// Paired Controller Structure for Permanently-Stored Data - -class Controller { - friend class HAPClient; - - boolean allocated=false; // DEPRECATED (but needed for backwards compatability with original NVS storage of Controller info) - boolean admin; // Controller has admin privileges - uint8_t ID[36]; // Pairing ID - uint8_t LTPK[32]; // Long Term Ed2519 Public Key - - public: - - Controller(uint8_t *id, uint8_t *ltpk, boolean ad){ - allocated=true; - admin=ad; - memcpy(ID,id,36); - memcpy(LTPK,ltpk,32); - } - - Controller(){} - - const uint8_t *getID() const {return(ID);} - const uint8_t *getLTPK() const {return(LTPK);} - boolean isAdmin() const {return(admin);} - -}; - ////////////////////////////////////// // USER API CLASSES BEGINS HERE // //////////////////////////////////////