]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/blobdiff - rpp-test-sw/commands/cmd_fr_basic_test.c
Update library
[pes-rpp/rpp-test-sw.git] / rpp-test-sw / commands / cmd_fr_basic_test.c
index 0c16fd52cbd10a3a49896ac2dd018b5cab5304f3..9c9fccca9b879c4d34eb5fbcdfa79e4c6edc7f47 100644 (file)
@@ -6,18 +6,10 @@
  * Authors:
  *     - Michal Horn
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ * This document contains proprietary information belonging to Czech
+ * Technical University in Prague. Passing on and copying of this
+ * document, and communication of its contents is not permitted
+ * without prior written authorization.
  *
  * File : cmd_fr_basic_test.c
  *
@@ -36,9 +28,7 @@
 
 #include <string.h>
 #include "cmdproc_utils.h"
-#include "drv/drv.h"
 #include "rpp/rpp.h"
-#include "hal/hal.h"
 #include "stdio.h"
 
 #define printf rpp_sci_printf
@@ -62,7 +52,7 @@ static boolean_t fr_initialized = FALSE;
 static Fr_TMS570LS_ClusterConfigType Fr_cluster_config = {
        .gColdStartAttempts = 0x2,
        .gListenNoise = 0xF,
-       .gMacroPerCycle = 0x15E0,       // (cycle period, 5.6us)
+       .gMacroPerCycle = 0x15E0,   // (cycle period, 5.6us)
        .gMaxWithoutClockCorrectionFatal = 0xF,
        .gMaxWithoutClockCorrectionPassive = 0xF,
        .gNetworkManagementVectorLength = 12,
@@ -77,7 +67,7 @@ static Fr_TMS570LS_ClusterConfigType Fr_cluster_config = {
        .gdMinislot = 0x4,
        .gdMinislotActionPointOffset = 0x2,
        .gdNIT = 0xAE3,
-       .gdSampleClockPeriod = 0,               // 10mbit/sec
+       .gdSampleClockPeriod = 0,       // 10mbit/sec
        .gdStaticSlot = 0x56,
        .gdTSSTransmitter = 0xA,
        .gdWakeupSymbolRxIdle = 18,
@@ -112,7 +102,7 @@ static Fr_TMS570LS_NodeConfigType Fr_node_A_config = {
        .pMicroPerCycle = 0x36B00,
        .pRateCorrectionOut = 0xCD,
        .pOffsetCorrectionOut = 0x151,
-       .pSamplesPerMicrotick = 0,              // 10 mbit/sec
+       .pSamplesPerMicrotick = 0,      // 10 mbit/sec
        .pSingleSlotEnabled = TRUE,
        .pWakeupChannel = FR_CHANNEL_A,
        .pWakeupPattern = 2,
@@ -129,32 +119,32 @@ static Fr_TMS570LS_NodeConfigType Fr_node_A_config = {
  * buffer configuration differs.
  */
 static Fr_TMS570LS_NodeConfigType Fr_node_B_config = {
-               .pAllowHaltDueToClock = 0,
-               .pAllowPassiveToActive = 0xF,
-               .pChannels = FR_CHANNEL_AB,
-               .pClusterDriftDamping = 0x1,
-               .pDelayCompensationA = 0x3,
-               .pDelayCompensationB = 0x3,
-               .pExternOffsetCorrection = 0,
-               .pExternRateCorrection = 0,
-               .pKeySlotUsedForStartup = TRUE,
-               .pKeySlotUsedForSync = TRUE,
-               .pLatestTx = 0x10D,
-               .pMacroInitialOffsetA = 0x6,
-               .pMacroInitialOffsetB = 0x6,
-               .pMicroInitialOffsetA = 0x18,
-               .pMicroInitialOffsetB = 0x18,
-               .pMicroPerCycle = 0x36B00,
-               .pRateCorrectionOut = 0xCD,
-               .pOffsetCorrectionOut = 0x151,
-               .pSamplesPerMicrotick = 0,              // 10 mbit/sec
-               .pSingleSlotEnabled = TRUE,
-               .pWakeupChannel = FR_CHANNEL_A,
-               .pWakeupPattern = 2,
-               .pdAcceptedStartupRange = 0x81,
-               .pdListenTimeout = 0x36DA2,
-               .pdMaxDrift = 0x151,
-               .pDecodingCorrection = 0x33
+       .pAllowHaltDueToClock = 0,
+       .pAllowPassiveToActive = 0xF,
+       .pChannels = FR_CHANNEL_AB,
+       .pClusterDriftDamping = 0x1,
+       .pDelayCompensationA = 0x3,
+       .pDelayCompensationB = 0x3,
+       .pExternOffsetCorrection = 0,
+       .pExternRateCorrection = 0,
+       .pKeySlotUsedForStartup = TRUE,
+       .pKeySlotUsedForSync = TRUE,
+       .pLatestTx = 0x10D,
+       .pMacroInitialOffsetA = 0x6,
+       .pMacroInitialOffsetB = 0x6,
+       .pMicroInitialOffsetA = 0x18,
+       .pMicroInitialOffsetB = 0x18,
+       .pMicroPerCycle = 0x36B00,
+       .pRateCorrectionOut = 0xCD,
+       .pOffsetCorrectionOut = 0x151,
+       .pSamplesPerMicrotick = 0,          // 10 mbit/sec
+       .pSingleSlotEnabled = TRUE,
+       .pWakeupChannel = FR_CHANNEL_A,
+       .pWakeupPattern = 2,
+       .pdAcceptedStartupRange = 0x81,
+       .pdListenTimeout = 0x36DA2,
+       .pdMaxDrift = 0x151,
+       .pDecodingCorrection = 0x33
 };
 
 static Fr_TMS570LS_MsgRAMConfig Fr_node_A_msgRAM_config = {
@@ -475,7 +465,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
                .rejectNullFrames = TRUE,
                .rejectStaticSegment = FALSE,
                .singleTransmit = FALSE,
-               .slotId = 0     // No Frame is rejected
+               .slotId = 0 // No Frame is rejected
        },
        {
                .channel = FR_CHANNEL_AB,
@@ -488,7 +478,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
                .rejectNullFrames = TRUE,
                .rejectStaticSegment = FALSE,
                .singleTransmit = FALSE,
-               .slotId = 0     // No Frame is rejected
+               .slotId = 0 // No Frame is rejected
        },
        {
                .channel = FR_CHANNEL_AB,
@@ -501,7 +491,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
                .rejectNullFrames = TRUE,
                .rejectStaticSegment = FALSE,
                .singleTransmit = FALSE,
-               .slotId = 0     // No Frame is rejected
+               .slotId = 0 // No Frame is rejected
        },
        {
                .channel = FR_CHANNEL_AB,
@@ -514,7 +504,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
                .rejectNullFrames = TRUE,
                .rejectStaticSegment = FALSE,
                .singleTransmit = FALSE,
-               .slotId = 0     // No Frame is rejected
+               .slotId = 0 // No Frame is rejected
        },
        {
                .channel = FR_CHANNEL_AB,
@@ -527,7 +517,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
                .rejectNullFrames = TRUE,
                .rejectStaticSegment = FALSE,
                .singleTransmit = FALSE,
-               .slotId = 0     // No Frame is rejected
+               .slotId = 0 // No Frame is rejected
        }
 };
 
@@ -535,7 +525,7 @@ static Fr_TMS570LS_BufferConfigType Fr_node_B_fifo_buffers_config[] = {
  * This is an unifying configuration structure for the node A.
  * It joins all the configuration structure together.
  */
-static Fr_ConfigType Fr_config_node_A= {
+static Fr_ConfigType Fr_config_node_A = {
        .clusterConfiguration = &Fr_cluster_config,
        .dynamicBufferConfigs = Fr_node_A_dynamic_buffers_config,
        .fifoBufferConfigs = Fr_node_A_fifo_buffers_config,
@@ -548,7 +538,7 @@ static Fr_ConfigType Fr_config_node_A= {
  * This is an unifying configuration structure for the node A.
  * It joins all the configuration structure together.
  */
-static Fr_ConfigType Fr_config_node_B= {
+static Fr_ConfigType Fr_config_node_B = {
        .clusterConfiguration = &Fr_cluster_config,
        .dynamicBufferConfigs = Fr_node_B_dynamic_buffers_config,
        .fifoBufferConfigs = Fr_node_B_fifo_buffers_config,
@@ -572,11 +562,12 @@ static Fr_ConfigType user_configuration = {
        .staticBufferConfigs = user_static_buffer_config,
        .dynamicBufferConfigs = user_dynamic_buffer_config,
        .fifoBufferConfigs = user_fifo_buffer_config,
-};;
+};
+;
 
-#define USER_CONFIG_NOT_DONE           0x0
-#define USER_CONFIG_CLUSTER                    0x1
-#define USER_CONFIG_NODE                       0x2
+#define USER_CONFIG_NOT_DONE        0x0
+#define USER_CONFIG_CLUSTER         0x1
+#define USER_CONFIG_NODE            0x2
 
 static uint8_t user_configuration_state = USER_CONFIG_NOT_DONE;
 static uint8_t user_static_buffer_configured = 0;
@@ -598,36 +589,33 @@ static uint8_t user_fifo_buffer_depth = 0;
  * @return SUCCESS when all parameters were converted to the array of numbers,
  *         FAILURE when the string was too short, too long or some other error occurred.
  */
-static int8_t cmd_fr_parse_params(const char* params, uint32_t params_cnt, uint32_t* tmp_params) {
+static int8_t cmd_fr_parse_params(const char *params, uint32_t params_cnt, uint32_t *tmp_params)
+{
        char cpy_params[256];
-       chartoken;
+       char *token;
        int i;
 
-       if (params == NULL || tmp_params == NULL) {
+       if (params == NULL || tmp_params == NULL)
                return FAILURE;
-       }
        strncpy(cpy_params, params, 256);
        token = strtok(cpy_params, " ");
-       if (token == NULL) {
+       if (token == NULL)
                return FAILURE;
-       }
        for (i = 0; i < params_cnt; i++) {
-               if (sscanf(token, "%i", &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
+               if ((token = strtok(NULL, " ")) == NULL && i < params_cnt-1)    // Not enough parameters in the string
                        return FAILURE;
-               }
        }
        return SUCCESS;
 }
 
-int8_t cmd_fr_config_cluster_params(const char* params) {
+int8_t cmd_fr_config_cluster_params(const char *params)
+{
        uint32_t tmp_params[FR_CLUSTER_PARAMS_CNT];
 
-       if (cmd_fr_parse_params(params, FR_CLUSTER_PARAMS_CNT, tmp_params) == FAILURE) {
+       if (cmd_fr_parse_params(params, FR_CLUSTER_PARAMS_CNT, tmp_params) == FAILURE)
                return FAILURE;
-       }
 
        user_cluster_config.gColdStartAttempts = tmp_params[0];
        user_cluster_config.gListenNoise = tmp_params[1];
@@ -659,14 +647,14 @@ int8_t cmd_fr_config_cluster_params(const char* params) {
        return SUCCESS;
 }
 
-int8_t cmd_fr_config_node_params(const char* params) {
-       uint32_t tmp_params[FR_NODE_PARAMS_CNT+2];      // +2 because two more parameters from message RAM structure are expected in the string.
+int8_t cmd_fr_config_node_params(const char *params)
+{
+       uint32_t tmp_params[FR_NODE_PARAMS_CNT+2];  // +2 because two more parameters from message RAM structure are expected in the string.
        Fr_ChannelType channels[3] = {FR_CHANNEL_A, FR_CHANNEL_B, FR_CHANNEL_AB};
        Fr_TMS570LS_SecureBuffersType secure[4] = {FR_SB_RECONFIG_ENABLED, FR_SB_STAT_REC_DISABLED_STAT_TR_DISABLED, FR_SB_ALL_REC_DISABLED, FR_SB_ALL_REC_DISABLED_STAT_TR_DISABLED};
 
-       if (cmd_fr_parse_params(params, FR_NODE_PARAMS_CNT+2, tmp_params) == FAILURE) {
+       if (cmd_fr_parse_params(params, FR_NODE_PARAMS_CNT+2, tmp_params) == FAILURE)
                return FAILURE;
-       }
 
        user_node_config.pAllowHaltDueToClock = tmp_params[0];
        user_node_config.pAllowPassiveToActive = tmp_params[1];
@@ -704,8 +692,9 @@ int8_t cmd_fr_config_node_params(const char* params) {
        return SUCCESS;
 }
 
-int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
-       Fr_TMS570LS_BufferConfigType* fifo_buffer_ptr = &user_fifo_buffer_config[0];
+int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
+       Fr_TMS570LS_BufferConfigType *fifo_buffer_ptr = &user_fifo_buffer_config[0];
        int ret, i;
        char channel[3], rej_static_frames[8], rej_null_frames[8];
        unsigned depth, slot, cycleset, maxpayload, mask;
@@ -717,15 +706,15 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
        }
 
        ret = sscanf(param[2], "rejslot%i slotmask%i depth%i %2s cyc%i max%i %10s %10s",
-                    &slot,
-                    &mask,
-                    &depth,
-                    channel,
-                    &cycleset,
-                    &maxpayload,
-                    rej_null_frames,
-                    rej_static_frames
-                    );
+                                &slot,
+                                &mask,
+                                &depth,
+                                channel,
+                                &cycleset,
+                                &maxpayload,
+                                rej_null_frames,
+                                rej_static_frames
+                                );
        if (ret != 8) {
                printf("Error parsing parameter %d\n", ret+1);
                return -CMDERR_BADPAR;
@@ -745,7 +734,7 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
        else if (strcmp(channel, "B") == 0) tmp_buffer.channel = FR_CHANNEL_B;
        else if (strcmp(channel, "AB") == 0) tmp_buffer.channel = FR_CHANNEL_AB;
        else return badpar("Channel parsing error\n");
-       
+
        if (cycleset >= 0x80)
                return badpar("Cycle set must be less than 0x80.\n");
        tmp_buffer.cycleCounterFiltering = cycleset;
@@ -753,7 +742,7 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
        if (maxpayload >= 128)
                return badpar("Maximum payload in half-words must be less than 128\n");
        tmp_buffer.maxPayload = maxpayload;
-       
+
        if (strcmp(rej_null_frames, "rejnull") == 0) tmp_buffer.rejectNullFrames = true;
        else if (strcmp(rej_null_frames, "accnull") == 0) tmp_buffer.rejectNullFrames = false;
        else return badpar("Reject/accept NULL frames parsing error\n");
@@ -765,10 +754,10 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
        else return badpar("Invalid reject/accept static frame parameter");
 
        for (i = 0; i < user_fifo_buffer_depth; i++) {
-               fifo_buffer_ptr[i].slotId = tmp_buffer.slotId;  
+               fifo_buffer_ptr[i].slotId = tmp_buffer.slotId;
                fifo_buffer_ptr[i].fidMask = tmp_buffer.fidMask;
                fifo_buffer_ptr[i].maxPayload = tmp_buffer.maxPayload;
-               fifo_buffer_ptr[i].channel= tmp_buffer.channel;
+               fifo_buffer_ptr[i].channel = tmp_buffer.channel;
                fifo_buffer_ptr[i].cycleCounterFiltering = tmp_buffer.cycleCounterFiltering;
                fifo_buffer_ptr[i].isTx = FALSE;
                fifo_buffer_ptr[i].singleTransmit = FALSE;
@@ -779,16 +768,16 @@ int cmd_do_fr_config_fifo(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
        }
 
        printf("frbtcfgfifo rejslot%i slotmask%i depth%i %2s cyc%i max%i %10s %10s\n",
-                    slot,
-                    mask,
-                    depth,
-                    channel,
-                    cycleset,
-                    maxpayload,
-                    rej_null_frames,
-                    rej_static_frames
-               );
-       
+                  slot,
+                  mask,
+                  depth,
+                  channel,
+                  cycleset,
+                  maxpayload,
+                  rej_null_frames,
+                  rej_static_frames
+                  );
+
        return SUCCESS;
 }
 
@@ -799,30 +788,30 @@ int cmd_do_fr_config_bufer(cmd_io_t *cmd_io, const struct cmd_des *des, char *pa
        int ret;
        char buf_type, channel[3],rxtx[3], single_continuous[11];
        unsigned buffer, slot, cycleset, maxpayload, intr, preamb;
-       
+
        if (fr_initialized) {
                rpp_sci_printf("FlexRay configuration can not be modified after frbtinit was called.\n");
                return -CMDERR_BADCFG;
        }
 
        ret = sscanf(param[1], "%c%i slot%i %2s cyc%i %2s max%i %10s ppi%i int%i",
-                    &buf_type,
-                    &buffer,
-                    &slot,
-                    channel,
-                    &cycleset,
-                    rxtx,
-                    &maxpayload,
-                    single_continuous,
-                    &preamb,
-                    &intr
-                    );
+                                &buf_type,
+                                &buffer,
+                                &slot,
+                                channel,
+                                &cycleset,
+                                rxtx,
+                                &maxpayload,
+                                single_continuous,
+                                &preamb,
+                                &intr
+                                );
        if (ret != 10) {
                printf("Error parsing parameter %d\n", ret+1);
                return -CMDERR_BADPAR;
-       
+
        }
-       
+
        switch (buf_type) {
        case 'S':
                if (buffer >= RPP_FR_MAX_STATIC_BUF_CNT)
@@ -862,10 +851,10 @@ int cmd_do_fr_config_bufer(cmd_io_t *cmd_io, const struct cmd_des *des, char *pa
        cfg->maxPayload = maxpayload;
 
        if (0 == strcmp(single_continuous, "single") ||
-           0 == strcmp(single_continuous, "s"))
+               0 == strcmp(single_continuous, "s"))
                cfg->singleTransmit = true;
        else if (0 == strcmp(single_continuous, "continuous") ||
-           0 == strcmp(single_continuous, "c"))
+                        0 == strcmp(single_continuous, "c"))
                cfg->singleTransmit = false;
        else return badpar("Invalid single/continuous parameter");
 
@@ -889,17 +878,17 @@ int cmd_do_fr_config_bufer(cmd_io_t *cmd_io, const struct cmd_des *des, char *pa
        }
 
        printf("frbtcfgbuf%c%i slot%i %2s cyc%i %2s max%i %10s ppi%i int%i\n",
-                    buf_type,
-                    buffer,
-                    slot,
-                    channel,
-                    cycleset,
-                    rxtx,
-                    maxpayload,
-                    single_continuous,
-                    preamb,
-                    intr
-               );
+                  buf_type,
+                  buffer,
+                  slot,
+                  channel,
+                  cycleset,
+                  rxtx,
+                  maxpayload,
+                  single_continuous,
+                  preamb,
+                  intr
+                  );
 
        return 0;
 }
@@ -907,15 +896,16 @@ int cmd_do_fr_config_bufer(cmd_io_t *cmd_io, const struct cmd_des *des, char *pa
 
 
 /**
- *     @brief  Do the user configuration of the FlexRay cluster parameters
+ *  @brief     Do the user configuration of the FlexRay cluster parameters
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_user_config(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
-       char* token;
+int cmd_do_fr_user_config(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
+       char *token;
 
        if (fr_initialized) {
                rpp_sci_printf("FlexRay configuration can not be modified after frbtinit was called.\n");
@@ -937,41 +927,38 @@ int cmd_do_fr_user_config(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
                }
                rpp_sci_printf("FlexRay node configuration accepted.\n");
        }
-       else {
+       else
                return -CMDERR_BADPAR;
-       }
 
        return 0;
 }
 
 /**
- *     @brief  Initialize the device as FlexRay node.
+ *  @brief     Initialize the device as FlexRay node.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_init(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
-       const Fr_ConfigType* Fr_ConfigPtr = NULL;
+int cmd_do_fr_init(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
+       const Fr_ConfigType *Fr_ConfigPtr = NULL;
        int8_t retVal = SUCCESS;
        uint32_t error = ERR_PARAM_NO_ERROR;
 
-       if (*param[1] == 'A') {
+       if (*param[1] == 'A')
                Fr_ConfigPtr = &Fr_config_node_A;
-       }
-       else if (*param[1] == 'B') {
+       else if (*param[1] == 'B')
                Fr_ConfigPtr = &Fr_config_node_B;
-       }
-       else if (*param[1] == 'U') {    // Select the user configuration  -  call config commands first
+       else if (*param[1] == 'U') {    // Select the user configuration  -  call config commands first
                user_msg_ram_config.statSegmentBufferCount = user_static_buffer_configured;
                user_msg_ram_config.dynSegmentBufferCount = user_dynamic_buffer_configured;
-               user_msg_ram_config.fifoBufferCount= user_fifo_buffer_depth;
+               user_msg_ram_config.fifoBufferCount = user_fifo_buffer_depth;
                Fr_ConfigPtr = &user_configuration;
        }
-       else {
+       else
                return -CMDERR_BADPAR;
-       }
 
        retVal = rpp_fr_init_driver(Fr_ConfigPtr, &error);
        if (retVal == SUCCESS) {
@@ -991,84 +978,73 @@ int cmd_do_fr_init(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
        }
 
        retVal = rpp_fr_init_controller(0, &error);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("FlexRay controller initialized.\r\n");
-       }
        else {
-               if (error & FR_INIT_ERR_CLUSTER_CONFIG) {
+               if (error & FR_INIT_ERR_CLUSTER_CONFIG)
                        rpp_sci_printf("Cluster configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
-               }
-               else if (error & FR_INIT_ERR_NODE_CONFIG) {
+               else if (error & FR_INIT_ERR_NODE_CONFIG)
                        rpp_sci_printf("Node configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
-               }
-               else if (error & FR_INIT_ERR_MSGRAM_CONFIG) {
+               else if (error & FR_INIT_ERR_MSGRAM_CONFIG)
                        rpp_sci_printf("Message RAM configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
-               }
-               else if (error & FR_INIT_ERR_BUFFPARAM_CONFIG) {
+               else if (error & FR_INIT_ERR_BUFFPARAM_CONFIG)
                        rpp_sci_printf("Buffer configuration data error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
-               }
-               else if (error & (uint32_t)FR_INIT_ERR_BUFF_CONFIG) {
+               else if (error & (uint32_t)FR_INIT_ERR_BUFF_CONFIG)
                        rpp_sci_printf("Buffer configuration error: %x\r\n", (retVal & 0x3FFFFFE) >> 1 );
-               }
-               else {
+               else
                        rpp_sci_printf("POC state switching error.\r\n");
-               }
                return -CMDERR_BADCFG;
        }
        return 0;
 }
 
 /**
- *     @brief  Starts FlexRay communication
+ *  @brief     Starts FlexRay communication
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_start(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_start(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = SUCCESS;
        uint32_t error = ERR_PARAM_NO_ERROR;
 
        retVal = rpp_fr_start_communication(0, &error);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("FlexRay communication is running.\r\n");
-       }
        else {
-               if (error & FR_STARTUP_ERR_SW_STUP_FOLLOW) {
+               if (error & FR_STARTUP_ERR_SW_STUP_FOLLOW)
                        rpp_sci_printf("Can not switch POC to RUN state.\r\n");
-               }
-               else if (error & FR_STARTUP_ERR_CSINH_DIS) {
+               else if (error & FR_STARTUP_ERR_CSINH_DIS)
                        rpp_sci_printf("Cold start inhibit disabled error.\r\n");
-               }
-               else if (error & FR_STARTUP_ERR_SW_STUP_READY) {
+               else if (error & FR_STARTUP_ERR_SW_STUP_READY)
                        rpp_sci_printf("Can not switch back to READY from STARTUP.\r\n");
-               }
-               else if (error & FR_STARTUP_ERR_SW_STUP_AS_NCOLD) {
+               else if (error & FR_STARTUP_ERR_SW_STUP_AS_NCOLD)
                        rpp_sci_printf("Can not switch to STARTUP as non-coldstarter.\r\n");
-               }
-               else {
+               else
                        rpp_sci_printf("General error.\r\n");
-               }
                return -CMDERR_BADCFG;
        }
        return 0;
 }
 
 /**
- *     @brief  Invokes POC command ALL_SLOTS
+ *  @brief     Invokes POC command ALL_SLOTS
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_allslots(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_allslots(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
+
        retVal = rpp_fr_all_slots(0);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("FlexRay node started communication in all slots.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1077,19 +1053,20 @@ int cmd_do_fr_allslots(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[
 }
 
 /**
- *     @brief  Halt FlexRay communication
+ *  @brief     Halt FlexRay communication
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_halt(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_halt(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
+
        retVal = rpp_fr_halt_communication(0);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("FlexRay node communication halted.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1098,19 +1075,20 @@ int cmd_do_fr_halt(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
 }
 
 /**
- *     @brief  Abort FlexRay communication
+ *  @brief     Abort FlexRay communication
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_abort(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_abort(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
+
        retVal = rpp_fr_abort_communication(0);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("FlexRay node communication aborted.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1119,19 +1097,20 @@ int cmd_do_fr_abort(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
 }
 
 /**
- *     @brief  Send wake up pattern
+ *  @brief     Send wake up pattern
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_sendwup(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_sendwup(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
+
        retVal = rpp_fr_send_wup(0);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("Wake up pattern has been sent.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1140,30 +1119,27 @@ int cmd_do_fr_sendwup(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]
 }
 
 /**
- *     @brief  Set channel for wake up pattern sending.
+ *  @brief     Set channel for wake up pattern sending.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_setwuchannel(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_setwuchannel(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        Fr_ChannelType channel = FR_CHANNEL_A;
 
-       if (*param[1] == 'A') {
+       if (*param[1] == 'A')
                channel = FR_CHANNEL_A;
-       }
-       else if (*param[1] == 'B') {
+       else if (*param[1] == 'B')
                channel = FR_CHANNEL_B;
-       }
-       else {
+       else
                return -CMDERR_BADPAR;
-       }
        retVal = rpp_fr_set_wu_channel(0, channel);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("Wake up channel has been set.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1172,32 +1148,33 @@ int cmd_do_fr_setwuchannel(cmd_io_t *cmd_io, const struct cmd_des *des, char *pa
 }
 
 /**
- *     @brief  Get and print POC status of the FlexRay controller.
+ *  @brief     Get and print POC status of the FlexRay controller.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_getpocstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_getpocstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        Fr_POCStatusType status;
-       charErrorModeStrings[] = {"ACTIVE", "HALT", "PASSIVE"};
-       charSlotModeStrings[]  = {"KEYSLOT", "ALL_PENDING", "ALL"};
-       charStartupStateStrings[]  = {
-                       "UNDEFINED", "COLDSTART_LISTEN", "COLDSTART_CHECK", "COLDSTART_JOIN",
-                       "COLDSTART_CONSISTENCY_CHECK", "INTEGRATION_LISTEN", "INITIALIZE_SCHEDULE", "INTEGRATION_CONSISTENCY_CHECK",
-                       "COLDSTART_GAP", "EXTERNAL_STARTUP", "ABORT", "COLDSTART_COLLISION_RESOLUTION",
-                       "PREPARE"
+       char *ErrorModeStrings[] = {"ACTIVE", "HALT", "PASSIVE"};
+       char *SlotModeStrings[]  = {"KEYSLOT", "ALL_PENDING", "ALL"};
+       char *StartupStateStrings[]  = {
+               "UNDEFINED", "COLDSTART_LISTEN", "COLDSTART_CHECK", "COLDSTART_JOIN",
+               "COLDSTART_CONSISTENCY_CHECK", "INTEGRATION_LISTEN", "INITIALIZE_SCHEDULE", "INTEGRATION_CONSISTENCY_CHECK",
+               "COLDSTART_GAP", "EXTERNAL_STARTUP", "ABORT", "COLDSTART_COLLISION_RESOLUTION",
+               "PREPARE"
        };
-       charStateStrings[]  = {
-                       "CONFIG", "DEFAULT_CONFIG", "HALT", "NORMAL_ACTIVE",
-                       "NORMAL_PASSIVE", "READY", "STARTUP", "LOOPBACK",
-                       "MONITOR", "WAKEUP"
+       char *StateStrings[]  = {
+               "CONFIG", "DEFAULT_CONFIG", "HALT", "NORMAL_ACTIVE",
+               "NORMAL_PASSIVE", "READY", "STARTUP", "LOOPBACK",
+               "MONITOR", "WAKEUP"
        };
-       charWakeupStatusStrings[]  = {
-                       "UNDEFINED", "RECEIVED_HEADER", "RECEIVED_WUP", "COLLISION_HEADER",
-                       "COLLISION_WUP", "COLLISION_UNKNOWN", "TRANSMITTED"
+       char *WakeupStatusStrings[]  = {
+               "UNDEFINED", "RECEIVED_HEADER", "RECEIVED_WUP", "COLLISION_HEADER",
+               "COLLISION_WUP", "COLLISION_UNKNOWN", "TRANSMITTED"
        };
 
        retVal = rpp_fr_get_poc_status(0, &status);
@@ -1221,44 +1198,41 @@ int cmd_do_fr_getpocstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *pa
 }
 
 /**
- *     @brief  Send given data through the FlexRay in selected slot.
+ *  @brief     Send given data through the FlexRay in selected slot.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_transmittxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+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];
-       chartoken = NULL;
+       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) {
+       if (sscanf(param[2], " %2x", &values[0]) != 1)
                return -CMDERR_BADPAR;
-       }
        data[0] = (uint8_t)values[0];
        token = strtok(param[2], " ");
        token = strtok(NULL, " ");
        dataLength = 1;
        while (dataLength < MAX_PARAM_VALUES_NUM && token != NULL) {
-               if (sscanf(token, "%2x", &values[dataLength]) == EOF) {
+               if (sscanf(token, "%2x", &values[dataLength]) == EOF)
                        break;
-               }
                data[dataLength] = (uint8_t)values[dataLength];
                token = strtok(NULL, " ");
                dataLength++;
        }
 
-       retVal = rpp_fr_transmit_lpdu(0, slotID, data, dataLength);
-       if (retVal == SUCCESS) {
+       retVal = rpp_fr_transmit_lpdu(0, bufferID, data, dataLength);
+       if (retVal == SUCCESS)
                rpp_sci_printf("Data were set for transmission.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1267,28 +1241,26 @@ int cmd_do_fr_transmittxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *
 }
 
 /**
- *     @brief  Cancel the transmission in the selected slot.
+ *  @brief     Cancel the transmission in the selected slot.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_canceltxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+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) {
+       if (param[2] != NULL)
                return -CMDERR_BADPAR;
-       }
 
-       retVal = rpp_fr_cancel_transmit_lpdu(0, slotID);
-       if (retVal == SUCCESS) {
+       retVal = rpp_fr_cancel_transmit_lpdu(0, bufferID);
+       if (retVal == SUCCESS)
                rpp_sci_printf("Transmission canceled.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1297,31 +1269,30 @@ int cmd_do_fr_canceltxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *pa
 }
 
 /**
- *     @brief  Receive data from selected slot.
+ *  @brief     Receive data from selected slot.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_receiverxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+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) {
+       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:
@@ -1346,30 +1317,28 @@ int cmd_do_fr_receiverxlpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *p
 }
 
 /**
- *     @brief  Returns TX LPdu status.
+ *  @brief     Returns TX LPdu status.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_checktxlpdustatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+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;
-       charstatusStrings[] = {"is not", "is"};
+       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) {
+       if (param[2] != NULL)
                return -CMDERR_BADPAR;
-       }
 
-       retVal = rpp_fr_check_tx_lpdu_status(0, slotID, &status);
-       if (retVal == SUCCESS) {
+       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 {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1378,28 +1347,26 @@ int cmd_do_fr_checktxlpdustatus(cmd_io_t *cmd_io, const struct cmd_des *des, cha
 }
 
 /**
- *     @brief  Disable buffer.
+ *  @brief     Disable buffer.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_disablelpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+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) {
+       if (param[2] != NULL)
                return -CMDERR_BADPAR;
-       }
 
-       retVal = rpp_fr_disable_lpdu(0, slotID);
-       if (retVal == SUCCESS) {
+       retVal = rpp_fr_disable_lpdu(0, bufferID);
+       if (retVal == SUCCESS)
                rpp_sci_printf("Buffer disabled.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1408,22 +1375,22 @@ int cmd_do_fr_disablelpdu(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
 }
 
 /**
- *     @brief  Print global time of the FlexRay network.
+ *  @brief     Print global time of the FlexRay network.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_getglobaltime(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_getglobaltime(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        uint8_t cycle = 0;
        uint16_t macroTick = 0;
 
        retVal = rpp_fr_get_global_time(0, &cycle, &macroTick);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("Cycle number: %d\r\nMacrotick number: %d\r\n", cycle, macroTick);
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1432,14 +1399,15 @@ int cmd_do_fr_getglobaltime(cmd_io_t *cmd_io, const struct cmd_des *des, char *p
 }
 
 /**
- *     @brief  Print network management vector of the FlexRay node.
+ *  @brief     Print network management vector of the FlexRay node.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_getnmvector(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_getnmvector(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        uint8_t nmVector[12];
        uint8_t i;
@@ -1459,7 +1427,8 @@ int cmd_do_fr_getnmvector(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
        return 0;
 }
 
-int cmd_do_fr_nmwatch(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_nmwatch(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        uint8_t nmVector[12];
        uint8_t i;
@@ -1468,7 +1437,7 @@ int cmd_do_fr_nmwatch(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]
        static const portTickType freq_ticks = 100 /* ms */ / portTICK_RATE_MS;
        portTickType last_wake_time = xTaskGetTickCount();
 
-       while(cmd_io->getc(cmd_io) < 0) {
+       while (cmd_io->getc(cmd_io) < 0) {
                retVal = rpp_fr_get_network_management_vector(0, nmVector);
                if (retVal == SUCCESS) {
                        rpp_sci_printf("Network management vector:");
@@ -1488,48 +1457,48 @@ int cmd_do_fr_nmwatch(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]
 }
 
 /**
- *     @brief  Print both channels status of the FlexRay node.
+ *  @brief     Print both channels status of the FlexRay node.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_getchannelstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_getchannelstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        uint8_t index;
        uint8_t channel;
-       chardecodeStrings[] = {
-                       "aggregated channel status vSS!ValidFrame",
-                       "aggregated channel status vSS!SyntaxError",
-                       "aggregated channel status vSS!ContentError",
-                       "aggregated channel status additional communication",
-                       "aggregated channel status vSS!Bviolation",
-                       "aggregated channel status vSS!TxConflict",
-                       "Not used (0)",
-                       "Not used (0)",
-                       "symbol window status data vSS!ValidMTS",
-                       "symbol window status data vSS!SyntaxError",
-                       "symbol window status data vSS!Bviolation",
-                       "symbol window status data vSS!TxConflict",
-                       "NIT status data vSS!SyntaxError",
-                       "NIT status data vSS!Bviolation",
-                       "Not used (0)",
-                       "Not used (0)"
+       char *decodeStrings[] = {
+               "aggregated channel status vSS!ValidFrame",
+               "aggregated channel status vSS!SyntaxError",
+               "aggregated channel status vSS!ContentError",
+               "aggregated channel status additional communication",
+               "aggregated channel status vSS!Bviolation",
+               "aggregated channel status vSS!TxConflict",
+               "Not used (0)",
+               "Not used (0)",
+               "symbol window status data vSS!ValidMTS",
+               "symbol window status data vSS!SyntaxError",
+               "symbol window status data vSS!Bviolation",
+               "symbol window status data vSS!TxConflict",
+               "NIT status data vSS!SyntaxError",
+               "NIT status data vSS!Bviolation",
+               "Not used (0)",
+               "Not used (0)"
        };
-       charchannelNames[] = {"A", "B"};
-       charboolStrings[] = {"FALSE", "TRUE"};
+       char *channelNames[] = {"A", "B"};
+       char *boolStrings[] = {"FALSE", "TRUE"};
        uint16_t channelStatuses[2];
 
        retVal = rpp_fr_get_channel_status(0, &channelStatuses[0], &channelStatuses[1]);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                for (channel = 0; channel < 2; channel++) {
                        rpp_sci_printf("Channel %s status:\r\n", channelNames[channel]);
                        for (index = 0; index < 16; index++) {
                                rpp_sci_printf("\t%s: %s\r\n", decodeStrings[index], boolStrings[ (channelStatuses[channel] >> index) & 0x1 ] );
                        }
                }
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1538,22 +1507,22 @@ int cmd_do_fr_getchannelstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char
 }
 
 /**
- *     @brief  Print clock correction of the FlexRay node
+ *  @brief     Print clock correction of the FlexRay node
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_getclockcorrection(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_getclockcorrection(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        int16_t rateCorrection;
        int32_t offsetCorrection;
 
        retVal = rpp_fr_get_clock_correction(0, &rateCorrection, &offsetCorrection);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("Rate correction: %d\r\nOffset correction: %d\r\n", rateCorrection, offsetCorrection);
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1562,14 +1531,15 @@ int cmd_do_fr_getclockcorrection(cmd_io_t *cmd_io, const struct cmd_des *des, ch
 }
 
 /**
- *     @brief  Print list of syncframec transmitted on both channels via the even and odd cycle.
+ *  @brief     Print list of syncframec transmitted on both channels via the even and odd cycle.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_getsyncframelist(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_getsyncframelist(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        uint16_t channelAEvenList[FR_MAX_SYNC_FRAME_LIST_SIZE];
        uint16_t channelBEvenList[FR_MAX_SYNC_FRAME_LIST_SIZE];
@@ -1578,15 +1548,12 @@ int cmd_do_fr_getsyncframelist(cmd_io_t *cmd_io, const struct cmd_des *des, char
        uint32_t listSize = 0;
        uint8_t i;
 
-       if (sscanf(param[1], "%d", &listSize) != 1) {
+       if (sscanf(param[1], "%d", &listSize) != 1)
                return -CMDERR_BADPAR;
-       }
-       if (param[2] != NULL) {
+       if (param[2] != NULL)
                return -CMDERR_BADPAR;
-       }
-       if (listSize > FR_MAX_SYNC_FRAME_LIST_SIZE) {
+       if (listSize > FR_MAX_SYNC_FRAME_LIST_SIZE)
                return -CMDERR_BADPAR;
-       }
 
        retVal = rpp_fr_get_sync_frame_list(0, listSize, channelAEvenList, channelBEvenList, channelAOddList, channelBOddList);
        if (retVal == SUCCESS) {
@@ -1606,26 +1573,26 @@ int cmd_do_fr_getsyncframelist(cmd_io_t *cmd_io, const struct cmd_des *des, char
 }
 
 /**
- *     @brief  Print status of wakeup on each channels (wakeup received on channel or not yet received).
+ *  @brief     Print status of wakeup on each channels (wakeup received on channel or not yet received).
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_getwakeuprxstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_getwakeuprxstatus(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        uint8_t status = 0;
-       charstatusStrings[] = {"was not yet", "was"};
-       charchannelNames[] = {"A", "B"};
+       char *statusStrings[] = {"was not yet", "was"};
+       char *channelNames[] = {"A", "B"};
        uint8_t i;
 
        retVal = rpp_fr_get_wakeup_rx_status(0, &status);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                for (i = 0; i < 2; i++) {
                        rpp_sci_printf("Wake up pattern %s received on channel %s.\r\n", statusStrings[(status >> i) & 0x1], channelNames[i]);
                }
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1634,22 +1601,22 @@ int cmd_do_fr_getwakeuprxstatus(cmd_io_t *cmd_io, const struct cmd_des *des, cha
 }
 
 /**
- *     @brief  Set and start absolute timer.
+ *  @brief     Set and start absolute timer.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_settimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_settimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        int timer = 0;
        int cycle = 0;
        int offset = 0;
 
-       if (sscanf(param[1], "%i %i %i", &timer, &cycle, &offset) != 3) {
+       if (sscanf(param[1], "%i %i %i", &timer, &cycle, &offset) != 3)
                return -CMDERR_BADPAR;
-       }
 
        retVal = rpp_fr_set_timer(0, timer, cycle, offset);
        if (retVal == SUCCESS) {
@@ -1660,7 +1627,7 @@ int cmd_do_fr_settimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[
                        i = 1;
 
                rpp_sci_printf("Timer was set for every %d-th cycle, offset %d, macrotick %d\n",
-                              i, cycle & ~i, offset);
+                                          i, cycle & ~i, offset);
        }
        else {
                rpp_sci_printf("General error.\r\n");
@@ -1670,29 +1637,27 @@ int cmd_do_fr_settimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[
 }
 
 /**
- *     @brief  Cancel selected timer
+ *  @brief     Cancel selected timer
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_canceltimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_canceltimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        int timer = 0;
 
-       if (sscanf(param[1], "%d", &timer) != 1) {
+       if (sscanf(param[1], "%d", &timer) != 1)
                return -CMDERR_BADPAR;
-       }
 
-       if (param[2] != NULL) {
+       if (param[2] != NULL)
                return -CMDERR_BADPAR;
-       }
 
        retVal = rpp_fr_cancel_timer(0, timer);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("Timer was canceled.\r\n");
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1701,55 +1666,48 @@ int cmd_do_fr_canceltimer(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
 }
 
 /**
- *     @brief  Enable/disable, acknowledge, get timer IRQ
+ *  @brief     Enable/disable, acknowledge, get timer IRQ
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_timerirq(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_timerirq(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        int timer = 0;
        char str[4];
        boolean_t status = FALSE;
-       charboolStrings[] = {"FALSE", "TRUE"};
+       char *boolStrings[] = {"FALSE", "TRUE"};
 
 
-       if (sscanf(param[1], "%d", &timer) != 1) {
+       if (sscanf(param[1], "%d", &timer) != 1)
                return -CMDERR_BADPAR;
-       }
 
-       if (param[2] == NULL) {         // Get timer IRQ
+       if (param[2] == NULL) {     // Get timer IRQ
                retVal = rpp_fr_get_timer_irq_status(0, timer, &status);
-               if (retVal == SUCCESS) {
+               if (retVal == SUCCESS)
                        rpp_sci_printf("IRQ = %s\r\n", boolStrings[status]);
-               }
                else {
                        rpp_sci_printf("General error.\r\n");
                        return -CMDERR_BADCFG;
                }
        }
-       else {  // Some set action
-               if (sscanf(param[2], "%4s", str) != 1) {
+       else {  // Some set action
+               if (sscanf(param[2], "%4s", str) != 1)
                        return -CMDERR_BADPAR;
-               }
-               if (strcmp(str, "EN") == 0) { // Enable IRQ
-                       retVal = SUCCESS;       // No interrupts imlemented
-               }
-               else if (strcmp(str, "DIS") == 0) { // Disable IRQ
-                       retVal = SUCCESS;       // No interrupts implemented
-               }
-               else if  (strcmp(str, "ACK") == 0) { // Clear IRQ
+               if (strcmp(str, "EN") == 0)   // Enable IRQ
+                       retVal = SUCCESS;   // No interrupts imlemented
+               else if (strcmp(str, "DIS") == 0)   // Disable IRQ
+                       retVal = SUCCESS;   // No interrupts implemented
+               else if  (strcmp(str, "ACK") == 0)   // Clear IRQ
                        retVal = rpp_fr_clear_timer_irq(0, timer);
-               }
-               else {  // Bad argument
+               else    // Bad argument
                        return -CMDERR_BADPAR;
-               }
 
-               if (retVal == SUCCESS) {
+               if (retVal == SUCCESS)
                        rpp_sci_printf("OK\r\n");
-               }
                else {
                        rpp_sci_printf("General error.\r\n");
                        return -CMDERR_BADCFG;
@@ -1759,14 +1717,15 @@ int cmd_do_fr_timerirq(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[
 }
 
 /**
- *     @brief  Print FlexRay driver version info.
+ *  @brief     Print FlexRay driver version info.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_getversioninfo(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_getversioninfo(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        Std_VersionInfoType versionInfo;
 
        rpp_fr_get_driver_version(&versionInfo);
@@ -1780,30 +1739,28 @@ int cmd_do_fr_getversioninfo(cmd_io_t *cmd_io, const struct cmd_des *des, char *
 }
 
 /**
- *     @brief  Print value of FlexRay configuratoin parameter.
+ *  @brief     Print value of FlexRay configuratoin parameter.
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_readcconfig(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_readcconfig(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        int8_t retVal = ERR_PARAM_NO_ERROR;
        int index = 0;
        uint32_t value = 0;
 
-       if (sscanf(param[1], "%d", &index) != 1) {
+       if (sscanf(param[1], "%d", &index) != 1)
                return -CMDERR_BADPAR;
-       }
 
-       if (param[2] != NULL) {
+       if (param[2] != NULL)
                return -CMDERR_BADPAR;
-       }
 
        retVal = rpp_fr_read_com_ctrl_config(0, index, &value);
-       if (retVal == SUCCESS) {
+       if (retVal == SUCCESS)
                rpp_sci_printf("Value = %#x\r\n", value);
-       }
        else {
                rpp_sci_printf("General error.\r\n");
                return -CMDERR_BADCFG;
@@ -1812,35 +1769,36 @@ int cmd_do_fr_readcconfig(cmd_io_t *cmd_io, const struct cmd_des *des, char *par
 }
 
 /**
- *     @brief  Reconfigure buffer
+ *  @brief     Reconfigure buffer
  *
  * @param[in]  cmd_io  Pointer to IO stack
  * @param[in]  des             Pointer to command descriptor
  * @param[in]  param   Parameters of command
  * @return     0 when OK or error code
  */
-int cmd_do_fr_reconfigure_buffer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]) {
+int cmd_do_fr_reconfigure_buffer(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
+{
        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,
-                    &slot,
-                    channel,
-                    &cycleset,
-                    &cycleoffset,
-                    &maxpayload
-                    );
+                                &bufferID,
+                                &slot,
+                                channel,
+                                &cycleset,
+                                &cycleoffset,
+                                &maxpayload
+                                );
        if (ret != 6) {
                printf("Error parsing parameter %d\n", ret+1);
                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;
@@ -1848,47 +1806,44 @@ int cmd_do_fr_reconfigure_buffer(cmd_io_t *cmd_io, const struct cmd_des *des, ch
        else if (strcmp(channel, "AB") == 0) tmp_buffer.channel = FR_CHANNEL_AB;
        else return badpar("Channel parsing error\n");
        if (cycleset == 0) cycleset = 1;
-       for (pow2 = 1, is_pow2 = FALSE; pow2 < 128; pow2*=2) {
+       for (pow2 = 1, is_pow2 = FALSE; pow2 < 128; pow2 *= 2) {
                if (cycleset == pow2) {
                        is_pow2 = TRUE;
                        break;
                }
        }
-       if (!is_pow2) {
+       if (!is_pow2)
                return badpar("Cycle set must be one of 0, 1, 2, 4, 8, 16, 32, 64.\n");
-       }
-       if (cycleoffset >= cycleset) {
+       if (cycleoffset >= cycleset)
                return badpar("Cycle offset must in range 0 - cycset-1.\n");
-       }
 
        if (maxpayload >= 256)
                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,
-                            slot,
-                            channel,
-                            cycleset,
-                            cycleoffset,
-                            maxpayload
-                            );
+                          bufferID,
+                          slot,
+                          channel,
+                          cycleset,
+                          cycleoffset,
+                          maxpayload
+                          );
                return 0;
        }
-       else {
+       else
                printf("Reconfiguration failed.\n");
-       }
        return -CMDERR_BADPAR;
 }
 
-#endif /* DOCGEN */
+#endif  /* DOCGEN */
 
 /** Command descriptor for FlexRay user config cluster command */
-cmd_des_t const cmd_des_fr_user_config={
+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"
@@ -1977,16 +1932,16 @@ cmd_des_t const cmd_des_fr_user_config={
        CMD_HANDLER(cmd_do_fr_user_config), (void *)&cmd_list_fr_basic_test
 };
 
-cmd_des_t const cmd_des_fr_config_buffer={
+cmd_des_t const cmd_des_fr_config_buffer = {
        0, 0,
        "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"
@@ -2016,7 +1971,7 @@ cmd_des_t const cmd_des_fr_config_buffer={
        CMD_HANDLER(cmd_do_fr_config_bufer), (void *)&cmd_list_fr_basic_test
 };
 
-cmd_des_t const cmd_des_fr_config_fifo={
+cmd_des_t const cmd_des_fr_config_fifo = {
        0, 0,
        "frbtcfgfifo*","Configure a RX FIFO message buffer in the user configuration",
        "### Command syntax ###\n"
@@ -2049,7 +2004,7 @@ cmd_des_t const cmd_des_fr_config_fifo={
 };
 
 /** Command descriptor for FlexRay init command */
-cmd_des_t const cmd_des_fr_init={
+cmd_des_t const cmd_des_fr_init = {
        0, 0,
        "frbtinit?","Initialize a FlexRay node",
        "### Command syntax ###\n"
@@ -2085,7 +2040,7 @@ cmd_des_t const cmd_des_fr_init={
 };
 
 /** Command descriptor for FlexRay controller init command */
-cmd_des_t const cmd_des_fr_start={
+cmd_des_t const cmd_des_fr_start = {
        0, 0,
        "frbtstart","Start a new FlexRay network or join to the existing one",
        "### Command syntax ###\n"
@@ -2107,6 +2062,9 @@ cmd_des_t const cmd_des_fr_start={
        "\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"
@@ -2115,7 +2073,7 @@ cmd_des_t const cmd_des_fr_start={
 };
 
 /** Command descriptor for FlexRay controller all slots command */
-cmd_des_t const cmd_des_fr_allslots={
+cmd_des_t const cmd_des_fr_allslots = {
        0, 0,
        "frbtallslots","Enables communication for all frames",
        "### Command syntax ###\n"
@@ -2142,7 +2100,7 @@ cmd_des_t const cmd_des_fr_allslots={
 };
 
 /** Command descriptor for FlexRay controller halt command */
-cmd_des_t const cmd_des_fr_halt={
+cmd_des_t const cmd_des_fr_halt = {
        0, 0,
        "frbthalt","Halt FlexRay communication after the end of the actual communication cycle",
        "### Command syntax ###\n"
@@ -2166,7 +2124,7 @@ cmd_des_t const cmd_des_fr_halt={
 };
 
 /** Command descriptor for FlexRay controller abort command */
-cmd_des_t const cmd_des_fr_abort={
+cmd_des_t const cmd_des_fr_abort = {
        0, 0,
        "frbtabort","Abort FlexRay communication immediately",
        "### Command syntax ###\n"
@@ -2191,7 +2149,7 @@ cmd_des_t const cmd_des_fr_abort={
 };
 
 /** Command descriptor for FlexRay controller send wake up pattern command */
-cmd_des_t const cmd_des_fr_sendwup={
+cmd_des_t const cmd_des_fr_sendwup = {
        0, 0,
        "frbtwup","Initiate the wake up procedure",
        "### Command syntax ###\n"
@@ -2212,7 +2170,7 @@ cmd_des_t const cmd_des_fr_sendwup={
 };
 
 /** Command descriptor for FlexRay controller sent wake up pattern channel command */
-cmd_des_t const cmd_des_fr_setwuchannel={
+cmd_des_t const cmd_des_fr_setwuchannel = {
        0, 0,
        "frbtsetwuch?","Set wake up channel",
        "### Command syntax ###\n"
@@ -2237,7 +2195,7 @@ cmd_des_t const cmd_des_fr_setwuchannel={
 };
 
 /** Command descriptor for FlexRay controller get POC status command */
-cmd_des_t const cmd_des_fr_getpocstatus={
+cmd_des_t const cmd_des_fr_getpocstatus = {
        0, 0,
        "frbtgetpocst","Print FlexRay POC status",
        "### Command syntax ###\n"
@@ -2268,24 +2226,25 @@ cmd_des_t const cmd_des_fr_getpocstatus={
 };
 
 /** Command descriptor for FlexRay transmit tx lpdu command */
-cmd_des_t const cmd_des_fr_transmittxlpdu={
+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"
@@ -2296,24 +2255,24 @@ cmd_des_t const cmd_des_fr_transmittxlpdu={
 };
 
 /** Command descriptor for FlexRay cancel tx lpdu command */
-cmd_des_t const cmd_des_fr_canceltxlpdu={
+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"
@@ -2323,56 +2282,56 @@ cmd_des_t const cmd_des_fr_canceltxlpdu={
 };
 
 /** Command descriptor for FlexRay receive rx lpdu command */
-cmd_des_t const cmd_des_fr_receiverxlpdu={
+cmd_des_t const cmd_des_fr_receiverxlpdu = {
        0, 0,
        "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
 };
 
 /** Command descriptor for FlexRay check TX LPdu status command */
-cmd_des_t const cmd_des_fr_checktxlpdustatus={
+cmd_des_t const cmd_des_fr_checktxlpdustatus = {
        0, 0,
        "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"
@@ -2382,24 +2341,23 @@ cmd_des_t const cmd_des_fr_checktxlpdustatus={
 };
 
 /** Command descriptor for FlexRay disable LPdu command */
-cmd_des_t const cmd_des_fr_disablelpdu={
+cmd_des_t const cmd_des_fr_disablelpdu = {
        0, 0,
        "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"
@@ -2409,7 +2367,7 @@ cmd_des_t const cmd_des_fr_disablelpdu={
 };
 
 /** Command descriptor for FlexRay get global time command */
-cmd_des_t const cmd_des_fr_getglobaltime={
+cmd_des_t const cmd_des_fr_getglobaltime = {
        0, 0,
        "frbtglobtime","Print actual global time of the network",
        "### Command syntax ###\n"
@@ -2431,7 +2389,7 @@ cmd_des_t const cmd_des_fr_getglobaltime={
 };
 
 /** Command descriptor for FlexRay get network management vector command */
-cmd_des_t const cmd_des_fr_getnmvector={
+cmd_des_t const cmd_des_fr_getnmvector = {
        0, 0,
        "frbtnmvector","Print network management vector of the node",
        "### Command syntax ###\n"
@@ -2452,7 +2410,7 @@ cmd_des_t const cmd_des_fr_getnmvector={
 };
 
 /** Command descriptor for FlexRay get network management vector command */
-cmd_des_t const cmd_des_fr_nmwatch={
+cmd_des_t const cmd_des_fr_nmwatch = {
        0, 0,
        "frbtnmwatch","Watch the changes of the network managment vector in real-time",
        "### Command syntax ###\n"
@@ -2471,7 +2429,7 @@ cmd_des_t const cmd_des_fr_nmwatch={
 };
 
 /** Command descriptor for FlexRay get channel status command */
-cmd_des_t const cmd_des_fr_getchannelstatus={
+cmd_des_t const cmd_des_fr_getchannelstatus = {
        0, 0,
        "frbtchstat","Print channel A and B status",
        "### Command syntax ###\n"
@@ -2487,44 +2445,44 @@ cmd_des_t const cmd_des_fr_getchannelstatus={
        "\n"
        "    --> frbtchstat\n"
        "    Channel A status:\n"
-       "       aggregated channel status vSS!ValidFrame: TRUE\n"
-       "       aggregated channel status vSS!SyntaxError: FALSE\n"
-       "       aggregated channel status vSS!ContentError: FALSE\n"
-       "       aggregated channel status additional communication: FALSE\n"
-       "       aggregated channel status vSS!Bviolation: FALSE\n"
-       "       aggregated channel status vSS!TxConflict: FALSE\n"
-       "       Not used (0): FALSE\n"
-       "       Not used (0): FALSE\n"
-       "       symbol window status data vSS!ValidMTS: FALSE\n"
-       "       symbol window status data vSS!SyntaxError: FALSE\n"
-       "       symbol window status data vSS!Bviolation: FALSE\n"
-       "       symbol window status data vSS!TxConflict: FALSE\n"
-       "       NIT status data vSS!SyntaxError: FALSE\n"
-       "       NIT status data vSS!Bviolation: FALSE\n"
-       "       Not used (0): FALSE\n"
-       "       Not used (0): FALSE\n"
+       "       aggregated channel status vSS!ValidFrame: TRUE\n"
+       "       aggregated channel status vSS!SyntaxError: FALSE\n"
+       "       aggregated channel status vSS!ContentError: FALSE\n"
+       "       aggregated channel status additional communication: FALSE\n"
+       "       aggregated channel status vSS!Bviolation: FALSE\n"
+       "       aggregated channel status vSS!TxConflict: FALSE\n"
+       "       Not used (0): FALSE\n"
+       "       Not used (0): FALSE\n"
+       "       symbol window status data vSS!ValidMTS: FALSE\n"
+       "       symbol window status data vSS!SyntaxError: FALSE\n"
+       "       symbol window status data vSS!Bviolation: FALSE\n"
+       "       symbol window status data vSS!TxConflict: FALSE\n"
+       "       NIT status data vSS!SyntaxError: FALSE\n"
+       "       NIT status data vSS!Bviolation: FALSE\n"
+       "       Not used (0): FALSE\n"
+       "       Not used (0): FALSE\n"
        "    Channel B status:\n"
-       "       aggregated channel status vSS!ValidFrame: TRUE\n"
-       "       aggregated channel status vSS!SyntaxError: FALSE\n"
-       "       aggregated channel status vSS!ContentError: FALSE\n"
-       "       aggregated channel status additional communication: FALSE\n"
-       "       aggregated channel status vSS!Bviolation: FALSE\n"
-       "       aggregated channel status vSS!TxConflict: FALSE\n"
-       "       Not used (0): FALSE\n"
-       "       Not used (0): FALSE\n"
-       "       symbol window status data vSS!ValidMTS: FALSE\n"
-       "       symbol window status data vSS!SyntaxError: FALSE\n"
-       "       symbol window status data vSS!Bviolation: FALSE\n"
-       "       symbol window status data vSS!TxConflict: FALSE\n"
-       "       NIT status data vSS!SyntaxError: FALSE\n"
-       "       NIT status data vSS!Bviolation: FALSE\n"
-       "       Not used (0): FALSE\n"
-       "       Not used (0): FALSE\n",
+       "       aggregated channel status vSS!ValidFrame: TRUE\n"
+       "       aggregated channel status vSS!SyntaxError: FALSE\n"
+       "       aggregated channel status vSS!ContentError: FALSE\n"
+       "       aggregated channel status additional communication: FALSE\n"
+       "       aggregated channel status vSS!Bviolation: FALSE\n"
+       "       aggregated channel status vSS!TxConflict: FALSE\n"
+       "       Not used (0): FALSE\n"
+       "       Not used (0): FALSE\n"
+       "       symbol window status data vSS!ValidMTS: FALSE\n"
+       "       symbol window status data vSS!SyntaxError: FALSE\n"
+       "       symbol window status data vSS!Bviolation: FALSE\n"
+       "       symbol window status data vSS!TxConflict: FALSE\n"
+       "       NIT status data vSS!SyntaxError: FALSE\n"
+       "       NIT status data vSS!Bviolation: FALSE\n"
+       "       Not used (0): FALSE\n"
+       "       Not used (0): FALSE\n",
        CMD_HANDLER(cmd_do_fr_getchannelstatus), (void *)&cmd_list_fr_basic_test
 };
 
 /** Command descriptor for FlexRay get clock correction command */
-cmd_des_t const cmd_des_fr_getclockcorrection={
+cmd_des_t const cmd_des_fr_getclockcorrection = {
        0, 0,
        "frbtclkcor","Print clock correction (rate and offset)",
        "### Command syntax ###\n"
@@ -2545,7 +2503,7 @@ cmd_des_t const cmd_des_fr_getclockcorrection={
 };
 
 /** Command descriptor for FlexRay get sync frame list command */
-cmd_des_t const cmd_des_fr_getsyncframelist={
+cmd_des_t const cmd_des_fr_getsyncframelist = {
        0, 0,
        "frbtgetsyncfrlist*","Print the list of sync frames transmitted on both channels via the odd and even communication cycle",
        "### Command syntax ###\n"
@@ -2572,7 +2530,7 @@ cmd_des_t const cmd_des_fr_getsyncframelist={
 };
 
 /** Command descriptor for FlexRay get sync frame list command */
-cmd_des_t const cmd_des_fr_getwakeuprxstatus={
+cmd_des_t const cmd_des_fr_getwakeuprxstatus = {
        0, 0,
        "frbtgetwurxstat","Prints whether the wake up pattern has been or has not been received",
        "### Command syntax ###\n"
@@ -2594,7 +2552,7 @@ cmd_des_t const cmd_des_fr_getwakeuprxstatus={
 };
 
 /** Command descriptor for FlexRay set absolute timer command */
-cmd_des_t const cmd_des_fr_settimer={
+cmd_des_t const cmd_des_fr_settimer = {
        0, 0,
        "frbtsettimer*","Set and start timer",
        "### Command syntax ###\n"
@@ -2628,7 +2586,7 @@ cmd_des_t const cmd_des_fr_settimer={
 };
 
 /** Command descriptor for FlexRay cancel absolute timer command */
-cmd_des_t const cmd_des_fr_canceltimer={
+cmd_des_t const cmd_des_fr_canceltimer = {
        0, 0,
        "frbtcanceltimer*","Stop the timer",
        "### Command syntax ###\n"
@@ -2649,7 +2607,7 @@ cmd_des_t const cmd_des_fr_canceltimer={
 };
 
 /** Command descriptor for FlexRay absolute timer irq manipulation command */
-cmd_des_t const cmd_des_fr_timerirq={
+cmd_des_t const cmd_des_fr_timerirq = {
        0, 0,
        "frbttimerirq*","Perform selected action on the timer IRQ",
        "### Command syntax ###\n"
@@ -2688,7 +2646,7 @@ cmd_des_t const cmd_des_fr_timerirq={
 };
 
 /** Command descriptor for FlexRay get version info command */
-cmd_des_t const cmd_des_fr_getversioninfo={
+cmd_des_t const cmd_des_fr_getversioninfo = {
        0, 0,
        "frbtversion","Print FlexRay driver version information",
        "### Command syntax ###\n"
@@ -2714,7 +2672,7 @@ cmd_des_t const cmd_des_fr_getversioninfo={
 };
 
 /** Command descriptor for FlexRay get controller configuration command */
-cmd_des_t const cmd_des_fr_readcconfig={
+cmd_des_t const cmd_des_fr_readcconfig = {
        0, 0,
        "frbtccconfig*","Print value of a FlexRay cluster and node configuration parameter",
        "### Command syntax ###\n"
@@ -2740,15 +2698,15 @@ cmd_des_t const cmd_des_fr_readcconfig={
 };
 
 /** Command descriptor for FlexRay reconfigure buffer command */
-cmd_des_t const cmd_des_fr_reconfigure_buffer={
+cmd_des_t const cmd_des_fr_reconfigure_buffer = {
        0, 0,
        "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"
@@ -2774,35 +2732,35 @@ cmd_des_t const cmd_des_fr_reconfigure_buffer={
 
 
 /** List of commands for flexRay, defined as external */
-cmd_des_t const *cmd_list_fr_basic_test[]={
-  &cmd_des_fr_user_config,
-  &cmd_des_fr_config_buffer,
-  &cmd_des_fr_config_fifo,
-  &cmd_des_fr_init,
-  &cmd_des_fr_start,
-  &cmd_des_fr_allslots,
-  &cmd_des_fr_halt,
-  &cmd_des_fr_abort,
-  &cmd_des_fr_sendwup,
-  &cmd_des_fr_setwuchannel,
-  &cmd_des_fr_getpocstatus,
-  &cmd_des_fr_transmittxlpdu,
-  &cmd_des_fr_canceltxlpdu,
-  &cmd_des_fr_receiverxlpdu,
-  &cmd_des_fr_checktxlpdustatus,
-  &cmd_des_fr_disablelpdu,
-  &cmd_des_fr_getglobaltime,
-  &cmd_des_fr_getnmvector,
-  &cmd_des_fr_nmwatch,
-  &cmd_des_fr_getchannelstatus,
-  &cmd_des_fr_getclockcorrection,
-  &cmd_des_fr_getsyncframelist,
-  &cmd_des_fr_getwakeuprxstatus,
-  &cmd_des_fr_settimer,
-  &cmd_des_fr_canceltimer,
-  &cmd_des_fr_timerirq,
-  &cmd_des_fr_getversioninfo,
-  &cmd_des_fr_readcconfig,
-  &cmd_des_fr_reconfigure_buffer,
-  NULL
+cmd_des_t const *cmd_list_fr_basic_test[] = {
+       &cmd_des_fr_user_config,
+       &cmd_des_fr_config_buffer,
+       &cmd_des_fr_config_fifo,
+       &cmd_des_fr_init,
+       &cmd_des_fr_start,
+       &cmd_des_fr_allslots,
+       &cmd_des_fr_halt,
+       &cmd_des_fr_abort,
+       &cmd_des_fr_sendwup,
+       &cmd_des_fr_setwuchannel,
+       &cmd_des_fr_getpocstatus,
+       &cmd_des_fr_transmittxlpdu,
+       &cmd_des_fr_canceltxlpdu,
+       &cmd_des_fr_receiverxlpdu,
+       &cmd_des_fr_checktxlpdustatus,
+       &cmd_des_fr_disablelpdu,
+       &cmd_des_fr_getglobaltime,
+       &cmd_des_fr_getnmvector,
+       &cmd_des_fr_nmwatch,
+       &cmd_des_fr_getchannelstatus,
+       &cmd_des_fr_getclockcorrection,
+       &cmd_des_fr_getsyncframelist,
+       &cmd_des_fr_getwakeuprxstatus,
+       &cmd_des_fr_settimer,
+       &cmd_des_fr_canceltimer,
+       &cmd_des_fr_timerirq,
+       &cmd_des_fr_getversioninfo,
+       &cmd_des_fr_readcconfig,
+       &cmd_des_fr_reconfigure_buffer,
+       NULL
 };