Fixed issue with missing method in old Raspberry Pi OS protobuf implementation

This commit is contained in:
Uwe Seimet 2021-08-29 16:52:43 +02:00
parent 502b19bfb2
commit 67d73da898

View File

@ -536,8 +536,9 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo)
PbDeviceProperties *properties = new PbDeviceProperties(); PbDeviceProperties *properties = new PbDeviceProperties();
types_properties->set_allocated_properties(properties); types_properties->set_allocated_properties(properties);
properties->set_supports_file(true); properties->set_supports_file(true);
auto block_sizes = device_factory.GetSasiSectorSizes(); for (const auto& block_size : device_factory.GetSasiSectorSizes()) {
properties->mutable_block_sizes()->Add(block_sizes.begin(), block_sizes.end()); properties->add_block_sizes(block_size);
}
types_properties = serverInfo.add_types_properties(); types_properties = serverInfo.add_types_properties();
types_properties->set_type(SCHD); types_properties->set_type(SCHD);
@ -545,8 +546,9 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo)
types_properties->set_allocated_properties(properties); types_properties->set_allocated_properties(properties);
properties->set_protectable(true); properties->set_protectable(true);
properties->set_supports_file(true); properties->set_supports_file(true);
block_sizes = device_factory.GetScsiSectorSizes(); for (const auto& block_size : device_factory.GetScsiSectorSizes()) {
properties->mutable_block_sizes()->Add(block_sizes.begin(), block_sizes.end()); properties->add_block_sizes(block_size);
}
types_properties = serverInfo.add_types_properties(); types_properties = serverInfo.add_types_properties();
types_properties->set_type(SCRM); types_properties->set_type(SCRM);
@ -556,7 +558,9 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo)
properties->set_removable(true); properties->set_removable(true);
properties->set_lockable(true); properties->set_lockable(true);
properties->set_supports_file(true); properties->set_supports_file(true);
properties->mutable_block_sizes()->Add(block_sizes.begin(), block_sizes.end()); for (const auto& block_size : device_factory.GetScsiSectorSizes()) {
properties->add_block_sizes(block_size);
}
types_properties = serverInfo.add_types_properties(); types_properties = serverInfo.add_types_properties();
types_properties->set_type(SCMO); types_properties->set_type(SCMO);
@ -566,8 +570,9 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo)
properties->set_removable(true); properties->set_removable(true);
properties->set_lockable(true); properties->set_lockable(true);
properties->set_supports_file(true); properties->set_supports_file(true);
auto capacities = device_factory.GetMoCapacities(); for (const auto& capacity : device_factory.GetMoCapacities()) {
properties->mutable_capacities()->Add(capacities.begin(), capacities.end()); properties->add_capacities(capacity);
}
types_properties = serverInfo.add_types_properties(); types_properties = serverInfo.add_types_properties();
types_properties->set_type(SCCD); types_properties->set_type(SCCD);