| 131 | } |
| 132 | |
| 133 | void DevicePrivate::initializeHash() |
| 134 | { |
| 135 | Hash hash; |
| 136 | const std::string vendor_id = _device_id.getVendorID(); |
| 137 | const std::string product_id = _device_id.getProductID(); |
| 138 | |
| 139 | if (vendor_id.empty() || product_id.empty()) { |
| 140 | throw Exception("Device hash initialization", numberToString(getID()), "vendor and/or product id values not available"); |
| 141 | } |
| 142 | |
| 143 | /* |
| 144 | * Hash name, device id and serial number fields. |
| 145 | */ |
| 146 | for (const std::string& field : { |
| 147 | _name, vendor_id, product_id, _serial_number |
| 148 | }) { |
| 149 | hash.update(field); |
| 150 | } |
| 151 | _hash = std::move(hash); |
| 152 | } |
| 153 | |
| 154 | void DevicePrivate::updateHash(std::istream& descriptor_stream, const size_t expected_size) |
| 155 | { |
nothing calls this directly
no test coverage detected