Pārlūkot izejas kodu

[Improve][DM30][DW30][ReadCmdline] Add detailed description of all ReadCmdline command, add example for commands.

2020.08.11 / TC Hsu

Actions: Modify msg in ReadCmdline.c, add detailed description and example.

Image version    : N/A
Image checksum   : N/A

Hardware PWB P/N : N/A
Hardware Version : N/A

Files:

	modified:   EVSE/Projects/DM30/Apps/ReadCmdline.c
	modified:   EVSE/Projects/DW30/Apps/ReadCmdline.c
TC_Hsu 4 gadi atpakaļ
vecāks
revīzija
f5c2474168

+ 142 - 3
EVSE/Projects/DM30/Apps/ReadCmdline.c

@@ -74,13 +74,150 @@ struct PsuData                  *ShmPsuData;
 struct ChargingInfoData         *_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
 struct ChargingInfoData         *ac_chargingInfo[AC_QUANTITY];
 
-char *msg = "state  : get gun state (index) \n"
-            "card   : scanning card (x) : \n"
+char *msg = "\n"
+            "state  : get/set gun state (index)\n"
+            "     Example:\n"
+            "       state ac   , get AC status, AC not support set command.\n"
+            "       state 0    , get DC connector 1 status\n"
+            "       state 1    , get DC connector 2 status\n"
+            "       state 0 0  , set DC connector 1 to state 0\n"
+            "       state 1 5  , set DC connector 2 to state 5\n"
+            "\n"
+            "card   : swiping card simulation (card number), if parameter 1 is empty, means execute\n"
+            "         virtual swiping action \n"
+            "     Example:\n"
+            "       card         , virtual swiping card (start or stop charging).\n"
+            "       card abcdef  , write virtual card ID 'abcdef'.\n"
+            "\n"
             "gun    : get gun plugit state (index) \n"
+            "     Example:\n"
+            "       gun ac    , get AC connector/socket plug status\n"
+            "       gun ac 1  , set AC connector/socket plug status to pluged\n"
+            "       gun ac 0  , set AC connector/socket plug status to unpluged\n"
+            "       gun 0     , get DC connector 1 plug status\n"
+            "       gun 0 1   , set DC connector 1 plug status to pluged\n"
+            "       gun 1 0   , set DC connector 2 plug status to unpluged\n"
+            "\n"
             "lock   : get gun locked state (index) \n"
+            "     Example:\n"
+            "       lock 0     , get DC connector 1 lock status\n"
+            "       lock 0 1   , set DC connector 1 lock status to locked\n"
+            "       lock 1 0   , set DC connector 2 lock status to unlocked\n"
+            "\n"
             "self   : self test state (x) \n"
+            "     Example:\n"
+            "       self       , get present self status\n"
+            "\n"
             "ver    : ver of board (407 or index or rb or fan) \n"
