mirror of https://github.com/rusefi/openblt.git
Refs #514. Fixed typo in BootCommander help text.
git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@460 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
parent
6616dcf71e
commit
e4b06890a4
|
@ -496,10 +496,10 @@ static void DisplayProgramUsage(void)
|
|||
printf(" Supported values: 1000000, 800000, 500000, 250000,\n");
|
||||
printf(" 125000, 100000, 50000, 20000, 10000.\n");
|
||||
printf(" -tid=[value] CAN identifier for transmitting XCP command messages\n");
|
||||
printf(" from the host to the target, as a 32-bit hexadecimal.\n");
|
||||
printf(" from the host to the target, as a 32-bit hexadecimal\n");
|
||||
printf(" value (Default = 667h).\n");
|
||||
printf(" -rid=[value] CAN identifier for receiving XCP response messages\n");
|
||||
printf(" from the target to the host, as a 32-bit hexadecimal.\n");
|
||||
printf(" from the target to the host, as a 32-bit hexadecimal\n");
|
||||
printf(" value (Default = 7E1h).\n");
|
||||
printf(" -xid=[value] Configures the 'tid' and 'rid' CAN identifier values\n");
|
||||
printf(" as 29-bit CAN identifiers, if this 8-bit value is > 0\n");
|
||||
|
@ -1131,85 +1131,85 @@ static void * ExtractTransportSettingsFromCommandLine(int argc,
|
|||
* -rid=[value] -> Receive CAN identifier (32-bit hexadecimal).
|
||||
* -xid=[value] -> Flag for configuring extended CAN identifiers (8-bit).
|
||||
*/
|
||||
/* Allocate memory for storing the settings and check the result. */
|
||||
result = malloc(sizeof(tBltTransportSettingsXcpV10Can));
|
||||
assert(result != NULL);
|
||||
if (result != NULL) /*lint !e774 */
|
||||
{
|
||||
/* Create typed pointer for easy reading. */
|
||||
tBltTransportSettingsXcpV10Can * canSettings =
|
||||
(tBltTransportSettingsXcpV10Can *)result;
|
||||
/* Set default values. */
|
||||
canSettings->deviceName = NULL;
|
||||
canSettings->deviceChannel = 0;
|
||||
canSettings->baudrate = 500000;
|
||||
canSettings->transmitId = 0x667;
|
||||
canSettings->receiveId = 0x7E1;
|
||||
canSettings->useExtended = false;
|
||||
/* Loop through all the command line parameters, just skip the 1st one because
|
||||
* this is the name of the program, which we are not interested in.
|
||||
*/
|
||||
for (paramIdx = 1; paramIdx < argc; paramIdx++)
|
||||
{
|
||||
/* Is this the -d=[name] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-d=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 3) )
|
||||
{
|
||||
/* Store the pointer to the device name. */
|
||||
canSettings->deviceName = &argv[paramIdx][3];
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -c=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-c=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 3) )
|
||||
{
|
||||
/* Extract the channel index value. */
|
||||
sscanf(&argv[paramIdx][3], "%u", &(canSettings->deviceChannel));
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -b=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-b=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 3) )
|
||||
{
|
||||
/* Extract the baudrate value. */
|
||||
sscanf(&argv[paramIdx][3], "%u", &(canSettings->baudrate));
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -tid=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-tid=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 5) )
|
||||
{
|
||||
/* Extract the hexadecimal transmit CAN identifier value. */
|
||||
sscanf(&argv[paramIdx][5], "%x", &(canSettings->transmitId));
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -rid=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-rid=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 5) )
|
||||
{
|
||||
/* Extract the hexadecimal receive CAN identifier value. */
|
||||
sscanf(&argv[paramIdx][5], "%x", &(canSettings->receiveId));
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -xid=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-xid=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 5) )
|
||||
{
|
||||
/* Extract the extended CAN identifier configuration value. */
|
||||
static uint8_t xidValue;
|
||||
sscanf(&argv[paramIdx][5], "%hhu", &xidValue);
|
||||
/* Convert to boolean. */
|
||||
canSettings->useExtended = ((xidValue > 0) ? true : false);
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Allocate memory for storing the settings and check the result. */
|
||||
result = malloc(sizeof(tBltTransportSettingsXcpV10Can));
|
||||
assert(result != NULL);
|
||||
if (result != NULL) /*lint !e774 */
|
||||
{
|
||||
/* Create typed pointer for easy reading. */
|
||||
tBltTransportSettingsXcpV10Can * canSettings =
|
||||
(tBltTransportSettingsXcpV10Can *)result;
|
||||
/* Set default values. */
|
||||
canSettings->deviceName = NULL;
|
||||
canSettings->deviceChannel = 0;
|
||||
canSettings->baudrate = 500000;
|
||||
canSettings->transmitId = 0x667;
|
||||
canSettings->receiveId = 0x7E1;
|
||||
canSettings->useExtended = false;
|
||||
/* Loop through all the command line parameters, just skip the 1st one because
|
||||
* this is the name of the program, which we are not interested in.
|
||||
*/
|
||||
for (paramIdx = 1; paramIdx < argc; paramIdx++)
|
||||
{
|
||||
/* Is this the -d=[name] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-d=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 3) )
|
||||
{
|
||||
/* Store the pointer to the device name. */
|
||||
canSettings->deviceName = &argv[paramIdx][3];
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -c=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-c=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 3) )
|
||||
{
|
||||
/* Extract the channel index value. */
|
||||
sscanf(&argv[paramIdx][3], "%u", &(canSettings->deviceChannel));
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -b=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-b=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 3) )
|
||||
{
|
||||
/* Extract the baudrate value. */
|
||||
sscanf(&argv[paramIdx][3], "%u", &(canSettings->baudrate));
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -tid=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-tid=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 5) )
|
||||
{
|
||||
/* Extract the hexadecimal transmit CAN identifier value. */
|
||||
sscanf(&argv[paramIdx][5], "%x", &(canSettings->transmitId));
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -rid=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-rid=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 5) )
|
||||
{
|
||||
/* Extract the hexadecimal receive CAN identifier value. */
|
||||
sscanf(&argv[paramIdx][5], "%x", &(canSettings->receiveId));
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
/* Is this the -xid=[value] parameter? */
|
||||
if ( (strstr(argv[paramIdx], "-xid=") != NULL) &&
|
||||
(strlen(argv[paramIdx]) > 5) )
|
||||
{
|
||||
/* Extract the extended CAN identifier configuration value. */
|
||||
static uint8_t xidValue;
|
||||
sscanf(&argv[paramIdx][5], "%hhu", &xidValue);
|
||||
/* Convert to boolean. */
|
||||
canSettings->useExtended = ((xidValue > 0) ? true : false);
|
||||
/* Continue with next loop iteration. */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
/* -------------------------- XCP on USB --------------------------------------- */
|
||||
case BLT_TRANSPORT_XCP_V10_USB:
|
||||
|
|
Loading…
Reference in New Issue