diff --git a/docs/Reference.md b/docs/Reference.md index 04f3763..0738d1f 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -422,6 +422,19 @@ Custom Services may contain a mix of both Custom Characteristics and standard HA A fully worked example showing how to use both the ***CUSTOM_SERV()*** and ***CUSTOM_CHAR()*** macros to create a Pressure Sensor Accessory that is recognized by *Eve for HomeKit* can be found in the Arduino IDE under [*File → Examples → HomeSpan → Other Examples → CustomService*](../Other%20Examples/CustomService). +## Other Macros + +### *SPAN_ACCESSORY()* and *SPAN_ACCESSORY(NAME)* + +A "convenience" macro that implements the following very common code snippet used when creating Accessories. The last line is only included if *NAME* (a c-style string) has been included as an argument to the macro: + +```C++ +new SpanAccessory(); + new Service::AccessoryInformation(); + new Characteristic::Identify(); + new Characteristic::Name(NAME); // included only in the second form of the macro +``` + ## User-Definable Macros ### *#define REQUIRED VERSION(major,minor,patch)*