HomeKey Services and Characteristics
and a watchdog trigger prevention hack
This commit is contained in:
parent
5ded77d6d9
commit
8f1c69150d
|
|
@ -130,8 +130,18 @@ struct HapCharacteristics {
|
||||||
HAPCHAR( LeakDetected, 70, PR+EV, UINT8, true );
|
HAPCHAR( LeakDetected, 70, PR+EV, UINT8, true );
|
||||||
HAPCHAR( LockCurrentState, 1D, PR+EV, UINT8, true );
|
HAPCHAR( LockCurrentState, 1D, PR+EV, UINT8, true );
|
||||||
HAPCHAR( LockPhysicalControls, A7, PW+PR+EV, UINT8, true );
|
HAPCHAR( LockPhysicalControls, A7, PW+PR+EV, UINT8, true );
|
||||||
HAPCHAR( LockTargetState, 1E, PW+PR+EV, UINT8, true );
|
HAPCHAR(LockTargetState, 1E, PW + PR + EV, UINT8, true);
|
||||||
HAPCHAR( Manufacturer, 20, PR, STRING, true );
|
HAPCHAR( HardwareFinish, 26C, PR, TLV_ENC, true );
|
||||||
|
HAPCHAR( ConfigurationState, 263, PR+EV, UINT16, true );
|
||||||
|
HAPCHAR( NFCAccessControlPoint, 264, PR+PW+WR, TLV_ENC, true );
|
||||||
|
HAPCHAR( NFCAccessSupportedConfiguration, 265, PR, TLV_ENC, true );
|
||||||
|
HAPCHAR( LockControlPoint, 19, PW, TLV_ENC, true );
|
||||||
|
HAPCHAR( AdministratorOnlyAccess, 1, PW+PR+EV, BOOL, true );
|
||||||
|
HAPCHAR( AudioFeedback, 5, PW+PR+EV, BOOL, true );
|
||||||
|
HAPCHAR( LockManagementAutoSecurityTimeout, 1A, PW+PR+EV, UINT32, true );
|
||||||
|
HAPCHAR( LockLastKnownAction, 1C, PR+EV, UINT8, false );
|
||||||
|
HAPCHAR( Logs, 1F, PR+EV, TLV_ENC, true );
|
||||||
|
HAPCHAR( Manufacturer, 20, PR, STRING, true);
|
||||||
HAPCHAR( Model, 21, PR, STRING, true );
|
HAPCHAR( Model, 21, PR, STRING, true );
|
||||||
HAPCHAR( MotionDetected, 22, PR+EV, BOOL, true );
|
HAPCHAR( MotionDetected, 22, PR+EV, BOOL, true );
|
||||||
HAPCHAR( Mute, 11A, PW+PR+EV, BOOL, true );
|
HAPCHAR( Mute, 11A, PW+PR+EV, BOOL, true );
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
#include "HAPConstants.h"
|
#include "HAPConstants.h"
|
||||||
#include "HKDF.h"
|
#include "HKDF.h"
|
||||||
#include "SRP.h"
|
#include "SRP.h"
|
||||||
|
#include <sodium/crypto_sign.h>
|
||||||
|
|
||||||
const TLV8_names HAP_Names[] = {
|
const TLV8_names HAP_Names[] = {
|
||||||
{kTLVType_Separator,"SEPARATOR"},
|
{kTLVType_Separator,"SEPARATOR"},
|
||||||
|
|
|
||||||
|
|
@ -226,6 +226,9 @@ void Network::apConfigure(){
|
||||||
LOG2("\n");
|
LOG2("\n");
|
||||||
|
|
||||||
} // process Client
|
} // process Client
|
||||||
|
else {
|
||||||
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
}
|
||||||
|
|
||||||
} // while 1
|
} // while 1
|
||||||
|
|
||||||
|
|
|
||||||
33
src/Span.h
33
src/Span.h
|
|
@ -61,6 +61,7 @@ namespace Service {
|
||||||
OPT(Model);
|
OPT(Model);
|
||||||
OPT(SerialNumber);
|
OPT(SerialNumber);
|
||||||
OPT(HardwareRevision);
|
OPT(HardwareRevision);
|
||||||
|
OPT(HardwareFinish);
|
||||||
OPT_DEP(AccessoryFlags);
|
OPT_DEP(AccessoryFlags);
|
||||||
END_SERV
|
END_SERV
|
||||||
|
|
||||||
|
|
@ -348,6 +349,24 @@ namespace Service {
|
||||||
OPT_DEP(Name);
|
OPT_DEP(Name);
|
||||||
END_SERV
|
END_SERV
|
||||||
|
|
||||||
|
CREATE_SERV(LockManagement, 44)
|
||||||
|
REQ(LockControlPoint);
|
||||||
|
REQ(Version);
|
||||||
|
OPT(AdministratorOnlyAccess);
|
||||||
|
OPT(AudioFeedback);
|
||||||
|
OPT(CurrentDoorState);
|
||||||
|
OPT(LockManagementAutoSecurityTimeout);
|
||||||
|
OPT(LockLastKnownAction);
|
||||||
|
OPT(Logs);
|
||||||
|
OPT(MotionDetected);
|
||||||
|
END_SERV
|
||||||
|
|
||||||
|
CREATE_SERV(NFCAccess, 266)
|
||||||
|
REQ(ConfigurationState);
|
||||||
|
REQ(NFCAccessControlPoint);
|
||||||
|
REQ(NFCAccessSupportedConfiguration);
|
||||||
|
END_SERV
|
||||||
|
|
||||||
CREATE_SERV(Window,8B) // Defines a motorized Window.
|
CREATE_SERV(Window,8B) // Defines a motorized Window.
|
||||||
REQ(CurrentPosition);
|
REQ(CurrentPosition);
|
||||||
REQ(TargetPosition);
|
REQ(TargetPosition);
|
||||||
|
|
@ -529,8 +548,18 @@ namespace Characteristic {
|
||||||
CREATE_CHAR(uint8_t,LeakDetected,0,0,1,NOT_DETECTED,DETECTED); // indictates if a leak is detected
|
CREATE_CHAR(uint8_t,LeakDetected,0,0,1,NOT_DETECTED,DETECTED); // indictates if a leak is detected
|
||||||
CREATE_CHAR(uint8_t,LockCurrentState,0,0,3,UNLOCKED,LOCKED,JAMMED,UNKNOWN); // indicates state of a lock
|
CREATE_CHAR(uint8_t,LockCurrentState,0,0,3,UNLOCKED,LOCKED,JAMMED,UNKNOWN); // indicates state of a lock
|
||||||
CREATE_CHAR(uint8_t,LockPhysicalControls,0,0,1,CONTROL_LOCK_DISABLED,CONTROL_LOCK_ENABLED); // indicates if local control lock is enabled
|
CREATE_CHAR(uint8_t,LockPhysicalControls,0,0,1,CONTROL_LOCK_DISABLED,CONTROL_LOCK_ENABLED); // indicates if local control lock is enabled
|
||||||
CREATE_CHAR(uint8_t,LockTargetState,0,0,1,UNLOCK,LOCK); // indicates desired state of lock
|
CREATE_CHAR(uint8_t, LockTargetState, 0, 0, 1, UNLOCK, LOCK); // indicates desired state of lock
|
||||||
CREATE_CHAR(const char *,Manufacturer,"HomeSpan",0,1); // any string - informational only
|
CREATE_CHAR(const char *,LockControlPoint,"",0,1);
|
||||||
|
CREATE_CHAR(boolean,AdministratorOnlyAccess,false,0,1);
|
||||||
|
CREATE_CHAR(boolean,AudioFeedback,false,0,1);
|
||||||
|
CREATE_CHAR(uint32_t,LockManagementAutoSecurityTimeout,0,0,1);
|
||||||
|
CREATE_CHAR(uint8_t,LockLastKnownAction,0,0,8);
|
||||||
|
CREATE_CHAR(const char *,HardwareFinish,"AQQAAAAA",0,1);
|
||||||
|
CREATE_CHAR(const char *,Logs,"",0,1);
|
||||||
|
CREATE_CHAR(uint16_t,ConfigurationState,0,0,1);
|
||||||
|
CREATE_CHAR(const char *,NFCAccessControlPoint,"",0,1);
|
||||||
|
CREATE_CHAR(const char *,NFCAccessSupportedConfiguration,"AQEQAgEQ",0,1);
|
||||||
|
CREATE_CHAR(const char*, Manufacturer, "HomeSpan", 0, 1); // any string - informational only
|
||||||
CREATE_CHAR(const char *,Model,"HomeSpan-ESP32",0,1); // any string - informational only
|
CREATE_CHAR(const char *,Model,"HomeSpan-ESP32",0,1); // any string - informational only
|
||||||
CREATE_CHAR(boolean,MotionDetected,0,0,1,NOT_DETECTED,DETECTED); // indicates if motion is detected
|
CREATE_CHAR(boolean,MotionDetected,0,0,1,NOT_DETECTED,DETECTED); // indicates if motion is detected
|
||||||
CREATE_CHAR(boolean,Mute,0,0,1,OFF,ON); // not used
|
CREATE_CHAR(boolean,Mute,0,0,1,OFF,ON); // not used
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,9 @@ char *Utils::readSerial(char *c, int max){
|
||||||
|
|
||||||
while(1){
|
while(1){
|
||||||
|
|
||||||
while(!Serial.available()); // wait until there is a new character
|
while(!Serial.available()){ // wait until there is a new character
|
||||||
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
|
}
|
||||||
|
|
||||||
buf=Serial.read();
|
buf=Serial.read();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue