|
@@ -64,6 +64,7 @@ int GetCardSerialNumber();
|
|
|
void setLedMotion(unsigned char gun_index,unsigned char led_mode);
|
|
|
void setRequest(unsigned char gun_index,unsigned char isOn);
|
|
|
void setSpeaker(unsigned char isOn, unsigned char speaker_mode);
|
|
|
+void gpio_set_value(unsigned int gpio, unsigned int value);
|
|
|
|
|
|
//==========================
|
|
|
// Declare RFID module type
|
|
@@ -459,6 +460,31 @@ int getEth0MacAddress()
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+int isUap0up(void)
|
|
|
+{
|
|
|
+ int result = FAIL;
|
|
|
+
|
|
|
+ FILE *fp;
|
|
|
+ char cmd[256];
|
|
|
+ char buf[512];
|
|
|
+
|
|
|
+ strcpy(cmd, "ifconfig uap0");;
|
|
|
+ fp = popen(cmd, "r");
|
|
|
+ if(fp != NULL)
|
|
|
+ {
|
|
|
+ while(fgets(buf, sizeof(buf), fp) != NULL)
|
|
|
+ {
|
|
|
+ if(strstr(buf, "uap0") > 0)
|
|
|
+ {
|
|
|
+ result = PASS;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ pclose(fp);
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
//======================================================
|
|
|
// OCPP routine
|
|
|
//======================================================
|
|
@@ -2654,7 +2680,7 @@ void InitEthernet()
|
|
|
{
|
|
|
DEBUG_WARN("WIFI/4G module reset.\n");
|
|
|
gpio_set_value(GPIO_OUT_RST_4G_WIFI, ON);
|
|
|
- sleep(1);
|
|
|
+ sleep(3);
|
|
|
gpio_set_value(GPIO_OUT_RST_4G_WIFI, OFF);
|
|
|
}
|
|
|
|