-            "ac     : get ac relay state (x) \n";
+            "     Example:\n"
+            "       ver 0      , get firmware version of DC connector 1's EV board\n"
+            "       ver 1      , get firmware version of DC connector 2's EV board\n"
+            "       ver 407    , get firmware version of stm32f407 in DC main board\n"
+            "       ver rb     , get firmware version of relay board\n"
+            "       ver fan    , get firmware version of fan board\n"
+            "       ver dc     , get firmware version of am3352 in DC main board\n"
+            "       ver led    , get firmware version of LED board\n"
+            "       ver ac     , get firmware version of AC charger\n"
+            "\n"
+            "ac     : get ac contactor state (x) \n"
+            "     Example:\n"
+            "       ac         , get AC contactor status (1 is close, 0 is open)\n"
+            "\n"
+            "cable  : set cable check (IMD) result, 1: pass, 2: failed, 3: warning\n"
+            "     Example:\n"
+            "       cable 0 1  , set DC connector 1 IMD result to pass\n"
+            "       cable 1 2  , set DC connector 2 IMD result to failed\n"
+            "\n"
+            "pow    : set target charging current, only for force charging use!!!\n"
+            "     Example:\n"
+            "       pow 20    , set target charging current to 20 A \n"
+            "       pow 10.5  , set target charging current to 10.5 A\n"
+            "\n"
+            "model  : get model name, serial number and misc system information\n"
+            "     Example:\n"
+            "       model     , get information\n"
+            "\n"
+            "select : get/set present selected connector\n"
+            "     Example:\n"
+            "       select    , get present select connector number\n"
+            "       select 0  , set present select connector to connector 1\n"
+            "       select 1  , set present select connector to connector 2\n"
+            "\n"
+            "change : vitural gun select button press\n"
+            "     Example:\n"
+            "       change    , simulate the gun select button pressed\n"
+            "\n"
+            "fan    : set fan speed\n"
+            "     Example:\n"
+            "       fan 3000  , set fan speed to 3000 rpm\n"
+            "       fan 14000 , set fan speed to 14000 rpm\n"
+            "\n"
+            "speed  : get fan speed\n"
+            "     Example:\n"
+            "       speed     , get present fan speed\n"
+            "\n"
+            "debug  : set debug mode\n"
+            "     Example:\n"
+            "       debug 1   , enable debug mode, print debug log to console\n"
+            "       debug 0   , disable debug mode, print debug log to log file\n"
+            "\n"
+            "gfd    : set gfd(IMD) enable/disable in force charging\n"
+            "     Example:\n"
+            "       gfd 1     , enable IMD test in force charging mode\n"
+            "       gfd 0     , disable IMD test in force charging mode\n"
+            "\n"
+            "temp   : get temperature from PSU\n"
+            "     Example:\n"
+            "       temp      , display the present temperature of PSU\n"
+            "\n"
+            "acin   : get 3 phase voltage of AC input\n"
+            "     Example:\n"
+            "       acin      , display R(L1) S(L2) T(L3) voltage\n"
+            "\n"
+            "psu   : get psu information and psu test command\n"
+            "     Example:\n"
+            "       psu count         , display present PSU quantity\n"
+            "       psu ver           , display primary and secondly firmware version of all PSU\n"
+            "       psu cap           , display available current and power of all PSU group\n"
+            "       psu input         , display 3 phase voltage of AC input which sensing by PSU\n"
+            "       psu output        , display present DC output voltage and current of all PSU group\n"
+            "       psu test 1        , enable PSU test mode, for D to D and PFC firmware version 9.06 up\n"
+            "                           after PSU test  finish, please reboot charger to exit PSU test mode\n"
+            "       psu out 500 5     , need enable mode first, command PSU output 500V and 5A\n"
+            "       psu out 200.5 7.5 , need enable mode first, command PSU output 200.5V and 7.5A\n"
+            "\n"
+            "cap   : get maximum output capacities\n"
+            "     Example:\n"
+            "       cap 0     , get initial and real maximum output power, voltage and current of connector 1\n"
+            "       cap 1     , get initial and real maximum output power, voltage and current of connector 2\n"
+            "\n"
+            "error : triggering error event\n"
+            "     Example:\n"
+            "       error 1   , virtual trigging L1 input OVP\n"
+            "       error 0   , cancel trigging L1 input OVP\n"
+            "\n"
+            "auth  : setup authorize flag, it is for charging permission\n"
+            "     Example:\n"
+            "       auth 1    , setup authorize flag to vaild\n"
+            "\n"
+            "relay : get present output and pre-charge relay status\n"
+            "     Example:\n"
+            "       relay 0  , get present output relay status of connector 1\n"
+            "       relay 1  , get present output relay status of connector 2\n"
+            "\n"
+            "ccid  : set EVCC ID\n"
+            "     Example:\n"
+            "       ccid 0 1a2b3c4d , setup EVCC ID '1a2b3c4d' to connector 1\n"
+            "       ccid 1 qwerasdf , setup EVCC ID 'qwerasdf' to connector 2\n"
+            "\n"
+            "strchg : command charger to start force charging procedure\n"
+            "         1st parameter for select using connector\n"
+            "         2nd parameter for command output voltage, range: 150V~1000V\n"
+            "         3th parameter for command output current, range: 2A~100A\n"
+            "     Example:\n"
+            "       strchg 0 200 2      , command force charging output 200V and 2A from connector 1\n"
+            "       strchg 1 450.5 10.5 , command force charging output 450.5V and 10.5A from connector 2\n"
+            ;
 
 bool FindChargingInfoData(byte target, struct ChargingInfoData **chargingData)
 {
@@ -1116,6 +1253,8 @@ int main(void)
         return 0;
     }
 
