diff --git a/src/raspberrypi/rascsi.cpp b/src/raspberrypi/rascsi.cpp index e79c8924..21d97b44 100644 --- a/src/raspberrypi/rascsi.cpp +++ b/src/raspberrypi/rascsi.cpp @@ -552,26 +552,26 @@ void GetDeviceTypeFeatures(PbServerInfo& serverInfo) properties->set_supports_file(true); types_properties = serverInfo.add_types_properties(); - types_properties->add_block_sizes(512); - types_properties->add_block_sizes(1024); - types_properties->add_block_sizes(2048); - types_properties->add_block_sizes(4096); - properties = types_properties->add_properties(); types_properties->set_type(SCHD); + properties = types_properties->add_properties(); properties->set_protectable(true); properties->set_supports_file(true); + properties->add_block_sizes(512); + properties->add_block_sizes(1024); + properties->add_block_sizes(2048); + properties->add_block_sizes(4096); types_properties = serverInfo.add_types_properties(); - types_properties->add_block_sizes(512); - types_properties->add_block_sizes(1024); - types_properties->add_block_sizes(2048); - types_properties->add_block_sizes(4096); - properties = types_properties->add_properties(); types_properties->set_type(SCRM); + properties = types_properties->add_properties(); properties->set_protectable(true); properties->set_removable(true); properties->set_lockable(true); properties->set_supports_file(true); + properties->add_block_sizes(512); + properties->add_block_sizes(1024); + properties->add_block_sizes(2048); + properties->add_block_sizes(4096); types_properties = serverInfo.add_types_properties(); properties = types_properties->add_properties(); diff --git a/src/raspberrypi/rascsi_interface.proto b/src/raspberrypi/rascsi_interface.proto index fde30f6f..7eb772b3 100644 --- a/src/raspberrypi/rascsi_interface.proto +++ b/src/raspberrypi/rascsi_interface.proto @@ -61,6 +61,8 @@ message PbDeviceProperties { bool lockable = 4; // Device supports image file bool supports_file = 5; + // List of supported block sizes + repeated uint32 block_sizes = 6; } // The status of a device @@ -77,8 +79,6 @@ message PbDeviceStatus { message PbDeviceTypeProperties { PbDeviceType type = 1; repeated PbDeviceProperties properties = 2; - // List of supported block sizes - repeated uint32 block_sizes = 3; } // The image file data diff --git a/src/raspberrypi/rasctl.cpp b/src/raspberrypi/rasctl.cpp index 655a53b5..2cde7f24 100644 --- a/src/raspberrypi/rasctl.cpp +++ b/src/raspberrypi/rasctl.cpp @@ -218,6 +218,8 @@ void CommandServerInfo(const string& hostname, int port) PbDeviceTypeProperties types_properties = serverInfo.types_properties(i); cout << " " << PbDeviceType_Name(types_properties.type()); + vector block_sizes; + cout << " Properties: "; if (types_properties.properties_size()) { for (int j = 0; j < types_properties.properties_size(); j++) { @@ -244,22 +246,27 @@ void CommandServerInfo(const string& hostname, int port) cout << (has_property ? ", " : "") << "Image file support"; } cout << endl; + + for (int k = 0 ; k < properties.block_sizes_size(); k++) + { + block_sizes.push_back(properties.block_sizes(i)); + } } } else { cout << "None" << endl; } - if (!types_properties.block_sizes_size()) { + if (block_sizes.empty()) { cout << " Block size is not configurable" << endl; } else { cout << " Configurable block sizes: "; - for (int j = 0; j < types_properties.block_sizes_size(); j++) { + for (size_t j = 0; j < block_sizes.size(); j++) { if (j) { cout << ", "; } - cout << types_properties.block_sizes(j); + cout << block_sizes.at(j); } cout << endl; }