tool/CommandDownload.cpp
changeset 1334 da3d22a27500
parent 1327 4d179b06dd3c
child 1363 11c0b2caa253
equal deleted inserted replaced
1333:7b9898062c8f 1334:da3d22a27500
    34 		<< "--type option. If the slave does not support the SDO" << endl
    34 		<< "--type option. If the slave does not support the SDO" << endl
    35 		<< "information service or the SDO is not in the dictionary," << endl
    35 		<< "information service or the SDO is not in the dictionary," << endl
    36 		<< "the --type option is mandatory." << endl
    36 		<< "the --type option is mandatory." << endl
    37     	<< endl
    37     	<< endl
    38     	<< "These are the valid SDO entry data types:" << endl
    38     	<< "These are the valid SDO entry data types:" << endl
    39     	<< "  int8, int16, int32, uint8, uint16, uint32, string." << endl
    39     	<< "  int8, int16, int32, uint8, uint16, uint32, string," << endl
       
    40         << "  octet_string." << endl
    40     	<< endl
    41     	<< endl
    41     	<< "Arguments:" << endl
    42     	<< "Arguments:" << endl
    42     	<< "  INDEX    is the SDO index and must be an unsigned" << endl
    43     	<< "  INDEX    is the SDO index and must be an unsigned" << endl
    43 		<< "           16 bit number." << endl
    44 		<< "           16 bit number." << endl
    44     	<< "  SUBINDEX is the SDO entry subindex and must be an" << endl
    45     	<< "  SUBINDEX is the SDO entry subindex and must be an" << endl
   181                     strValue >> val;
   182                     strValue >> val;
   182                     *(uint32_t *) data.data = cpu_to_le32(val);
   183                     *(uint32_t *) data.data = cpu_to_le32(val);
   183                     break;
   184                     break;
   184                 }
   185                 }
   185             case 0x0009: // string
   186             case 0x0009: // string
       
   187                 if (strValue.str().size() >= data.data_size) {
       
   188                     err << "String too large";
       
   189                     throwCommandException(err);
       
   190                 }
       
   191                 data.data_size = strValue.str().size();
       
   192                 strValue >> (char *) data.data;
       
   193                 break;
       
   194             case 0x000a: // octet_string
   186                 if (strValue.str().size() >= data.data_size) {
   195                 if (strValue.str().size() >= data.data_size) {
   187                     err << "String too large";
   196                     err << "String too large";
   188                     throwCommandException(err);
   197                     throwCommandException(err);
   189                 }
   198                 }
   190                 data.data_size = strValue.str().size();
   199                 data.data_size = strValue.str().size();