Redo of Service Structure
Created HAPCharType and added vectors for required and optional characteristics to every service. Next up: add all HAP characteristic types to HAPCharType
This commit is contained in:
parent
3b68a87efe
commit
1d8bdc1202
|
|
@ -60,3 +60,66 @@ enum class StatusCode {
|
|||
InvalidValue=-70410,
|
||||
TBD=-1 // status To-Be-Determined (TBD) once service.update() called - internal use only
|
||||
};
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
struct HapCharType {
|
||||
char *id;
|
||||
char *name;
|
||||
};
|
||||
|
||||
///////////////////////////////
|
||||
|
||||
#define HAPCHAR(name,id) HapCharType name {#id,#name}
|
||||
|
||||
struct HapCharList {
|
||||
|
||||
HAPCHAR( Active, B0 );
|
||||
HAPCHAR( CarbonDioxideDetected, XX );
|
||||
HAPCHAR( ChargingState, XX );
|
||||
HAPCHAR( CurrentAirPurifierState, XX );
|
||||
HAPCHAR( AirQuality, 95 );
|
||||
HAPCHAR( BatteryLevel, XX );
|
||||
HAPCHAR( Brightness, 8 );
|
||||
HAPCHAR( ColorTemperature, CE );
|
||||
HAPCHAR( CurrentDoorState, E );
|
||||
HAPCHAR( CurrentPosition, 6D );
|
||||
HAPCHAR( CurrentTemperature, 11 );
|
||||
HAPCHAR( FirmwareRevision, 52 );
|
||||
HAPCHAR( HardwareRevision, 53 );
|
||||
HAPCHAR( HoldPosition, 6F );
|
||||
HAPCHAR( Hue, 13 );
|
||||
HAPCHAR( Identify, 14 );
|
||||
HAPCHAR( LockPhysicalControls, );
|
||||
HAPCHAR( Manufacturer, 20 );
|
||||
HAPCHAR( Model, 21 );
|
||||
HAPCHAR( Name, 23 );
|
||||
HAPCHAR( NitrogenDioxideDensity, C4 );
|
||||
HAPCHAR( ObstructionDetected, 24 );
|
||||
HAPCHAR( On, 25 );
|
||||
HAPCHAR( OutletInUse, 26 );
|
||||
HAPCHAR( OzoneDensity, C3 );
|
||||
HAPCHAR( PM10Density, C7 );
|
||||
HAPCHAR( PM25Density, C6 );
|
||||
HAPCHAR( PositionState, 72 );
|
||||
HAPCHAR( RotationDirection, 28 );
|
||||
HAPCHAR( RotationSpeed, 29 );
|
||||
HAPCHAR( Saturation , 2F );
|
||||
HAPCHAR( SerialNumber, 30 );
|
||||
HAPCHAR( SlatType, C0 );
|
||||
HAPCHAR( SmokeDetected, 76 );
|
||||
HAPCHAR( StatusActive, 75 );
|
||||
HAPCHAR( StatusFault, 77 );
|
||||
HAPCHAR( StatusJammed, 78 );
|
||||
HAPCHAR( StatusLowBattery, 79 );
|
||||
HAPCHAR( StatusTampered, 7A );
|
||||
HAPCHAR( SulphurDioxideDensity, C5 );
|
||||
HAPCHAR( SwingMode, B6 );
|
||||
HAPCHAR( TargetAirPurifierState, XX );
|
||||
HAPCHAR( TargetDoorState, 32 );
|
||||
HAPCHAR( TargetPosition, 7C );
|
||||
HAPCHAR( TemperatureDisplayUnits, 36 );
|
||||
HAPCHAR( Version, 37 );
|
||||
HAPCHAR( VOCDensity, C8 );
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ struct Span{
|
|||
vector<SpanButton *> PushButtons; // vector of pointer to all PushButtons
|
||||
unordered_map<uint64_t, uint32_t> TimedWrites; // map of timed-write PIDs and Alarm Times (based on TTLs)
|
||||
|
||||
HapCharList chr; // list of all HAP Characteristics
|
||||
|
||||
void begin(Category catID,
|
||||
char *displayName=DEFAULT_DISPLAY_NAME,
|
||||
char *hostNameBase=DEFAULT_HOST_NAME,
|
||||
|
|
@ -131,6 +133,8 @@ struct SpanService{
|
|||
boolean hidden=false; // optional property indicating service is hidden
|
||||
boolean primary=false; // optional property indicating service is primary
|
||||
vector<SpanCharacteristic *> Characteristics; // vector of pointers to all Characteristics in this Service
|
||||
vector<HapCharType *> req; // vector of pointers to all required HAP Characteristic Types for this Service
|
||||
vector<HapCharType *> opt; // vector of pointers to all optional HAP Characteristic Types for this Service
|
||||
|
||||
SpanService(const char *type, const char *hapName,
|
||||
char *requiredChars="", char *optionalChars="");
|
||||
|
|
|
|||
458
src/Services.h
458
src/Services.h
|
|
@ -1,222 +1,324 @@
|
|||
|
||||
/////////////////////////////////////////
|
||||
// HAP CHARACTERISTICS (HAP Chapter 9) //
|
||||
/////////////////////////////////////////
|
||||
|
||||
#define CHAR_Active "B0"
|
||||
#define CHAR_CarbonDioxideDetected ""
|
||||
#define CHAR_ChargingState ""
|
||||
#define CHAR_CurrentAirPurifierState ""
|
||||
#define CHAR_AirQuality "95"
|
||||
#define CHAR_BatteryLevel ""
|
||||
#define CHAR_Brightness "8"
|
||||
#define CHAR_ColorTemperature "CE"
|
||||
#define CHAR_CurrentDoorState "E"
|
||||
#define CHAR_CurrentPosition "6D"
|
||||
#define CHAR_CurrentTemperature "11"
|
||||
#define CHAR_FirmwareRevision "52"
|
||||
#define CHAR_HardwareRevision "53"
|
||||
#define CHAR_HoldPosition "6F"
|
||||
#define CHAR_Hue "13"
|
||||
#define CHAR_Identify "14"
|
||||
#define CHAR_LockPhysicalControls ""
|
||||
#define CHAR_Manufacturer "20"
|
||||
#define CHAR_Model "21"
|
||||
#define CHAR_Name "23"
|
||||
#define CHAR_NitrogenDioxideDensity "C4"
|
||||
#define CHAR_ObstructionDetected "24"
|
||||
#define CHAR_On "25"
|
||||
#define CHAR_OutletInUse "26"
|
||||
#define CHAR_OzoneDensity "C3"
|
||||
#define CHAR_PM10Density "C7"
|
||||
#define CHAR_PM25Density "C6"
|
||||
#define CHAR_PositionState "72"
|
||||
#define CHAR_RotationDirection "28"
|
||||
#define CHAR_RotationSpeed "29"
|
||||
#define CHAR_Saturation "2F"
|
||||
#define CHAR_SerialNumber "30"
|
||||
#define CHAR_SlatType "C0"
|
||||
#define CHAR_SmokeDetected "76"
|
||||
#define CHAR_StatusActive "75"
|
||||
#define CHAR_StatusFault "77"
|
||||
#define CHAR_StatusJammed "78"
|
||||
#define CHAR_StatusLowBattery "79"
|
||||
#define CHAR_StatusTampered "7A"
|
||||
#define CHAR_SulphurDioxideDensity "C5"
|
||||
#define CHAR_SwingMode "B6"
|
||||
#define CHAR_TargetAirPurifierState ""
|
||||
#define CHAR_TargetDoorState "32"
|
||||
#define CHAR_TargetPosition "7C"
|
||||
#define CHAR_TemperatureDisplayUnits "36"
|
||||
#define CHAR_Version "37"
|
||||
#define CHAR_VOCDensity "C8"
|
||||
|
||||
#define IDNAME(id) id,#id
|
||||
|
||||
//////////////////////////////////
|
||||
// HAP SERVICES (HAP Chapter 8) //
|
||||
//////////////////////////////////
|
||||
|
||||
#define SVC_AccessoryInformation "3E"
|
||||
#define SVC_AccessoryInformation_Required CHAR_FirmwareRevision " " CHAR_Identify " " CHAR_Manufacturer " " CHAR_Model " " CHAR_Name " " CHAR_SerialNumber
|
||||
#define SVC_AccessoryInformation_Optional CHAR_HardwareRevision
|
||||
|
||||
#define SVC_AirPurifier "BB"
|
||||
#define SVC_AirPurifier_Required CHAR_Active " " CHAR_CurrentAirPurifierState " " CHAR_TargetAirPurifierState
|
||||
#define SVC_AirPurifier_Optional CHAR_Name " " CHAR_RotationalSpeed " " CHAR_SwingMode " " CHAR_LockPhysicalControls
|
||||
|
||||
#define SVC_AirQualitySensor "8D"
|
||||
#define SVC_AirQualitySensor_Required CHAR_AirQuality
|
||||
#define SVC_AirQualitySensor_Optional CHAR_Name " " CHAR_OzoneDensity " " CHAR_NitrogenDioxideDensity " " CHAR_SulphurDioxideDensity " " CHAR_PM25Density " " \
|
||||
CHAR_PM10Density " " CHAR_VOCDensity " " CHAR_StatusActive " " CHAR_StatusFault " " CHAR_StatusTampered " " CHAR_StatusLowBattery
|
||||
|
||||
#define SVC_BatteryService "96"
|
||||
#define SVC_BatteryService_Required CHAR_BatteryLevel " " CHAR_ChargingState " " CHAR_StatusLowBattery
|
||||
#define SVC_BatteryService_Optional CHAR_NAME
|
||||
|
||||
#define SVC_CarbonDioxideSensor "92"
|
||||
#define SVC_CarbonDioxideSensor_Required CHAR_CarbonDioxideDetected
|
||||
#define SVC_CarbonDioxideSensor_Optional CHAR_Name " " CHAR_StatusActive " " CHAR_StatusFault " " CHAR_StatusTampered " " CHAR_StatusLowBattery " " \
|
||||
CHAR_CarbonDioxideLevel " " CHAR_CarbonDioxidePeakLevel
|
||||
|
||||
#define SVC_CarbonMonoxideSensor "7F"
|
||||
#define SVC_CarbonMonoxideSensor_Required CHAR_CarbonMonoxideDetected
|
||||
#define SVC_CarbonMonoxideSensor_Optional CHAR_Name " " CHAR_StatusActive " " CHAR_StatusFault " " CHAR_StatusTampered " " CHAR_StatusLowBattery " " \
|
||||
CHAR_CarbonMonoxideLevel " " CHAR_CarbonMonoxidePeakLevel
|
||||
|
||||
#define SVC_ContactSensor "80"
|
||||
#define SVC_ContactSensor_Required CHAR_ContactSensorState
|
||||
#define SVC_ContactSensor_Optional CHAR_Name " " CHAR_StatusActive " " CHAR_StatusFault " " CHAR_StatusTampered " " CHAR_StatusLowBattery
|
||||
|
||||
#define SVC_Door "81"
|
||||
#define SVC_Door_Required CHAR_CurrentPosition " " CHAR_TargetPosition " " CHAR_PositionState
|
||||
#define SVC_Door_Optional CHAR_Name " " CHAR_HoldPosition " " CHAR_ObstructionDetected
|
||||
|
||||
#define SVC_Doorbell "121"
|
||||
#define SVC_Doorbell_Required CHAR_ProgrammableSwitchEvent
|
||||
#define SVC_Doorbell_Optional CHAR_Name " " CHAR_Volume " " CHAR_Brightness
|
||||
|
||||
#define SVC_Fan "B7"
|
||||
#define SVC_Fan_Required CHAR_Active
|
||||
#define SVC_Fan_Optional CHAR_Name " " CHAR_CurrentFanState " " CHAR_TargetFanState " " CHAR_RotationDirection " " CHAR_RotationSpeed " " \
|
||||
CHAR_SwingMode " " CHAR_LockPhysicalControls
|
||||
|
||||
#define SVC_Faucet "D7"
|
||||
#define SVC_Faucet_Required CHAR_Active
|
||||
#define SVC_Faucet_Optional CHAR_StatusFault " " CHAR_Name
|
||||
|
||||
#define SVC_FilterMaintenance "BA"
|
||||
#define SVC_FilterMaintenance_Required CHAR_FilterChangeIndication
|
||||
#define SVC_FilterMaintenance_Optional CHAR_Name " " CHAR_FilterLifeLevel " " CHAR_ResetFilterIndication
|
||||
|
||||
#define SVC_GarageDoorOpener "41"
|
||||
#define SVC_GarageDoorOpener_Required CHAR_CurrentDoorState " " CHAR_TargetDoorState " " CHAR_ObstructionDetected
|
||||
#define SVC_GarageDoorOpener_Optional CHAR_LockCurrentState " " CHAR_LockTargetState " " CHAR_Name
|
||||
|
||||
#define SVC_HAPProtocolInformation "A2"
|
||||
#define SVC_HAPProtocolInformation_Required CHAR_Version
|
||||
#define SVC_HAPProtocolInformation_Optional ""
|
||||
|
||||
#define SVC_HeaterCooler "BC"
|
||||
#define SVC_HeaterCooler_Required CHAR_Active " " CHAR_CurrentTemperature " " CHAR_CurrentHeaterCoolerState " " CHAR_TargetHeaterCoolerState " " \
|
||||
#define SVC_HeaterCooler_Optional CHAR_Name " " CHAR_RotationSpeed " " CHAR_TemperatureDisplayUnits " " CHAR_SwingMode " " CHAR_CoolingThesholdTemperature " " \
|
||||
CHAR_HeatingThresholdTemperature " " CHAR_LockPhysicalControls
|
||||
|
||||
|
||||
#define SVC_HumidifierDehumidifier "BD"
|
||||
#define SVC_HumiditySensor "82"
|
||||
#define SVC_IrrigationSystem "CF"
|
||||
#define SVC_LeakSensor "83"
|
||||
#define SVC_LightBulb "43"
|
||||
#define SVC_LightSensor "84"
|
||||
#define SVC_MotionSensor "85"
|
||||
#define SVC_OccupancySensor "86"
|
||||
#define SVC_Outlet "47"
|
||||
#define SVC_ServiceLabel "47"
|
||||
#define SVC_Slat "B9"
|
||||
#define SVC_SmokeSensor "87"
|
||||
#define SVC_StatelessProgrammableSwitch "89"
|
||||
#define SVC_Switch "49"
|
||||
#define SVC_TemperatureSensor "8A"
|
||||
#define SVC_Thermostat "4A"
|
||||
#define SVC_Valve "D0"
|
||||
#define SVC_Window "8B"
|
||||
#define SVC_WindowCovering "8C"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define REQ(name) req.push_back(&homeSpan.chr.name)
|
||||
#define OPT(name) opt.push_back(&homeSpan.chr.name)
|
||||
|
||||
namespace Service {
|
||||
|
||||
struct AccessoryInformation : SpanService { AccessoryInformation() : SpanService{"3E","AccessoryInformation","52,14,20,21,23,30","53"}{} };
|
||||
struct AccessoryInformation : SpanService { AccessoryInformation() : SpanService{"3E","AccessoryInformation"}{
|
||||
REQ(FirmwareRevision);
|
||||
REQ(Identify);
|
||||
REQ(Manufacturer);
|
||||
REQ(Model);
|
||||
REQ(Name);
|
||||
REQ(SerialNumber);
|
||||
OPT(HardwareRevision);
|
||||
}};
|
||||
|
||||
struct AirPurifier : SpanService { AirPurifier() : SpanService{"BB","AirPurifier","B0,A9,A8","23,29,B6,A7"}{} };
|
||||
struct AirPurifier : SpanService { AirPurifier() : SpanService{"BB","AirPurifier"}{
|
||||
REQ(Active);
|
||||
REQ(CurrentAirPurifierState);
|
||||
REQ(TargetAirPurifierState);
|
||||
OPT(Name);
|
||||
OPT(RotationSpeed);
|
||||
OPT(SwingMode);
|
||||
OPT(LockPhysicalControls);
|
||||
}};
|
||||
|
||||
struct AirQualitySensor : SpanService { AirQualitySensor() : SpanService{"8D","AirQualitySensor","95","23,C3,C4,C5,C6,C7,C8,75,77,7A,79"}{} };
|
||||
struct AirQualitySensor : SpanService { AirQualitySensor() : SpanService{"8D","AirQualitySensor"}{
|
||||
REQ(AirQuality);
|
||||
OPT(Name);
|
||||
OPT(OzoneDensity);
|
||||
OPT(NitrogenDioxideDensity);
|
||||
OPT(SulphurDioxideDensity);
|
||||
OPT(PM25Density);
|
||||
OPT(PM10Density);
|
||||
OPT(VOCDensity);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct BatteryService : SpanService { BatteryService() : SpanService{"96","BatteryService","68,8F,79","23"}{} };
|
||||
struct BatteryService : SpanService { BatteryService() : SpanService{"96","BatteryService"}{
|
||||
REQ(BatteryLevel);
|
||||
REQ(ChargingState);
|
||||
REQ(StatusLowBattery);
|
||||
OPT(Name);
|
||||
}};
|
||||
|
||||
struct CarbonDioxideSensor : SpanService { CarbonDioxideSensor() : SpanService{"97","CarbonDioxideSensor","92","23,75,77,7A,79,93,94"}{} };
|
||||
struct CarbonDioxideSensor : SpanService { CarbonDioxideSensor() : SpanService{"97","CarbonDioxideSensor"}{
|
||||
REQ(CarbonDioxideDetected);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
OPT(CarbonDioxideLevel);
|
||||
OPT(CarbonDioxidePeakLevel);
|
||||
}};
|
||||
|
||||
struct CarbonMonoxideSensor : SpanService { CarbonMonoxideSensor() : SpanService{"7F","CarbonMonoxideSensor","69","23,75,77,7A,79,90,91"}{} };
|
||||
struct CarbonMonoxideSensor : SpanService { CarbonMonoxideSensor() : SpanService{"7F","CarbonMonoxideSensor"}{
|
||||
REQ(CarbonMonoxideDetected);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
OPT(CarbonMonoxideLevel);
|
||||
OPT(CarbonMonoxidePeakLevel);
|
||||
}};
|
||||
|
||||
struct ContactSensor : SpanService { ContactSensor() : SpanService{"80","ContactSensor","6A","23,75,77,7A,79"}{} };
|
||||
struct ContactSensor : SpanService { ContactSensor() : SpanService{"80","ContactSensor"}{
|
||||
REQ(ContactSensorState);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct Door : SpanService { Door() : SpanService{"81","Door","6D,7C,72","23,6F,24"}{} };
|
||||
struct Door : SpanService { Door() : SpanService{"81","Door"}{
|
||||
REQ(CurrentPosition);
|
||||
REQ(TargetPosition);
|
||||
REQ(PositionState);
|
||||
OPT(Name);
|
||||
OPT(HoldPosition);
|
||||
OPT(ObstructionDetected);
|
||||
}};
|
||||
|
||||
struct Doorbell : SpanService { Doorbell() : SpanService{"121","Doorbell","73","23,119,8"}{} };
|
||||
struct Doorbell : SpanService { Doorbell() : SpanService{"121","Doorbell"}{
|
||||
REQ(ProgrammableSwitchEvent);
|
||||
OPT(Name);
|
||||
OPT(Volume);
|
||||
OPT(Brightness);
|
||||
}};
|
||||
|
||||
struct Fan : SpanService { Fan() : SpanService{"B7","Fan","B0","23,AF,BF,28,29,B6,A7"}{} };
|
||||
struct Fan : SpanService { Fan() : SpanService{"B7","Fan"}{
|
||||
REQ(Active);
|
||||
OPT(Name);
|
||||
OPT(CurrentFanState);
|
||||
OPT(TargetFanState);
|
||||
OPT(RotationDirection);
|
||||
OPT(RotationSpeed);
|
||||
OPT(SwingMode);
|
||||
OPT(LockPhysicalControls);
|
||||
}};
|
||||
|
||||
struct Faucet : SpanService { Faucet() : SpanService{"D7","Faucet","B0","23,77"}{} };
|
||||
struct Faucet : SpanService { Faucet() : SpanService{"D7","Faucet"}{
|
||||
REQ(Active);
|
||||
OPT(StatusFault);
|
||||
OPT(Name);
|
||||
}};
|
||||
|
||||
struct FilterMaintenance : SpanService { FilterMaintenance() : SpanService{"BA","FilterMaintenance","AC","23,AB,AD"}{} };
|
||||
struct FilterMaintenance : SpanService { FilterMaintenance() : SpanService{"BA","FilterMaintenance"}{
|
||||
REQ(FilterChangeIndication);
|
||||
OPT(Name);
|
||||
OPT(FilterLifeLevel);
|
||||
OPT(ResetFilterIndication);
|
||||
}};
|
||||
|
||||
struct GarageDoorOpener : SpanService { GarageDoorOpener() : SpanService{"41","GarageDoorOpener","E,32,24","23,1D,1E"}{} };
|
||||
struct GarageDoorOpener : SpanService { GarageDoorOpener() : SpanService{"41","GarageDoorOpener"}{
|
||||
REQ(CurrentDoorState);
|
||||
REQ(TargetDoorState);
|
||||
REQ(ObstructionDetected);
|
||||
OPT(LockCurrentState);
|
||||
OPT(LockTargetState);
|
||||
OPT(Name);
|
||||
}};
|
||||
|
||||
struct HAPProtocolInformation : SpanService { HAPProtocolInformation() : SpanService{"A2","HAPProtocolInformation","37"}{} };
|
||||
struct HAPProtocolInformation : SpanService { HAPProtocolInformation() : SpanService{"A2","HAPProtocolInformation"}{
|
||||
REQ(Version);
|
||||
}};
|
||||
|
||||
struct HeaterCooler : SpanService { HeaterCooler() : SpanService{"BC","HeaterCooler"}{} };
|
||||
struct HeaterCooler : SpanService { HeaterCooler() : SpanService{"BC","HeaterCooler"}{
|
||||
REQ(Active);
|
||||
REQ(CurrentTemperature);
|
||||
REQ(CurrentHeaterCoolerState);
|
||||
REQ(TargetHeaterCoolerState);
|
||||
OPT(Name);
|
||||
OPT(RotationSpeed);
|
||||
OPT(TemperatureDisplayUnits);
|
||||
OPT(SwingMode);
|
||||
OPT(CoolingThesholdTemperature)
|
||||
OPT(HeatingThresholdTemperature);
|
||||
OPT(CHAR_LockPhysicalControls);
|
||||
}};
|
||||
|
||||
struct HumidifierDehumidifier : SpanService { HumidifierDehumidifier() : SpanService{"BD","HumidifierDehumidifier"}{} };
|
||||
struct HumidifierDehumidifier : SpanService { HumidifierDehumidifier() : SpanService{"BD","HumidifierDehumidifier"}{
|
||||
REQ(Active);
|
||||
REQ(CurrentRelativeHumidity);
|
||||
REQ(CurrentHumidifierDehumidifierState);
|
||||
REQ(TargetHumidifierDehumidifierState);
|
||||
OPT(Name);
|
||||
OPT(RelativeHumidityDehumidifierThreshold);
|
||||
OPT(RelativeHumidityHumnidifierThreshold);
|
||||
OPT(RotationSpeed);
|
||||
OPT(SwingMode);
|
||||
OPT(WaterLevel);
|
||||
OPT(LockPhysicalControls);
|
||||
}};
|
||||
|
||||
struct HumiditySensor : SpanService { HumiditySensor() : SpanService{"82","HumiditySensor"}{} };
|
||||
struct HumiditySensor : SpanService { HumiditySensor() : SpanService{"82","HumiditySensor"}{
|
||||
REQ(CurrentRelativeHumidity);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct IrrigationSystem : SpanService { IrrigationSystem() : SpanService{"CF","IrrigationSystem"}{} };
|
||||
struct IrrigationSystem : SpanService { IrrigationSystem() : SpanService{"CF","IrrigationSystem"}{
|
||||
REQ(Active);
|
||||
REQ(ProgramMode);
|
||||
REQ(InUse);
|
||||
OPT(RemainingDuration);
|
||||
OPT(Name);
|
||||
OPT(StatusFault);
|
||||
}};
|
||||
|
||||
struct LeakSensor : SpanService { LeakSensor() : SpanService{"83","LeakSensor"}{} };
|
||||
struct LeakSensor : SpanService { LeakSensor() : SpanService{"83","LeakSensor"}{
|
||||
REQ(LeakDetected);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct LightBulb : SpanService { LightBulb() : SpanService{"43","LightBulb"}{} };
|
||||
struct LightBulb : SpanService { LightBulb() : SpanService{"43","LightBulb"}{
|
||||
REQ(On);
|
||||
OPT(Brightness);
|
||||
OPT(Hue);
|
||||
OPT(Name);
|
||||
OPT(Saturation);
|
||||
OPT(ColorTemperature);
|
||||
}};
|
||||
|
||||
struct LightSensor : SpanService { LightSensor() : SpanService{"84","LightSensor"}{} };
|
||||
struct LightSensor : SpanService { LightSensor() : SpanService{"84","LightSensor"}{
|
||||
REQ(CurrentAmbientLightLevel);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct MotionSensor : SpanService { MotionSensor() : SpanService{"85","MotionSensor"}{} };
|
||||
struct MotionSensor : SpanService { MotionSensor() : SpanService{"85","MotionSensor"}{
|
||||
REQ(MotionDetected);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct OccupancySensor : SpanService { OccupancySensor() : SpanService{"86","OccupancySensor"}{} };
|
||||
struct OccupancySensor : SpanService { OccupancySensor() : SpanService{"86","OccupancySensor"}{
|
||||
REQ(OccupancyDetected);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct Outlet : SpanService { Outlet() : SpanService{"47","Outlet"}{} };
|
||||
struct Outlet : SpanService { Outlet() : SpanService{"47","Outlet"}{
|
||||
REQ(On);
|
||||
REQ(OutletInUse);
|
||||
OPT(Name);
|
||||
}};
|
||||
|
||||
struct ServiceLabel : SpanService { ServiceLabel() : SpanService{"47","ServiceLabel"}{} };
|
||||
struct ServiceLabel : SpanService { ServiceLabel() : SpanService{"47","ServiceLabel"}{
|
||||
REQ(ServiceLabelNamespace);
|
||||
}};
|
||||
|
||||
struct Slat : SpanService { Slat() : SpanService{"B9","Slat"}{} };
|
||||
struct Slat : SpanService { Slat() : SpanService{"B9","Slat"}{
|
||||
REQ(CurrentSlatState);
|
||||
REQ(SlatType);
|
||||
OPT(Name);
|
||||
OPT(SwingMode);
|
||||
OPT(CurrentTiltAngle);
|
||||
OPT(TargetTiltAngle);
|
||||
}};
|
||||
|
||||
struct SmokeSensor : SpanService { SmokeSensor() : SpanService{"87","SmokeSensor"}{} };
|
||||
struct SmokeSensor : SpanService { SmokeSensor() : SpanService{"87","SmokeSensor"}{
|
||||
REQ(SmokeDetected);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct StatelessProgrammableSwitch : SpanService { StatelessProgrammableSwitch() : SpanService{"89","StatelessProgrammableSwitch"}{} };
|
||||
struct StatelessProgrammableSwitch : SpanService { StatelessProgrammableSwitch() : SpanService{"89","StatelessProgrammableSwitch"}{
|
||||
REQ(ProgrammableSwitchEvent);
|
||||
OPT(Name);
|
||||
OPT(ServiceLabelIndex);
|
||||
}};
|
||||
|
||||
struct Switch : SpanService { Switch() : SpanService{"49","Switch"}{} };
|
||||
struct Switch : SpanService { Switch() : SpanService{"49","Switch"}{
|
||||
REQ(On);
|
||||
OPT(Name);
|
||||
}};
|
||||
|
||||
struct TemperatureSensor : SpanService { TemperatureSensor() : SpanService{"8A","TemperatureSensor"}{} };
|
||||
struct TemperatureSensor : SpanService { TemperatureSensor() : SpanService{"8A","TemperatureSensor"}{
|
||||
REQ(CurrentTemperature);
|
||||
OPT(Name);
|
||||
OPT(StatusActive);
|
||||
OPT(StatusFault);
|
||||
OPT(StatusTampered);
|
||||
OPT(StatusLowBattery);
|
||||
}};
|
||||
|
||||
struct Thermostat : SpanService { Thermostat() : SpanService{"4A","Thermostat"}{} };
|
||||
struct Thermostat : SpanService { Thermostat() : SpanService{"4A","Thermostat"}{
|
||||
REQ(CurrentHeatingCoolingState);
|
||||
REQ(TargetHeatingColingState);
|
||||
REQ(CurrentTemperature);
|
||||
REQ(TargetTemperature);
|
||||
REQ(TemperatureDisplayUnits);
|
||||
OPT(CoolingThresholdTemperature);
|
||||
OPT(CurrentRelativeHumidity);
|
||||
OPT(HeatingThresholdTemperature);
|
||||
OPT(Name);
|
||||
OPT(TargetRelativeHumidity);
|
||||
}};
|
||||
|
||||
struct Valve : SpanService { Valve() : SpanService{"D0","Valve"}{} };
|
||||
struct Valve : SpanService { Valve() : SpanService{"D0","Valve"}{
|
||||
REQ(Active);
|
||||
REQ(InUse);
|
||||
REQ(ValveType);
|
||||
OPT(SetDuration);
|
||||
OPT(RemainingDuration);
|
||||
OPT(IsConfigured);
|
||||
OPT(ServiceLabelIndex);
|
||||
OPT(StatusFault);
|
||||
OPT(Name);
|
||||
}};
|
||||
|
||||
struct Window : SpanService { Window() : SpanService{"8B","Window"}{} };
|
||||
struct Window : SpanService { Window() : SpanService{"8B","Window"}{
|
||||
REQ(CurrentPosition);
|
||||
REQ(TargetPosition);
|
||||
REQ(PositionState);
|
||||
OPT(Name);
|
||||
OPT(HoldPosition);
|
||||
OPT(ObstructionDetected);
|
||||
}};
|
||||
|
||||
struct WindowCovering : SpanService { WindowCovering() : SpanService{"8C","WindowCovering"}{} };
|
||||
struct WindowCovering : SpanService { WindowCovering() : SpanService{"8C","WindowCovering"}{
|
||||
REQ(CurrentPosition);
|
||||
REQ(TargetPosition);
|
||||
REQ(PositionState);
|
||||
OPT(Name);
|
||||
OPT(HoldPosition);
|
||||
OPT(CurrentHorizontalTiltAngle);
|
||||
OPT(TargetHorizontalTiltAngle);
|
||||
OPT(CurrentVerticalTiltAngle);
|
||||
OPT(TargetVerticalTiltAngle);
|
||||
OPT(ObstructionDetected);
|
||||
}};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue