Added getLinks() method to SpanServices
This returns a vector of linked Services that can be used in a for-each loop as such:
for(auto services : getLinks()){ ... }
Must cast services into specific Service type to access anything not generic to the SpanService class
This commit is contained in:
parent
3f833beb74
commit
fcf715d874
|
|
@ -225,6 +225,7 @@ struct SpanService{
|
|||
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
|
||||
SpanService *addLink(SpanService *svc); // adds svc as a Linked Service and returns pointer to self
|
||||
vector<SpanService *> getLinks(){return(linkedServices);} // returns linkedServices vector for use as range in "for-each" loops
|
||||
|
||||
int sprintfAttributes(char *cBuf); // prints Service JSON records into buf; return number of characters printed, excluding null terminator
|
||||
void validate(); // error-checks Service
|
||||
|
|
@ -238,7 +239,6 @@ struct SpanService{
|
|||
|
||||
struct SpanCharacteristic{
|
||||
|
||||
|
||||
union UVal {
|
||||
BOOL_t BOOL;
|
||||
UINT8_t UINT8;
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ void setup() {
|
|||
new Characteristic::Name("Light 3");
|
||||
new Characteristic::TargetPosition();
|
||||
new Characteristic::OzoneDensity();
|
||||
(new Characteristic::OzoneDensity())->addPerms(PW+AA)->removePerms(EV+PR);
|
||||
(new Characteristic::OzoneDensity())->addPerms(PW|AA)->removePerms(EV|PR);
|
||||
|
||||
} // end of setup()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue