diff --git a/src/extras/extras.ino b/src/extras/extras.ino new file mode 100644 index 0000000..8d8b76d --- /dev/null +++ b/src/extras/extras.ino @@ -0,0 +1,5 @@ + +#error THIS IS NOT COMPILABLE CODE + +This is a dummy .ino file that allows you to easily edit the contents of this library using the Arduino IDE. +The code is NOT designed to be compiled from this point. Compile and test the library using one of the examples. diff --git a/src/src.ino b/src/src.ino new file mode 100644 index 0000000..752b002 --- /dev/null +++ b/src/src.ino @@ -0,0 +1,39 @@ + +// This is a placeholder .ino file that allows you to easily edit the contents of this library using the Arduino IDE, +// as well as compile and test from this point. This file is ignored when the library is included in other sketches. + +#include "HomeSpan.h" + +void setup() { + + Serial.begin(115200); + + homeSpan.setLogLevel(2); + + homeSpan.begin(Category::Lighting,"HomeSpan Benchmark"); + + new SpanAccessory(); // Begin by creating a new Accessory using SpanAccessory(), which takes no arguments + + new Service::AccessoryInformation(); // HAP requires every Accessory to implement an AccessoryInformation Service, which has 6 required Characteristics + new Characteristic::Name("HomeSpan Test"); // Name of the Accessory, which shows up on the HomeKit "tiles", and should be unique across Accessories + new Characteristic::Manufacturer("HomeSpan"); // Manufacturer of the Accessory (arbitrary text string, and can be the same for every Accessory) + new Characteristic::SerialNumber("HSL-123"); // Serial Number of the Accessory (arbitrary text string, and can be the same for every Accessory) + new Characteristic::Model("HSL Test"); // Model of the Accessory (arbitrary text string, and can be the same for every Accessory) + new Characteristic::FirmwareRevision(HOMESPAN_VERSION); // Firmware of the Accessory (arbitrary text string, and can be the same for every Accessory) + new Characteristic::Identify(); // Create the required Identify + + new Service::HAPProtocolInformation(); // Create the HAP Protcol Information Service + new Characteristic::Version("1.1.0"); // Set the Version Characteristic to "1.1.0" as required by HAP + + new Service::LightBulb(); // Create the Light Bulb Service + new Characteristic::On(); // This Service requires the "On" Characteristic to turn the light on and off + +} // end of setup() + +////////////////////////////////////// + +void loop(){ + + homeSpan.poll(); + +} // end of loop()