MCPcopy Create free account
hub / github.com/HomeSpan/HomeSpan / SpanCharacteristic

Method SpanCharacteristic

src/HomeSpan.cpp:2198–2218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2196///////////////////////////////
2197
2198SpanCharacteristic::SpanCharacteristic(HapChar *hapChar, boolean isCustom){
2199
2200 type=hapChar->type;
2201 perms=hapChar->perms;
2202 hapName=hapChar->hapName;
2203 format=hapChar->format;
2204 staticRange=hapChar->staticRange;
2205 this->isCustom=isCustom;
2206 this->hapChar=hapChar;
2207
2208 if(homeSpan.Accessories.empty() || homeSpan.Accessories.back()->Services.empty()){
2209 LOG0("\nFATAL ERROR! Can't create new Characteristic '%s' without a defined Service ***\n",hapName);
2210 LOG0("\n=== PROGRAM HALTED ===");
2211 while(1);
2212 }
2213
2214 homeSpan.Accessories.back()->Services.back()->Characteristics.push_back(this);
2215 iid=++(homeSpan.Accessories.back()->iidCount);
2216 service=homeSpan.Accessories.back()->Services.back();
2217 aid=homeSpan.Accessories.back()->aid;
2218}
2219
2220///////////////////////////////
2221

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected