Added validation check to ensure AccessoryInformation is always the first Service to be defined in an Accessory

Required by HAP (overlooked in original error-checking logic)
This commit is contained in:
Gregg 2020-12-27 12:47:03 -06:00
parent 69057d560a
commit a1035bd911
1 changed files with 9 additions and 1 deletions

View File

@ -1167,7 +1167,15 @@ SpanService::SpanService(const char *type, const char *hapName){
homeSpan.Accessories.back()->Services.push_back(this);
iid=++(homeSpan.Accessories.back()->iidCount);
homeSpan.configLog+=+"-" + String(iid) + String(" (") + String(type) + String(")\n");
homeSpan.configLog+="-" + String(iid) + String(" (") + String(type) + String(") ");
if(!strcmp(this->type,"3E") && iid!=1){
homeSpan.configLog+=" *** ERROR! The AccessoryInformation Service must be defined before any other Services in an Accessory. ***";
homeSpan.nFatalErrors++;
}
homeSpan.configLog+="\n";
}
///////////////////////////////