diff --git a/src/HomeSpan.cpp b/src/HomeSpan.cpp index 10319b8..af81875 100644 --- a/src/HomeSpan.cpp +++ b/src/HomeSpan.cpp @@ -933,6 +933,20 @@ SpanService::SpanService(const char *type, ServiceType mod){ /////////////////////////////// +SpanService *SpanService::setPrimary(){ + primary=true; + return(this); +} + +/////////////////////////////// + +SpanService *SpanService::setHidden(){ + hidden=true; + return(this); +} + +/////////////////////////////// + int SpanService::sprintfAttributes(char *cBuf){ int nBytes=0; diff --git a/src/HomeSpan.h b/src/HomeSpan.h index c8f1d13..9e066d7 100644 --- a/src/HomeSpan.h +++ b/src/HomeSpan.h @@ -115,6 +115,9 @@ struct SpanService{ SpanService(const char *type, ServiceType mod=ServiceType::Regular); + SpanService *setPrimary(); // sets the Service Type to be primary and returns pointer to self + SpanService *setHidden(); // sets the Service Type to be hidden and returns pointer to self + int sprintfAttributes(char *cBuf); // prints Service JSON records into buf; return number of characters printed, excluding null terminator virtual StatusCode update() {return(StatusCode::OK);} // update Service and return final statusCode based on updated Characteristics - should be overridden by DEVICE-SPECIFIC Services virtual void event(){} // event generation for Services that create their own events and need to notify HomeKit of a new Characteristic value(s)