return FAILURE;
}
for (i = 0; i < params_cnt; i++) {
- if (sscanf(token, "%x", &tmp_params[i]) == EOF) { // No number found
+ if (sscanf(token, "%i", &tmp_params[i]) == EOF) { // No number found
return FAILURE;
}
if ((token = strtok(NULL, " ")) == NULL && i < params_cnt-1) { // Not enough parameters in the string
cmd_des_t const cmd_des_fr_user_config={
0, 0,
"frbtconfig*","Set the user configuration parameters",
- "=== Command syntax ===\n"
+ "=== Command syntax ===\n"
"\n"
" frbtconfig<TYPE> <PARAMS>\n"
"where\n"
- "* <TYPE> is a string specifying the type of parameters to be set. It can be: \"cluster\", \"node\", \"stat\", \"fifo\" or \"dyn\"\n"
- "* <PARAMS> is a sequence of hexadecimal numbers separated by spaces. Each number stands for one parameter.\n"
+ "* <TYPE> is a string specifying the type of parameters to be set. It can be: \"cluster\", \"node\", or \"fifo\",\n"
+ "* <PARAMS> is a sequence of numbers separated by spaces. Each number stands for one parameter.\n"
"\n"
"=== Description ===\n"
"\n"
"The command takes the configuration parameters in the form of a string\n"
"and sets the appropriate type of the FlexRay parameters. It is\n"
- "necessary to configure parameters of at least cluster, node and one\n"
- "static buffer. The parameters set by this command are applied by\n"
- "the frbtinit command. Once frbtinit is called, it is no longer\n"
- "possible to change the parameters.\n"
+ "necessary to configure parameters of at least cluster, and node and\n"
+ "one static buffer (see frbtcfgbuf command). The parameters set by this\n"
+ "command are applied by the frbtinitU command. Once frbtinit is called,\n"
+ "it is no longer possible to change the parameters.\n"
"\n"
"The type of the parameters can be selected by the <TYPE> selector.\n"
"\n"
"* 27) syncFramePayloadMultiplexEnabled\n"
"* 28) secureBuffers (0 - FR_SB_RECONFIG_ENABLED, 1 - FR_SB_STAT_REC_DISABLED_STAT_TR_DISABLED, 2 - FR_SB_ALL_REC_DISABLED, 3 - FR_SB_ALL_REC_DISABLED_STAT_TR_DISABLED)\n"
"\n"
- "Type \"stat\" adds a configuration for a new static segment buffer. At\n"
- "least one buffer must be configured. A sequence of 8 parameters is\n"
- "expected in this order:\n"
- "* 1) channel (0 - A, 1 - B, 2 - AB)\n"
- "* 2) cycleCounterFiltering\n"
- "* 3) isTx\n"
- "* 4) maxPayload (number of 16b words)\n"
- "* 5) msgBufferInterrupt\n"
- "* 6) payloadPreambleIndicatorTr\n"
- "* 7) singleTransmit\n"
- "* 8) slotId\n"
- "\n"
- "Type \"dyn\" adds a configuration for a new dynamic segment buffer. No\n"
- "dynamic segment buffer is obligatory. It expects a sequence of 8\n"
- "parameters in this order:\n"
- "* 1) channel (0 - A, 1 - B)\n"
- "* 2) cycleCounterFiltering\n"
- "* 3) isTx\n"
- "* 4) maxPayload (number of 16b words)\n"
- "* 5) msgBufferInterrupt\n"
- "* 6) payloadPreambleIndicatorTr\n"
- "* 7) singleTransmit\n"
- "* 8) slotId\n"
- "\n"
"Type \"fifo\" adds a configuration of a new FIFO buffer. No FIFO\n"
"buffer is obligatory. It expects a sequence of 7 parameters in this\n"
"order:\n"
" --> frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C\n"
" FlexRay cluster configuration accepted.\n"
" --> frbtconfignode 0x0 0x0 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0\n"
- " FlexRay node configuration accepted.\n"
- " --> frbtconfigstat 0x2 0x0 0x1 0x9 0x1 0x0 0x0 0x1\n"
- " Static buffer configuration accepted.\n",
+ " FlexRay node configuration accepted.\n",
CMD_HANDLER(cmd_do_fr_user_config), (void *)&cmd_list_fr_basic_test
};
"frbtcfgbuf?*","Configure a message buffer in the user configuration",
"=== Command syntax ===\n"
"\n"
- " frbtcfgbuf<S|D|F><NUM> slot<SLOT>\n"
+ " frbtcfgbuf<TYPE><NUM> slot<SLOT> <CHN> cyc<CYC> <RXTX> max<MAX> <REP> ppi<PPI> int<INT>\n"
"where\n"
- "* <TYPE> is a string specifying the type of parameters to be set. It can be: \"cluster\", \"node\", \"stat\", \"fifo\" or \"dyn\"\n"
- "* <PARAMS> is a sequence of hexadecimal numbers separated by spaces. Each number stands for one parameter.\n"
+ "* <TYPE> is 'S' for static segment buffers and 'D' for dynamic segment buffers,\n"
+ "* <NUM> is the number of the buffer. Both static and dynamic buffers are numbered independently starting from zero,\n"
+ "* <SLOT> is the number of the slot,\n"
+ "* <CHN> is one of 'A', 'B' or 'AB' and identifies the used channel,\n"
+ "* <CYC> is the cycle set when to send the buffer,\n"
+ "* <RXTX> is either string \"rx\" or \"tx\",\n"
+ "* <MAX> is the number determining the maximum payload (in hald-words),\n"
+ "* <REP> is a string \"s\" or \"single\" for single transmission or \"c\" or \"continuous\" for continuous transmission,\n"
+ "* <PPI> is 0 or 1 determining whether the payload preamble indicator is set,\n"
+ "* <INT> is 0 or 1 add is currently ignored.\n"
"\n"
"=== Description ===\n"
"\n"
- "The command takes the configuration parameters in the form of a string\n"
- "and sets the appropriate type of the FlexRay parameters. It is\n"
- "necessary to configure parameters of at least cluster, node and one\n"
- "static buffer. The parameters set by this command are applied by\n"
- "the frbtinit command. Once frbtinit is called, it is no longer\n"
- "possible to change the parameters.\n"
- "\n"
- "The type of the parameters can be selected by the <TYPE> selector.\n"
- "\n"
- "Type \"cluster\" sets global FlexRay network parameters. It expects a\n"
- "sequence of 25 parameters in this order:\n"
- "* 1) gColdStartAttempts\n"
- "* 2) gListenNoise\n"
- "* 3) gMacroPerCycle\n"
- "* 4) gMaxWithoutClockCorrectionFatal\n"
- "* 5) gMaxWithoutClockCorrectionPassive\n"
- "* 6) gNetworkManagementVectorLength\n"
- "* 7) gNumberOfMinislots\n"
- "* 8) gNumberOfStaticSlots\n"
- "* 9) gOffsetCorrectionStart\n"
- "* 10) gPayloadLengthStatic\n"
- "* 11) gSyncNodeMax\n"
- "* 12) gdActionPointOffset\n"
- "* 13) gdCASRxLowMax\n"
- "* 14) gdDynamicSlotIdlePhase\n"
- "* 15) gdMinislot\n"
- "* 16) gdMinislotActionPointOffset\n"
- "* 17) gdNIT\n"
- "* 18) gdSampleClockPeriod\n"
- "* 19) gdStaticSlot\n"
- "* 20) gdTSSTransmitter\n"
- "* 21) gdWakeupSymbolRxIdle\n"
- "* 22) gdWakeupSymbolRxLow\n"
- "* 23) gdWakeupSymbolRxWindow\n"
- "* 24) gdWakeupSymbolTxIdle\n"
- "* 25) gdWakeupSymbolTxLow\n"
- "\n"
- "Type \"node\" sets local FlexRay network parameters. It expects a\n"
- "sequence of 28 parameters in this order:\n"
- "* 1) pAllowHaltDueToClock\n"
- "* 2) pAllowPassiveToActive\n"
- "* 3) pChannels (0 - A, 1 - B, 2 - AB)\n"
- "* 4) pClusterDriftDamping\n"
- "* 5) pDelayCompensationA\n"
- "* 6) pDelayCompensationB\n"
- "* 7) pExternOffsetCorrection\n"
- "* 8) pExternRateCorrection\n"
- "* 9) pKeySlotUsedForStartup\n"
- "* 10) pKeySlotUsedForSync\n"
- "* 11) pLatestTx\n"
- "* 12) pMacroInitialOffsetA\n"
- "* 13) pMacroInitialOffsetB\n"
- "* 14) pMicroInitialOffsetA\n"
- "* 15) pMicroInitialOffsetB\n"
- "* 16) pMicroPerCycle\n"
- "* 17) pRateCorrectionOut\n"
- "* 18) pOffsetCorrectionOut\n"
- "* 19) pSamplesPerMicrotick\n"
- "* 20) pSingleSlotEnabled\n"
- "* 21) pWakeupChannel (0 - A, 1 - B)\n"
- "* 22) pWakeupPattern\n"
- "* 23) pdAcceptedStartupRange\n"
- "* 24) pdListenTimeout\n"
- "* 25) pdMaxDrift\n"
- "* 26) pDecodingCorrection\n"
- "* 27) syncFramePayloadMultiplexEnabled\n"
- "* 28) secureBuffers (0 - FR_SB_RECONFIG_ENABLED, 1 - FR_SB_STAT_REC_DISABLED_STAT_TR_DISABLED, 2 - FR_SB_ALL_REC_DISABLED, 3 - FR_SB_ALL_REC_DISABLED_STAT_TR_DISABLED)\n"
- "\n"
- "Type \"stat\" adds a configuration for a new static segment buffer. At\n"
- "least one buffer must be configured. A sequence of 8 parameters is\n"
- "expected in this order:\n"
- "* 1) channel (0 - A, 1 - B, 2 - AB)\n"
- "* 2) cycleCounterFiltering\n"
- "* 3) isTx\n"
- "* 4) maxPayload (number of 16b words)\n"
- "* 5) msgBufferInterrupt\n"
- "* 6) payloadPreambleIndicatorTr\n"
- "* 7) singleTransmit\n"
- "* 8) slotId\n"
- "\n"
- "Type \"dyn\" adds a configuration for a new dynamic segment buffer. No\n"
- "dynamic segment buffer is obligatory. It expects a sequence of 8\n"
- "parameters in this order:\n"
- "* 1) channel (0 - A, 1 - B)\n"
- "* 2) cycleCounterFiltering\n"
- "* 3) isTx\n"
- "* 4) maxPayload (number of 16b words)\n"
- "* 5) msgBufferInterrupt\n"
- "* 6) payloadPreambleIndicatorTr\n"
- "* 7) singleTransmit\n"
- "* 8) slotId\n"
- "\n"
- "Type \"fifo\" adds a configuration of a new FIFO buffer. No FIFO\n"
- "buffer is obligatory. It expects a sequence of 7 parameters in this\n"
- "order:\n"
- "*1) depth of the FIFO\n"
- "*2) channel (0 - A, 1 - B, 2 - AB)\n"
- "*3) cycleCounterFiltering\n"
- "*4) maxPayload (number of 16b words)\n"
- "*5) rejectNullFrames\n"
- "*6) rejectStaticSegment\n"
- "*7) slotId\n"
+ "The command sets the configuration parameters for static or dynamic\n"
+ "buffers in user configuration. The parameters set by this command are\n"
+ "applied by the frbtinitU command. Once frbtinit is called, it is no\n"
+ "longer possible to change the parameters.\n"
"\n"
"=== Example ===\n"
"\n"
- " --> frbtconfigcluster 0x2 0xF 0x15E0 0xF 0xF 0xC 0x15A 0x8 0xAE4 0x9 0xF 0x4 0x43 0x1 0x4 0x2 0xAE3 0x0 0x56 0xA 0x12 0x12 0x4C 0xB4 0x3C\n"
- " FlexRay cluster configuration accepted.\n"
- " --> frbtconfignode 0x0 0x0 0x2 0x1 0x3 0x3 0x0 0x0 0x1 0x1 0x10D 0x6 0x6 0x18 0x18 0x36B00 0xCD 0x151 0x0 0x1 0x0 0x2 0x81 0x36DA2 0x151 0x33 0x0 0x0\n"
- " FlexRay node configuration accepted.\n"
- " --> frbtconfigstat 0x2 0x0 0x1 0x9 0x1 0x0 0x0 0x1\n"
- " Static buffer configuration accepted.\n",
+ " --> frbtcfgbufS0 slot2 AB cyc0 tx max9 continous ppi0 int1\n"
+ " frbtcfgbufS0 slot2 AB cyc0 tx max9 continous ppi0 int1\n"
+ " --> frbtcfgbufS1 slot1 AB cyc0 rx max9 continuous ppi0 int1\n"
+ " frbtcfgbufS1 slot1 AB cyc0 rx max9 continuous ppi0 int1\n"
+ " --> frbtcfgbufD0 slot9 A cyc0 rx max0x40 single ppi0 int0\n"
+ " frbtcfgbufD0 slot9 A cyc0 rx max64 single ppi0 int0\n"
+ " --> frbtcfgbufD1 slot10 A cyc0 tx max0x40 single ppi0 int0\n"
+ " frbtcfgbufD1 slot10 A cyc0 tx max64 single ppi0 int0\n",
CMD_HANDLER(cmd_do_fr_config_bufer), (void *)&cmd_list_fr_basic_test
};