Updated protobuf interface to signal parameter support

This commit is contained in:
Uwe Seimet 2021-08-27 18:26:05 +02:00
parent 5d207f7aca
commit 929ff22980
3 changed files with 11 additions and 4 deletions

View File

@ -559,16 +559,16 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo)
} }
types_properties = serverInfo.add_types_properties(); types_properties = serverInfo.add_types_properties();
properties = types_properties->add_properties();
types_properties->set_type(SCMO); types_properties->set_type(SCMO);
properties = types_properties->add_properties();
properties->set_protectable(true); properties->set_protectable(true);
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);
types_properties = serverInfo.add_types_properties(); types_properties = serverInfo.add_types_properties();
properties = types_properties->add_properties();
types_properties->set_type(SCCD); types_properties->set_type(SCCD);
properties = types_properties->add_properties();
properties->set_read_only(true); properties->set_read_only(true);
properties->set_removable(true); properties->set_removable(true);
properties->set_lockable(true); properties->set_lockable(true);
@ -579,6 +579,8 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo)
types_properties = serverInfo.add_types_properties(); types_properties = serverInfo.add_types_properties();
types_properties->set_type(SCDP); types_properties->set_type(SCDP);
properties = types_properties->add_properties();
properties->set_supports_params(true);
} }
void GetAvailableImages(PbServerInfo& serverInfo) void GetAvailableImages(PbServerInfo& serverInfo)

View File

@ -59,10 +59,12 @@ message PbDeviceProperties {
bool removable = 3; bool removable = 3;
// Medium can be locked // Medium can be locked
bool lockable = 4; bool lockable = 4;
// Device supports image file // Device supports image file as a parameter
bool supports_file = 5; bool supports_file = 5;
// Device supports parameters other than a filename
bool supports_params = 6;
// Unordered list of supported block sizes, empty if the block size is not configurable // Unordered list of supported block sizes, empty if the block size is not configurable
repeated uint32 block_sizes = 6; repeated uint32 block_sizes = 7;
} }
// The status of a device // The status of a device

View File

@ -243,6 +243,9 @@ void CommandServerInfo(const string& hostname, int port)
if (properties.supports_file()) { if (properties.supports_file()) {
cout << (has_property ? ", " : "") << "Image file support"; cout << (has_property ? ", " : "") << "Image file support";
} }
else if (properties.supports_params()) {
cout << (has_property ? ", " : "") << "Parameter support";
}
cout << endl; cout << endl;
for (int k = 0 ; k < properties.block_sizes_size(); k++) for (int k = 0 ; k < properties.block_sizes_size(); k++)