tool/CommandConfig.cpp
changeset 1804 742607c464c4
parent 1526 66edd310830c
child 1826 ec6223c3b7ec
equal deleted inserted replaced
1803:5b04770444df 1804:742607c464c4
    47 string CommandConfig::helpString() const
    47 string CommandConfig::helpString() const
    48 {
    48 {
    49     stringstream str;
    49     stringstream str;
    50 
    50 
    51     str << getName() << " [OPTIONS]" << endl
    51     str << getName() << " [OPTIONS]" << endl
    52     	<< endl
    52         << endl
    53     	<< getBriefDescription() << endl
    53         << getBriefDescription() << endl
    54     	<< endl
    54         << endl
    55     	<< "Without the --verbose option, slave configurations are" << endl
    55         << "Without the --verbose option, slave configurations are" << endl
    56     	<< "output one-per-line. Example:" << endl
    56         << "output one-per-line. Example:" << endl
    57     	<< endl
    57         << endl
    58     	<< "1001:0  0x0000003b/0x02010000  3  OP" << endl
    58         << "1001:0  0x0000003b/0x02010000  3  OP" << endl
    59     	<< "|       |                      |  |" << endl
    59         << "|       |                      |  |" << endl
    60     	<< "|       |                      |  \\- Application-layer" << endl
    60         << "|       |                      |  \\- Application-layer" << endl
    61     	<< "|       |                      |     state of the attached" << endl
    61         << "|       |                      |     state of the attached" << endl
    62     	<< "|       |                      |     slave, or '-', if no" << endl
    62         << "|       |                      |     slave, or '-', if no" << endl
    63     	<< "|       |                      |     slave is attached." << endl
    63         << "|       |                      |     slave is attached." << endl
    64     	<< "|       |                      \\- Absolute decimal ring" << endl
    64         << "|       |                      \\- Absolute decimal ring" << endl
    65     	<< "|       |                         position of the attached" << endl
    65         << "|       |                         position of the attached" << endl
    66     	<< "|       |                         slave, or '-' if none" << endl
    66         << "|       |                         slave, or '-' if none" << endl
    67     	<< "|       |                         attached." << endl
    67         << "|       |                         attached." << endl
    68     	<< "|       \\- Expected vendor ID and product code (both" << endl
    68         << "|       \\- Expected vendor ID and product code (both" << endl
    69     	<< "|          hexadecimal)." << endl
    69         << "|          hexadecimal)." << endl
    70     	<< "\\- Alias address and relative position (both decimal)." << endl
    70         << "\\- Alias address and relative position (both decimal)." << endl
    71     	<< endl
    71         << endl
    72     	<< "With the --verbose option given, the configured PDOs and" << endl
    72         << "With the --verbose option given, the configured PDOs and" << endl
    73     	<< "SDOs are output in addition." << endl
    73         << "SDOs are output in addition." << endl
    74         << endl
    74         << endl
    75         << "Configuration selection:" << endl
    75         << "Configuration selection:" << endl
    76         << "  Slave configurations can be selected with" << endl
    76         << "  Slave configurations can be selected with" << endl
    77         << "  the --alias and --position parameters as follows:" << endl
    77         << "  the --alias and --position parameters as follows:" << endl
    78         << endl
    78         << endl
    84         << "     configurations with the given alias address" << endl
    84         << "     configurations with the given alias address" << endl
    85         << "     are displayed." << endl
    85         << "     are displayed." << endl
    86         << "  4) If both the --alias and the --position option are" << endl
    86         << "  4) If both the --alias and the --position option are" << endl
    87         << "     given, the selection can match a single" << endl
    87         << "     given, the selection can match a single" << endl
    88         << "     configuration, that is displayed, if it exists." << endl
    88         << "     configuration, that is displayed, if it exists." << endl
    89     	<< endl
    89         << endl
    90     	<< "Command-specific options:" << endl
    90         << "Command-specific options:" << endl
    91         << "  --alias    -a <alias>  Configuration alias (see above)." << endl
    91         << "  --alias    -a <alias>  Configuration alias (see above)." << endl
    92         << "  --position -p <pos>    Relative position (see above)." << endl
    92         << "  --position -p <pos>    Relative position (see above)." << endl
    93     	<< "  --verbose  -v          Show detailed configurations." << endl
    93         << "  --verbose  -v          Show detailed configurations." << endl
    94         << endl
    94         << endl
    95         << numericInfo();
    95         << numericInfo();
    96 
    96 
    97 	return str.str();
    97     return str.str();
    98 }
    98 }
    99 
    99 
   100 /*****************************************************************************/
   100 /*****************************************************************************/
   101 
   101 
   102 /** Lists the bus configuration.
   102 /** Lists the bus configuration.
   124 /*****************************************************************************/
   124 /*****************************************************************************/
   125 
   125 
   126 /** Lists the complete bus configuration.
   126 /** Lists the complete bus configuration.
   127  */
   127  */
   128 void CommandConfig::showDetailedConfigs(
   128 void CommandConfig::showDetailedConfigs(
   129 		MasterDevice &m,
   129         MasterDevice &m,
   130 		const ConfigList &configList
   130         const ConfigList &configList
   131 		)
   131         )
   132 {
   132 {
   133     ConfigList::const_iterator configIter;
   133     ConfigList::const_iterator configIter;
   134     unsigned int i, j, k, l;
   134     unsigned int i, j, k, l;
   135     ec_ioctl_slave_t slave;
   135     ec_ioctl_slave_t slave;
   136     ec_ioctl_config_pdo_t pdo;
   136     ec_ioctl_config_pdo_t pdo;