int cmd_do_fr_transmittxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
{
int8_t retVal = ERR_PARAM_NO_ERROR;
- uint32_t slotID;
+ uint32_t bufferID;
uint8_t dataLength;
int values[MAX_PARAM_VALUES_NUM];
uint8_t data[MAX_PARAM_VALUES_NUM];
char *token = NULL;
- if (sscanf(param[1], "%d", &slotID) != 1)
+ if (sscanf(param[1], "%d", &bufferID) != 1)
return -CMDERR_BADPAR;
if (sscanf(param[2], " %2x", &values[0]) != 1)
return -CMDERR_BADPAR;
dataLength++;
}
- retVal = rpp_fr_transmit_lpdu(0, slotID, data, dataLength);
+ retVal = rpp_fr_transmit_lpdu(0, bufferID, data, dataLength);
if (retVal == SUCCESS)
rpp_sci_printf("Data were set for transmission.\r\n");
else {
int cmd_do_fr_canceltxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
{
int8_t retVal = ERR_PARAM_NO_ERROR;
- uint32_t slotID;
+ uint32_t bufferID;
- if (sscanf(param[1], "%d", &slotID) != 1)
+ if (sscanf(param[1], "%d", &bufferID) != 1)
return -CMDERR_BADPAR;
if (param[2] != NULL)
return -CMDERR_BADPAR;
- retVal = rpp_fr_cancel_transmit_lpdu(0, slotID);
+ retVal = rpp_fr_cancel_transmit_lpdu(0, bufferID);
if (retVal == SUCCESS)
rpp_sci_printf("Transmission canceled.\r\n");
else {
int cmd_do_fr_receiverxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
{
int8_t retVal = ERR_PARAM_NO_ERROR;
- uint32_t slotID;
+ uint32_t bufferID;
uint8_t data[cPayloadLengthMax];
Fr_RxLPduStatusType status;
uint8_t receivedLength = 0;
uint8_t i;
- if (sscanf(param[1], "%d", &slotID) != 1)
+ if (sscanf(param[1], "%d", &bufferID) != 1)
return -CMDERR_BADPAR;
if (param[2] != NULL)
return -CMDERR_BADPAR;
memset(data, 0, sizeof(data));
- retVal = rpp_fr_receive_lpdu(0, slotID, data, &status, &receivedLength);
+ retVal = rpp_fr_receive_lpdu(0, bufferID, data, &status, &receivedLength);
if (retVal == SUCCESS) {
switch (status) {
case FR_RECEIVED_MORE_DATA_AVAILABLE:
int cmd_do_fr_checktxlpdustatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
{
int8_t retVal = ERR_PARAM_NO_ERROR;
- uint32_t slotID;
+ uint32_t bufferID;
Fr_TxLPduStatusType status;
char *statusStrings[] = {"is not", "is"};
- if (sscanf(param[1], "%d", &slotID) != 1)
+ if (sscanf(param[1], "%d", &bufferID) != 1)
return -CMDERR_BADPAR;
if (param[2] != NULL)
return -CMDERR_BADPAR;
- retVal = rpp_fr_check_tx_lpdu_status(0, slotID, &status);
+ retVal = rpp_fr_check_tx_lpdu_status(0, bufferID, &status);
if (retVal == SUCCESS)
rpp_sci_printf("Message transmission %s pending.\r\n", statusStrings[status]);
else {
int cmd_do_fr_disablelpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
{
int8_t retVal = ERR_PARAM_NO_ERROR;
- uint32_t slotID;
+ uint32_t bufferID;
- if (sscanf(param[1], "%d", &slotID) != 1)
+ if (sscanf(param[1], "%d", &bufferID) != 1)
return -CMDERR_BADPAR;
if (param[2] != NULL)
return -CMDERR_BADPAR;
- retVal = rpp_fr_disable_lpdu(0, slotID);
+ retVal = rpp_fr_disable_lpdu(0, bufferID);
if (retVal == SUCCESS)
rpp_sci_printf("Buffer disabled.\r\n");
else {
{
int ret;
char channel[3];
- unsigned id, slot, maxpayload, cycleset, cycleoffset;
+ unsigned bufferID, slot, maxpayload, cycleset, cycleoffset;
Fr_TMS570LS_BufferConfigType tmp_buffer;
boolean_t is_pow2;
uint8_t pow2;
ret = sscanf(param[2], "id%i slot%i %2s cycset%i cycoffset%i max%i",
- &id,
+ &bufferID,
&slot,
channel,
&cycleset,
return -CMDERR_BADPAR;
}
- if (slot > 2047 || id > 2047)
+ if (slot > 2047 || bufferID > FR_MAX_BUFFERS_CNT)
return badpar("Invalid slot number\n");
tmp_buffer.slotId = slot;
if (strcmp(channel, "A") == 0) tmp_buffer.channel = FR_CHANNEL_A;
return badpar("Maximum payload in bytes must be less than 256\n");
tmp_buffer.maxPayload = maxpayload;
- if (rpp_fr_reconfigure_lpdu(0, id, tmp_buffer.slotId, tmp_buffer.channel, cycleset, cycleoffset, tmp_buffer.maxPayload, 0) == SUCCESS) {
+ if (rpp_fr_reconfigure_lpdu(0, bufferID, tmp_buffer.slotId, tmp_buffer.channel, cycleset, cycleoffset, tmp_buffer.maxPayload, 0) == SUCCESS) {
printf("id%i slot%i %2s cycset%i cycoffset%i max%i\n",
- id,
+ bufferID,
slot,
channel,
cycleset,
"frbtcfgbuf?*","Configure a message buffer in the user configuration",
"### Command syntax ###\n"
"\n"
- " frbtcfgbuf<TYPE><NUM> slot<SLOT> <CHN> cyc<CYC> <RXTX> max<MAX> <REP> ppi<PPI> int<INT>\n"
+ " frbtcfgbuf<TYPE><BUFID> slot<SLOT> <CHN> cyc<CYC> <RXTX> max<MAX> <REP> ppi<PPI> int<INT>\n"
"where\n"
"\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"
+ "- `<BUFID>` 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"
"\n"
"The command should be called after the frbtinit command.\n"
"\n"
+ "You may also want to call frbtallslots command to allow the communication\n"
+ "for all other slots besides the key slots.\n"
+ "\n"
"### Example ###\n"
"\n"
" --> frbtstart\n"
/** Command descriptor for FlexRay transmit tx lpdu command */
cmd_des_t const cmd_des_fr_transmittxlpdu = {
0, 0,
- "frbttransmit*","Transmit data in selected frame",
+ "frbttransmit*","Transmit data from the selected frame buffer",
"### Command syntax ###\n"
"\n"
- " frbttransmit<FRID> <DATA>\n"
+ " frbttransmit<BUFID> <DATA>\n"
"where\n"
"\n"
- "- `<FRID>` is a decimal number specifying the ID of the frame for which a buffer has been configured.\n"
- "- `<DATA>` is a sequence of hexadecimal numbers separated by spaces. Each number represents one byte of the message.\n"
+ "- `<BUFID>` is a decimal number specifying the ID of the frame\n"
+ " buffer configured for data transmission\n"
+ "- `<DATA>` is a sequence of hexadecimal numbers separated by spaces.\n"
+ " Each number represents one byte of the message.\n"
"\n"
"### Description ###\n"
"\n"
"The command stands for Fr_TransmitTxLPdu function from the Autosar\n"
- "specification. The command finds the first buffer assigned to the\n"
- "specified frame ID and copies the given data into its data section in\n"
- "the message RAM. Transmit request is set after the data are copied, so\n"
- "transmission starts at the next occurrence of the frame in the\n"
+ "specification. The command copies the given data into the buffers data\n"
+ "section in the message RAM. Transmit request is set after the data are\n"
+ "copied, so transmission starts at the next occurrence of the frame in the\n"
"communication cycle.\n"
"\n"
"### Example ###\n"
/** Command descriptor for FlexRay cancel tx lpdu command */
cmd_des_t const cmd_des_fr_canceltxlpdu = {
0, 0,
- "frbtcanceltx*","Stop the transmission of the frame",
+ "frbtcanceltx*","Stop the transmission from the frame buffer",
"### Command syntax ###\n"
"\n"
- " frbtcanceltx<FRID>\n"
+ " frbtcanceltx<BUFID>\n"
"\n"
- "where `<FRID>` is a decimal number specifying the ID of the frame for\n"
- "which a buffer has been configured.\n"
+ "where `<BUFID>` is a decimal number specifying the ID of a configured\n"
+ "frame buffer\n"
"\n"
"### Description ###\n"
"\n"
"The command stands for Fr_CancelTxLPdu function from the Autosar\n"
- "specification. The command finds all buffers assigned to the specified\n"
- "frame ID and reconfigures them to stop transmitting data. The command\n"
- "finishes successfully only if reconfiguration is allowed in message\n"
- "RAM configuration (secureBuffers configuration parameter). Only TX\n"
- "buffers and buffers not used for startup frames can be canceled.\n"
+ "specification. The command reconfigures the selected buffer to stop\n"
+ "data transmission. The command finishes successfully only if the\n"
+ "reconfiguration is allowed in message RAM configuration (secureBuffers\n"
+ "configuration parameter). Only TX buffers and buffers not used for startup\n"
+ "frames can be canceled.\n"
"\n"
"### Example ###\n"
"\n"
"frbtreceive*","Receive a new message",
"### Command syntax ###\n"
"\n"
- " frbtreceive<FRID>\n"
+ " frbtreceive<BUFID>\n"
"\n"
- "where `<FRID>` is a decimal number specifying the ID of the frame for\n"
- "which a buffer was configured.\n"
+ "where `<BUFID>` is a decimal number specifying the ID of a configured\n"
+ "frame buffer.\n"
"\n"
"### Description ###\n"
"\n"
"The command stands for Fr_ReceiveRxLPdu function from the Autosar\n"
- "specification. The command finds the first buffer assigned to the\n"
- "specified frame ID, determines if a new message has been received and\n"
- "reads it out of the buffer. If no message was received, \"No message\n"
- "received\" is printed. If a new message was received, all message data\n"
- "are printed as a hexadecimal values. If a new message was retrieved\n"
- "from a FIFO buffer and more messages are available in it, \"More\n"
- "messages are still in FIFO\" is printed.\n"
+ "specification. The command tries to read a new message from the selected\n"
+ "buffer. If new message is available, it is copied out of the buffer and\n"
+ "printed. If no message is available, \"No message received\" is printed.\n"
+ "If a new message was retrieved from a FIFO buffer and more messages are\n"
+ "available in it, \"More messages are still in FIFO\" is printed.\n"
"\n"
"### Example ###\n"
"\n"
" --> frbtreceive0\n"
" More messages are still in FIFO:\n"
" Received message (32 B):\n"
- " ee ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n",
+ " ee ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\n"
+ " 00 00 00 00 00 00 00 00 00\n",
CMD_HANDLER(cmd_do_fr_receiverxlpdu), (void *)&cmd_list_fr_basic_test
};
"frbtchecktx*","Print the status of the transmit buffer",
"### Command syntax ###\n"
"\n"
- " frbtchecktx<FRID>\n"
+ " frbtchecktx<BUFID>\n"
"\n"
- "where `<FRID>` is a decimal number specifying the ID of the frame for\n"
- "which a buffer has been configured.\n"
+ "where `<BUFID>` is a decimal number specifying the ID of a configured\n"
+ "frame buffer.\n"
"\n"
"### Description ###\n"
"\n"
"The command stands for Fr_CheckTxLPduStatus function from the Autosar\n"
- "specification. The command finds the first buffer assigned to the\n"
- "specified frame ID, reads its status and prints it. The buffer can be\n"
- "in one of the two states:\n"
+ "specification. The command reads and prints status of the selected frame buffer.\n"
+ "The buffer can be in one of the two states:\n"
"\n"
- "- Message transmission is pending, which means that the buffer has not yet sent its message in single shot mode or that it is in continuous mode.\n"
- "- No message transmission is pending, which means that the buffer is in single shot mode and the message has already been sent.\n"
+ "- Message transmission is pending, which means that the buffer has not yet sent its\n"
+ " message in single shot mode or that it is in continuous mode.\n"
+ "- No message transmission is pending, which means that the buffer is in single shot\n"
+ " mode and the message has already been sent.\n"
"\n"
"### Example ###\n"
"\n"
"frbtdisable*","Disable the buffers assigned to the frame",
"### Command syntax ###\n"
"\n"
- " frbtdisable<FRID>\n"
+ " frbtdisable<BUFID>\n"
"\n"
- "where `<FRID>` is a decimal number specifying the ID of a frame. The\n"
- "buffers configure for this frame will be disabled.\n"
+ "where `<BUFID>` is a decimal number specifying the ID of a frame buffer.\n"
+ "The buffer configured will be disabled.\n"
"\n"
"### Description ###\n"
"\n"
"The command stands for Fr_DisableLPdu function from the Autosar\n"
- "specification. The command finds all buffers assigned to the specified\n"
- "frame ID and disables them. This means that those buffers will be\n"
- "unavailable for the communication until their reconfiguration (which\n"
- "is not yet implemented). Buffers used for startup frames and FIFO RX\n"
- "buffers cannot be disabled.\n"
+ "specification. The command disables the selected buffer. This means\n"
+ "that this buffer will be unavailable for the communication until\n"
+ "their reconfiguration (which is not yet implemented). Buffers used\n"
+ "for startup frames and FIFO RX buffers cannot be disabled.\n"
"\n"
"### Example ###\n"
"\n"
"frbtreconfigurebuf*","Reconfigure a buffer to communicate in another slot",
"### Command syntax ###\n"
"\n"
- " frbtreconfigurebuf id<ID> slot<SLOT> <CHN> cycset<CYCS> cycoffset<CYCO> max<MAX>\n"
+ " frbtreconfigurebuf id<BUFID> slot<SLOT> <CHN> cycset<CYCS> cycoffset<CYCO> max<MAX>\n"
"where\n"
"\n"
- "- `<ID>` is a number specifying a slot, where the buffer is currently communicating,\n"
+ "- `<BUFID>` is a number specifying a slot, where the buffer is currently communicating,\n"
"- `<SLOT>` is a number, where buffer will be communicating after the reconfiguration,\n"
"- `<CHN>` is one of 'A', 'B' or 'AB' and identifies the used channel,\n"
"- `<CYCS>` is the cycle set. It has to be one of 0, 1, 2, 4, 8, 16, 32, 64. It specifies together with `<CYCO>` the cycle filtering.\n"