+    printf ("%s\n", msg);
+
     for(;;)
     {
         char word[128];

+ 142 - 3
EVSE/Projects/DW30/Apps/ReadCmdline.c

@@ -74,13 +74,150 @@ struct PsuData                  *ShmPsuData;
 struct ChargingInfoData         *_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
 struct ChargingInfoData         *ac_chargingInfo[AC_QUANTITY];
 
-char *msg = "state  : get gun state (index) \n"
-            "card   : scanning card (x) : \n"
+char *msg = "\n"
+            "state  : get/set gun state (index)\n"
+            "     Example:\n"
+            "       state ac   , get AC status, AC not support set command.\n"
+            "       state 0    , get DC connector 1 status\n"
+            "       state 1    , get DC connector 2 status\n"
+            "       state 0 0  , set DC connector 1 to state 0\n"
+            "       state 1 5  , set DC connector 2 to state 5\n"
+            "\n"
+            "card   : swiping card simulation (card number), if parameter 1 is empty, means execute\n"
+            "         virtual swiping action \n"
+            "     Example:\n"
+            "       card         , virtual swiping card (start or stop charging).\n"
+            "       card abcdef  , write virtual card ID 'abcdef'.\n"
+            "\n"
             "gun    : get gun plugit state (index) \n"
+            "     Example:\n"
+            "       gun ac    , get AC connector/socket plug status\n"
+            "       gun ac 1  , set AC connector/socket plug status to pluged\n"
+            "       gun ac 0  , set AC connector/socket plug status to unpluged\n"
+            "       gun 0     , get DC connector 1 plug status\n"
+            "       gun 0 1   , set DC connector 1 plug status to pluged\n"
+            "       gun 1 0   , set DC connector 2 plug status to unpluged\n"
+            "\n"
             "lock   : get gun locked state (index) \n"
+            "     Example:\n"
+            "       lock 0     , get DC connector 1 lock status\n"
+            "       lock 0 1   , set DC connector 1 lock status to locked\n"
+            "       lock 1 0   , set DC connector 2 lock status to unlocked\n"
+            "\n"
             "self   : self test state (x) \n"
+            "     Example:\n"
+            "       self       , get present self status\n"
+            "\n"
             "ver    : ver of board (407 or index or rb or fan) \n"
-            "ac     : get ac relay state (x) \n";
+            "     Example:\n"
+            "       ver 0      , get firmware version of DC connector 1's EV board\n"
+            "       ver 1      , get firmware version of DC connector 2's EV board\n"
+            "       ver 407    , get firmware version of stm32f407 in DC main board\n"
+            "       ver rb     , get firmware version of relay board\n"
+            "       ver fan    , get firmware version of fan board\n"
+            "       ver dc     , get firmware version of am3352 in DC main board\n"
+            "       ver led    , get firmware version of LED board\n"
+            "       ver ac     , get firmware version of AC charger\n"
+            "\n"
+            "ac     : get ac contactor state (x) \n"
+            "     Example:\n"
+            "       ac         , get AC contactor status (1 is close, 0 is open)\n"
+            "\n"
+            "cable  : set cable check (IMD) result, 1: pass, 2: failed, 3: warning\n"
+            "     Example:\n"
+            "       cable 0 1  , set DC connector 1 IMD result to pass\n"
+            "       cable 1 2  , set DC connector 2 IMD result to failed\n"
+            "\n"
+            "pow    : set target charging current, only for force charging use!!!\n"
+            "     Example:\n"
+            "       pow 20    , set target charging current to 20 A \n"
+            "       pow 10.5  , set target charging current to 10.5 A\n"
+            "\n"
+            "model  : get model name, serial number and misc system information\n"
+            "     Example:\n"
+            "       model     , get information\n"
+            "\n"
+            "select : get/set present selected connector\n"
+            "     Example:\n"
+            "       select    , get present select connector number\n"
+            "       select 0  , set present select connector to connector 1\n"
+            "       select 1  , set present select connector to connector 2\n"
+            "\n"
+            "change : vitural gun select button press\n"
+            "     Example:\n"
+            "       change    , simulate the gun select button pressed\n"
+            "\n"
+            "fan    : set fan speed\n"
+            "     Example:\n"
+            "       fan 3000  , set fan speed to 3000 rpm\n"
+            "       fan 14000 , set fan speed to 14000 rpm\n"
+            "\n"
+            "speed  : get fan speed\n"
+            "     Example:\n"
+            "       speed     , get present fan speed\n"
+            "\n"
+            "debug  : set debug mode\n"
+            "     Example:\n"
+            "       debug 1   , enable debug mode, print debug log to console\n"
+            "       debug 0   , disable debug mode, print debug log to log file\n"
+            "\n"
+            "gfd    : set gfd(IMD) enable/disable in force charging\n"
+            "     Example:\n"
+            "       gfd 1     , enable IMD test in force charging mode\n"
+            "       gfd 0     , disable IMD test in force charging mode\n"
+            "\n"
+            "temp   : get temperature from PSU\n"
+            "     Example:\n"
+            "       temp      , display the present temperature of PSU\n"
+            "\n"
+            "acin   : get 3 phase voltage of AC input\n"
+            "     Example:\n"
+            "       acin      , display R(L1) S(L2) T(L3) voltage\n"
+            "\n"
+            "psu   : get psu information and psu test command\n"
+            "     Example:\n"
+            "       psu count         , display present PSU quantity\n"
+            "       psu ver           , display primary and secondly firmware version of all PSU\n"
+            "       psu cap           , display available current and power of all PSU group\n"
+            "       psu input         , display 3 phase voltage of AC input which sensing by PSU\n"
+            "       psu output        , display present DC output voltage and current of all PSU group\n"
+            "       psu test 1        , enable PSU test mode, for D to D and PFC firmware version 9.06 up\n"
+            "                           after PSU test  finish, please reboot charger to exit PSU test mode\n"
+            "       psu out 500 5     , need enable mode first, command PSU output 500V and 5A\n"
+            "       psu out 200.5 7.5 , need enable mode first, command PSU output 200.5V and 7.5A\n"
+            "\n"
+            "cap   : get maximum output capacities\n"
+            "     Example:\n"
+            "       cap 0     , get initial and real maximum output power, voltage and current of connector 1\n"
+            "       cap 1     , get initial and real maximum output power, voltage and current of connector 2\n"
+            "\n"
+            "error : triggering error event\n"
+            "     Example:\n"
+            "       error 1   , virtual trigging L1 input OVP\n"
+            "       error 0   , cancel trigging L1 input OVP\n"
+            "\n"
+            "auth  : setup authorize flag, it is for charging permission\n"
+            "     Example:\n"
+            "       auth 1    , setup authorize flag to vaild\n"
+            "\n"
+            "relay : get present output and pre-charge relay status\n"
+            "     Example:\n"
+            "       relay 0  , get present output relay status of connector 1\n"
+            "       relay 1  , get present output relay status of connector 2\n"
+            "\n"
+            "ccid  : set EVCC ID\n"
+            "     Example:\n"
+            "       ccid 0 1a2b3c4d , setup EVCC ID '1a2b3c4d' to connector 1\n"
+            "       ccid 1 qwerasdf , setup EVCC ID 'qwerasdf' to connector 2\n"
+            "\n"
+            "strchg : command charger to start force charging procedure\n"
+            "         1st parameter for select using connector\n"
+            "         2nd parameter for command output voltage, range: 150V~1000V\n"
+            "         3th parameter for command output current, range: 2A~100A\n"
+            "     Example:\n"
+            "       strchg 0 200 2      , command force charging output 200V and 2A from connector 1\n"
+            "       strchg 1 450.5 10.5 , command force charging output 450.5V and 10.5A from connector 2\n"
+            ;
 
 bool FindChargingInfoData(byte target, struct ChargingInfoData **chargingData)
 {
@@ -1116,6 +1253,8 @@ int main(void)
         return 0;
     }
 
+    printf ("%s\n", msg);
+
     for(;;)
     {
         char word[128];