Example #1
0
std::string hw::PCI_Device::to_string() const {
  std::stringstream str;
  str << PCI::classcode_str(classcode()) << ", "
      << PCI::vendor_str((PCI::vendor_t)vendor_id())
      << std::hex << " ("<< vendor_id() << " / " << product_id() << ")";
  return str.str();
};
 void update_device_identifiers(void) {
   device_identifiers_ = std::make_shared<device_identifiers>(
       vendor_id_.value_or(vendor_id(0)),
       product_id_.value_or(product_id(0)),
       is_keyboard_.value_or(false),
       is_pointing_device_.value_or(false));
 }
std::string hw::PCI_Device::to_string() const {
  char buffer[512];
  int len = snprintf(buffer, sizeof(buffer),
          "%s %s (V %#x / P %#x)",
          PCI::classcode_str(classcode()),
          PCI::vendor_str((PCI::vendor_t)vendor_id()),
          vendor_id(), product_id());
  return std::string(buffer, len);
}