Update Reference.md

This commit is contained in:
HomeSpan 2022-04-16 22:55:13 -05:00 committed by GitHub
parent b7e62f86db
commit 1d7d4e3093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

View File

@ -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). 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 ## User-Definable Macros
### *#define REQUIRED VERSION(major,minor,patch)* ### *#define REQUIRED VERSION(major,minor,patch)*