diff --git a/examples/09-MessageLogging/09-MessageLogging.ino b/examples/09-MessageLogging/09-MessageLogging.ino index eefb533..f973669 100644 --- a/examples/09-MessageLogging/09-MessageLogging.ino +++ b/examples/09-MessageLogging/09-MessageLogging.ino @@ -1,7 +1,7 @@ /********************************************************************************* * MIT License * - * Copyright (c) 2020 Gregg E. Berman + * Copyright (c) 2020-2022 Gregg E. Berman * * https://github.com/HomeSpan/HomeSpan * @@ -37,7 +37,6 @@ #include "HomeSpan.h" #include "DEV_LED.h" -#include "DEV_Identify.h" void setup() { @@ -81,24 +80,21 @@ void setup() { homeSpan.begin(Category::Bridges,"HomeSpan Bridge"); - // Defines the Bridge Accessory - - new SpanAccessory(); - new DEV_Identify("Bridge #1","HomeSpan","123-ABC","HS Bridge","0.9",3); - new Service::HAPProtocolInformation(); - new Characteristic::Version("1.1.0"); - - // Defines an ON/OFF LED Accessory attached to pin 16 - - new SpanAccessory(); - new DEV_Identify("On-Off LED","HomeSpan","123-ABC","20mA LED","0.9",0); + new SpanAccessory(); + new Service::AccessoryInformation(); + new Characteristic::Identify(); + + new SpanAccessory(); + new Service::AccessoryInformation(); + new Characteristic::Identify(); + new Characteristic::Name("Simple LED"); new DEV_LED(16); - // Defines a Dimmable (PWM-driven) LED Accessory attached to pin 17 - - new SpanAccessory(); - new DEV_Identify("Dimmable LED","HomeSpan","123-ABC","20mA LED","0.9",0); - new DEV_DimmableLED(17); + new SpanAccessory(); + new Service::AccessoryInformation(); + new Characteristic::Identify(); + new Characteristic::Name("Dimmable LED"); + new DEV_DimmableLED(17); } // end of setup() diff --git a/examples/09-MessageLogging/DEV_Identify.h b/examples/09-MessageLogging/DEV_Identify.h deleted file mode 100644 index b8d21d6..0000000 --- a/examples/09-MessageLogging/DEV_Identify.h +++ /dev/null @@ -1,38 +0,0 @@ - -////////////////////////////////// -// DEVICE-SPECIFIC SERVICES // -////////////////////////////////// - -struct DEV_Identify : Service::AccessoryInformation { - - int nBlinks; // number of times to blink built-in LED in identify routine - SpanCharacteristic *identify; // reference to the Identify Characteristic - - DEV_Identify(const char *name, const char *manu, const char *sn, const char *model, const char *version, int nBlinks) : Service::AccessoryInformation(){ - - new Characteristic::Name(name); // create all the required Characteristics with values set based on above arguments - new Characteristic::Manufacturer(manu); - new Characteristic::SerialNumber(sn); - new Characteristic::Model(model); - new Characteristic::FirmwareRevision(version); - identify=new Characteristic::Identify(); // store a reference to the Identify Characteristic for use below - - this->nBlinks=nBlinks; // store the number of times to blink the LED - - pinMode(homeSpan.getStatusPin(),OUTPUT); // make sure LED is set for output - } - - boolean update(){ - - for(int i=0;inBlinks=nBlinks; // store the number of times to blink the LED - - pinMode(homeSpan.getStatusPin(),OUTPUT); // make sure LED is set for output - } - - boolean update(){ - - for(int i=0;i