Browse Source

[Add][Modularization][Module_4g]

2022.11.04 / Folus Wen

Actions:
1. Disable 2G band when network mode in auto.

Files:
1. As follow commit history

Image version: V0.25
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
Folus Wen 2 years ago
parent
commit
809b1a7ccd
2 changed files with 14 additions and 3 deletions
  1. BIN
      EVSE/GPL/uecho-1.2.3/examples - 捷徑.lnk
  2. 14 3
      EVSE/Modularization/Module_4g.c

BIN
EVSE/GPL/uecho-1.2.3/examples - 捷徑.lnk


+ 14 - 3
EVSE/Modularization/Module_4g.c

@@ -112,7 +112,7 @@ void substr(char *dest, const char* src, unsigned int start, unsigned int cnt);
 
 char *portName[3] 				= {"/dev/ttyUSB2", "/dev/ttyACM2", "/dev/ttyACM2"};
 char *valid_Internet[2] 		= {"8.8.8.8", "180.76.76.76"};
-char *Version_And_Date[2]		= {"V0.14","2022-09-12"};
+char *Version_And_Date[2]		= {"V0.15","2022-11-04"};
 pid_t	pid;
 
 struct dongle_info
@@ -224,12 +224,12 @@ int InitShareMemory()
    	//creat ShmOCPP16Data
 	if ((MeterSMId = shmget(ShmOcppModuleKey, sizeof(struct OCPP16Data),  0777)) < 0)
 	{
-		DEBUG_ERROR("shmget ShmOCPP16Data NG");
+		DEBUG_ERROR("shmget ShmOCPP16Data NG\n");
 		result = FAIL;
 	}
 	else if ((ShmOCPP16Data = shmat(MeterSMId, NULL, 0)) == (void *) -1)
 	{
-		DEBUG_ERROR("shmat ShmOCPP16Data NG");
+		DEBUG_ERROR("shmat ShmOCPP16Data NG\n");
 		result = FAIL;
 	}
 	else
@@ -1357,6 +1357,17 @@ void configNetworkMode(uint8_t actReq)
 			if(strstr(str, "ATE1") != NULL)
 			{
 				fprintf(fpDst, "	OK		\"AT+QCFG=\\\"nwscanmode\\\",%d,1\"	\\\n", actReq);
+
+				if(actReq != NETWORK_MODE_GSM)
+				{
+					// Disable 2G band
+					fprintf(fpDst, "	OK		\"AT+QCFG=\\\"band\\\",3F0\"	\\\n");
+				}
+				else
+				{
+					// Enable 2G band
+					fprintf(fpDst, "	OK		\"AT+QCFG=\\\"band\\\",3FF\"	\\\n");
+				}
 			}
 			memset(str, 0x00, ARRAY_SIZE(str));
 		}