MCPcopy Create free account
hub / github.com/OpenZWave/open-zwave / SetProductDetails

Method SetProductDetails

cpp/src/command_classes/ManufacturerSpecific.cpp:176–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176void ManufacturerSpecific::SetProductDetails
177(
178 uint16 manufacturerId,
179 uint16 productType,
180 uint16 productId
181)
182{
183
184 string configPath = "";
185 ProductDescriptor *product = GetDriver()->GetManufacturerSpecificDB()->getProduct(manufacturerId, productType, productId);
186
187 Node *node = GetNodeUnsafe();
188 if (!product) {
189 char str[64];
190 snprintf( str, sizeof(str), "Unknown: id=%.4x", manufacturerId );
191 string manufacturerName = str;
192
193 snprintf( str, sizeof(str), "Unknown: type=%.4x, id=%.4x", productType, productId );
194 string productName = str;
195
196 node->SetManufacturerName( manufacturerName );
197 node->SetProductName( productName );
198 } else {
199 node->SetManufacturerName( product->GetManufacturerName() );
200 node->SetProductName( product->GetProductName() );
201 node->SetProductDetails(product);
202 }
203
204 node->SetManufacturerId( manufacturerId );
205
206 node->SetProductType( productType );
207
208 node->SetProductId( productId );
209
210}
211
212
213//-----------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 9

getProductMethod · 0.80
SetManufacturerNameMethod · 0.80
SetProductNameMethod · 0.80
SetManufacturerIdMethod · 0.80
SetProductTypeMethod · 0.80
GetManufacturerNameMethod · 0.45
GetProductNameMethod · 0.45
SetProductIdMethod · 0.45

Tested by

no test coverage detected