From 929ff22980f7187567c09f7c01bc898cf3a68a2d Mon Sep 17 00:00:00 2001 From: Uwe Seimet Date: Fri, 27 Aug 2021 18:26:05 +0200 Subject: [PATCH] Updated protobuf interface to signal parameter support --- src/raspberrypi/rascsi.cpp | 6 ++++-- src/raspberrypi/rascsi_interface.proto | 6 ++++-- src/raspberrypi/rasctl.cpp | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index 617dd9b5..58c536de 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -559,16 +559,16 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo) } types_properties = serverInfo.add_types_properties(); - properties = types_properties->add_properties(); types_properties->set_type(SCMO); + properties = types_properties->add_properties(); properties->set_protectable(true); properties->set_removable(true); properties->set_lockable(true); properties->set_supports_file(true); types_properties = serverInfo.add_types_properties(); - properties = types_properties->add_properties(); types_properties->set_type(SCCD); + properties = types_properties->add_properties(); properties->set_read_only(true); properties->set_removable(true); properties->set_lockable(true); @@ -579,6 +579,8 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo) types_properties = serverInfo.add_types_properties(); types_properties->set_type(SCDP); + properties = types_properties->add_properties(); + properties->set_supports_params(true); } void GetAvailableImages(PbServerInfo& serverInfo) diff --git a/src/raspberrypi/rascsi_interface.proto b/src/raspberrypi/rascsi_interface.proto index c13934d1..45489bda 100644 --- a/src/raspberrypi/rascsi_interface.proto +++ b/src/raspberrypi/rascsi_interface.proto @@ -59,10 +59,12 @@ message PbDeviceProperties { bool removable = 3; // Medium can be locked bool lockable = 4; - // Device supports image file + // Device supports image file as a parameter 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 - repeated uint32 block_sizes = 6; + repeated uint32 block_sizes = 7; } // The status of a device diff --git a/src/raspberrypi/rasctl.cpp b/src/raspberrypi/rasctl.cpp index 0d349fee..85cb0d56 100644 --- a/src/raspberrypi/rasctl.cpp +++ b/src/raspberrypi/rasctl.cpp @@ -243,6 +243,9 @@ void CommandServerInfo(const string& hostname, int port) if (properties.supports_file()) { cout << (has_property ? ", " : "") << "Image file support"; } + else if (properties.supports_params()) { + cout << (has_property ? ", " : "") << "Parameter support"; + } cout << endl; for (int k = 0 ; k < properties.block_sizes_size(); k++)