]> rtime.felk.cvut.cz Git - pes-rpp/rpp-test-sw.git/commitdiff
testfray command tuned
authorMichal Horn <michal@michal-laptop.(none)>
Fri, 22 Mar 2013 13:34:47 +0000 (14:34 +0100)
committerMichal Horn <michal@michal-laptop.(none)>
Fri, 22 Mar 2013 13:34:47 +0000 (14:34 +0100)
Correct network startup process added
Number of message correction restricted

source/cmd_fray.c

index 368232014062c9ea0bde77447c9f78ae1998caa2..c483c9e948b87b73f09177356f963983724442d4 100644 (file)
@@ -77,15 +77,22 @@ int cmd_do_fray_status(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[
  */
 int cmd_do_test_frayA(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
 {
+       int i;
        print((uint8_t *)"Test fray 1, node A\r\n");
        configure_initialize_node_a(FRAY1);
        print((uint8_t *)"Initialized.\r\n");
-       Fr_StartCommunication(FRAY1);
+       if (fr_startup_procedure(1)) {
+               print((uint8_t*)"FlexRay can not start.\r\n");
+               return 0;
+       }
+       //Fr_StartCommunication(FRAY1);
        print((uint8_t *)"Communication started.\r\n");
-       while(1)
+       for (i = 0; i < 100; i++)
        {
                transmit_check_node_a(FRAY1);
+               print((uint8_t*)"MSG sent.\r\n");
        }
+       return 0;
 }
 
 /**
@@ -101,16 +108,23 @@ int cmd_do_test_frayA(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[]
  */
 int cmd_do_test_frayB(cmd_io_t *cmd_io, const struct cmd_des *des, char *param[])
 {
+       int i;
        print((uint8_t *)"Test fray 1, node B\r\n");
        configure_initialize_node_b(FRAY1);
        print((uint8_t *)"Initialized.\r\n");
-       Fr_StartCommunication(FRAY1);
+       if (fr_startup_procedure(1)) {
+               print((uint8_t*)"FlexRay can not start.\r\n");
+               return 0;
+       }
+       //Fr_StartCommunication(FRAY1);
        print((uint8_t *)"Communication started.\r\n");
 
-       while(1)
+       for (i = 0; i < 100; i++)
        {
                transmit_check_node_b(FRAY1);
+               print((uint8_t*)"MSG sent.\r\n");
        }
+       return 0;
 }
 
 /** Command descriptor for FlexRay status command */