Refs #335. Added XCP Connection Mode configuration setting to LibOpenBLT and BootCommander.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@366 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2017-09-18 21:31:22 +00:00
parent 75c8698a55
commit 0e707de0ec
8 changed files with 23 additions and 4 deletions

Binary file not shown.

View File

@ -467,6 +467,8 @@ static void DisplayProgramUsage(void)
printf(" -t7=[timeout] Busy wait timer timeout in milliseconds as a 16-bit\n");
printf(" value (Default = 2000 ms).\n");
printf(" -sk=[file] Seed/key algorithm library filename (Optional).\n");
printf(" -cm=[value] Connection mode value sent in the XCP connect command,\n");
printf(" as a 8-bit value (Default=0).\n");
printf("\n");
printf("XCP on RS232 settings (xcp_rs232):\n");
printf(" -d=[name] Name of the communication device. For example COM1 or\n");
@ -563,6 +565,7 @@ static void DisplaySessionInfo(uint32_t sessionType, void const * sessionSetting
{
printf("None\n");
}
printf(" -> Connection mode: %hhu\n", xcpSettings->connectMode);
}
break;
}
@ -832,7 +835,8 @@ static void * ExtractSessionSettingsFromCommandLine(int argc, char const * const
* -t4=[timeout] -> Erase memory timeout in milliseconds.
* -t5=[timeout] -> Program memory and reset timeout in milliseconds.
* -t7=[timeout] -> Busy wait timer timeout in milliseconds.
* -sk=[file] -> Seed/key algorithm library filename.
* -sk=[file] -> Seed/key algorithm library filename.
* -cm=[value] -> Connection mode parameter in XCP connect command.
*/
/* Allocate memory for storing the settings and check the result. */
result = malloc(sizeof(tBltSessionSettingsXcpV10));
@ -848,6 +852,7 @@ static void * ExtractSessionSettingsFromCommandLine(int argc, char const * const
xcpSettings->timeoutT5 = 1000;
xcpSettings->timeoutT7 = 2000;
xcpSettings->seedKeyFile = NULL;
xcpSettings->connectMode = 0;
/* 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.
*/
@ -907,6 +912,15 @@ static void * ExtractSessionSettingsFromCommandLine(int argc, char const * const
/* Continue with next loop iteration. */
continue;
}
/* Is this the -cm=[value] parameter? */
if ( (strstr(argv[paramIdx], "-cm=") != NULL) &&
(strlen(argv[paramIdx]) > 4) )
{
/* Extract the connection mode value. */
sscanf(&argv[paramIdx][4], "%hhu", &(xcpSettings->connectMode));
/* Continue with next loop iteration. */
continue;
}
}
}
break;

View File

@ -137,6 +137,7 @@ LIBOPENBLT_EXPORT void BltSessionInit(uint32_t sessionType,
xcpLoaderSettings.timeoutT4 = bltSessionSettingsXcpV10Ptr->timeoutT4;
xcpLoaderSettings.timeoutT5 = bltSessionSettingsXcpV10Ptr->timeoutT5;
xcpLoaderSettings.timeoutT7 = bltSessionSettingsXcpV10Ptr->timeoutT7;
xcpLoaderSettings.connectMode = bltSessionSettingsXcpV10Ptr->connectMode;
xcpLoaderSettings.transport = NULL;
xcpLoaderSettings.transportSettings = NULL;
/* Link the correct transport layer. */

View File

@ -116,6 +116,7 @@ typedef struct t_blt_session_settings_xcp_v10
uint16_t timeoutT5; /**< Program memory and reset timeout in milliseonds. */
uint16_t timeoutT7; /**< Busy wait timer timeout in milliseonds. */
char const * seedKeyFile; /**< Seed/key algorithm library filename. */
uint8_t connectMode; /**< Connection mode parameter in XCP connect command.*/
} tBltSessionSettingsXcpV10;
/** \brief Structure layout of the XCP version 1.0 RS232 transport layer settings. The

View File

@ -82,7 +82,8 @@ type
timeoutT4: Word; // Erase memory timeout in milliseonds.
timeoutT5: Word; // Program memory and reset timeout in milliseonds.
timeoutT7: Word; // Busy wait timer timeout in milliseonds.
seedKeyFile: PAnsiChar; // Seed/key algorithm library filename.
seedKeyFile: PAnsiChar; // Seed/key algorithm library filename.
connectMode: Byte; // Connection mode parameter in XCP connect command.
end;
// Structure layout of the XCP version 1.0 RS232 transport layer settings.

View File

@ -529,7 +529,7 @@ static bool XcpLoaderSendCmdConnect(void)
result = true;
/* Prepare the command packet. */
cmdPacket.data[0] = XCPLOADER_CMD_CONNECT;
cmdPacket.data[1] = 0; /* normal mode */
cmdPacket.data[1] = xcpSettings.connectMode;
cmdPacket.len = 2;
/* Send the packet. */
if (!xcpSettings.transport->SendPacket(&cmdPacket, &resPacket,

View File

@ -91,7 +91,9 @@ typedef struct t_xcp_loader_settings
/** \brief Program memory and reset timeout in milliseonds. */
uint16_t timeoutT5;
/** \brief Busy wait timer timeout in milliseonds. */
uint16_t timeoutT7;
uint16_t timeoutT7;
/** \brief Connection mode used in the XCP connect command. */
uint8_t connectMode;
/** \brief Pointer to the transport layer to use during protocol communications. */
tXcpTransport const * transport;
/** \brief Pointer to the settings for the transport layer. */

Binary file not shown.