From 45e7c60dd118957ee5f237bcf952dfcc8639ef02 Mon Sep 17 00:00:00 2001 From: HomeSpan Date: Tue, 16 Feb 2021 07:01:34 -0600 Subject: [PATCH] Update Reference.md --- docs/Reference.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/Reference.md b/docs/Reference.md index 5383fbb..d6a36d3 100644 --- a/docs/Reference.md +++ b/docs/Reference.md @@ -118,13 +118,16 @@ This is a **base class** from which all HomeSpan Services are derived, and shoul The following methods are supported: * `SpanService *setPrimary()` - * specifies that this is the primary Service for the Accessory. Returns a pointer to the Service itself so that the method can be chained during instantiation. Example: `new Service::Fan->setPrimary();` + * specifies that this is the primary Service for the Accessory. Returns a pointer to the Service itself so that the method can be chained during instantiation. + * example: `(new Service::Fan)->setPrimary();` * `SpanService *setHidden()` * specifies that this is hidden Service for the Accessory. Returns a pointer to the Service itself so that the method can be chained during instantiation. * `SpanService *addLink(SpanService *svc)` - * adds *svc* as a Linked Service. Returns a pointer to the calling Service itself so that the method can be chained during instantiation. Note Linked Services are only applicable for select HAP Services. See Apple's [HAP-R2](https://developer.apple.com/support/homekit-accessory-protocol/) documentation for full details. + * adds *svc* as a Linked Service. Returns a pointer to the calling Service itself so that the method can be chained during instantiation. + * note that Linked Services are only applicable for select HAP Services. See Apple's [HAP-R2](https://developer.apple.com/support/homekit-accessory-protocol/) documentation for full details. + * example: `(new Service::Faucet)->addLink(new Service::Valve)->addLink(new Service::Valve);` (links two Valves to a Faucet) * `virtual boolean update()` * HomeSpan calls this method upon receiving a request from a HomeKit Controller to update one or more Characteristics associated with the Service. Users should override this method with code that implements that requested updates using one or more of the SpanCharacteristic methods below. Method **must** return *true* if update succeeds, or *false* if not.