diff --git a/threadfunc/thread_func.cpp b/threadfunc/thread_func.cpp index e7eb96b..a0c0c3e 100644 --- a/threadfunc/thread_func.cpp +++ b/threadfunc/thread_func.cpp @@ -177,20 +177,13 @@ void UartStart() { gpio_set(GlobalConfig::GPIO_G.zigReset, 1); zlog_info(zbt, "GPIO Init"); -#ifdef IMX6UL_GATEWAY - InitGpio(GlobalConfig::GPIO_G.errorLed, 1); //指示灯 - gpio_set(GlobalConfig::GPIO_G.errorLed, 0); - InitGpio(GlobalConfig::GPIO_G.power, 1); // power reset - gpio_set(GlobalConfig::GPIO_G.power, 0); -#endif -#ifdef G2UL_GATEWAY InitGpio(GlobalConfig::GPIO_G.runLed, 1); InitGpio(GlobalConfig::GPIO_G.errorLed, 1); gpio_set(GlobalConfig::GPIO_G.runLed, 1); gpio_set(GlobalConfig::GPIO_G.errorLed, 0); InitGpio(GlobalConfig::GPIO_G.netResetNet0, 1); gpio_set(GlobalConfig::GPIO_G.netResetNet0, 0); -#endif + GlobalConfig::Zigbee_G.Serial_Rate = 0x07; GlobalConfig::Zigbee_G.Serial_DataB = 0x08; GlobalConfig::Zigbee_G.Serial_StopB = 0x01; @@ -204,8 +197,6 @@ void UartStart() { void InitModule() { #ifdef NR5G_MODULE -#ifdef G2UL_GATEWAY - InitGpio(GlobalConfig::GPIO_G.commPower, 1); // 4G,5G模组供电, gpio_set(GlobalConfig::GPIO_G.commPower, 1); InitGpio(GlobalConfig::GPIO_G.vol3_8, 1); // 5G 高电平3.8V,低电平3.3V @@ -213,15 +204,11 @@ void InitModule() { InitGpio(GlobalConfig::GPIO_G.commRest, 1); gpio_set(GlobalConfig::GPIO_G.commRest, 0); //高电平复位 -#endif // G2UL_GATEWAY -#ifdef IMX6UL_GATEWAY - InitGpio(GlobalConfig::GPIO_G.commRest, 1); - gpio_set(GlobalConfig::GPIO_G.commRest, 1); // -#endif // IMX6UL_GATEWAY + #endif // NR5G_MODULE #ifdef Q4G_MODULE -#ifdef G2UL_GATEWAY + InitGpio(GlobalConfig::GPIO_G.commPower, 1); // 4G,5G模组供电, gpio_set(GlobalConfig::GPIO_G.commPower, 1); InitGpio(GlobalConfig::GPIO_G.commRest, 1); @@ -231,21 +218,9 @@ void InitModule() { std::string strAPN = ReadStrByOpt(SERVERCONFIG, "Server", "APN"); sprintf(szquectel, "/opt/quectel-CM/quectel-CM -s %s &", strAPN.c_str()); system(szquectel); -#endif // G2UL_GATEWAY #endif // Q4G_MODULE #ifdef WIFI_MODULE zlog_info(zbt, "Init WiFi!"); - -#ifdef IMX6UL_GATEWAY - InitGpio(GlobalConfig::GPIO_G.wifiReset, 1); // WiFi模组复位,0复位,1取消复位 - gpio_set(GlobalConfig::GPIO_G.wifiReset, 1); - sleep(10); - wifi::WPAClient wpa; - wpa.ReconnectWiFi(); - system("/etc/init.d/wpa_restart"); - system("udhcpc -i wlan2 &"); -#endif // IMX6UL_GATEWAY -#ifdef G2UL_GATEWAY InitGpio(GlobalConfig::GPIO_G.wifiReset, 1); // WiFi模组复位,1复位,0取消复位 gpio_set(GlobalConfig::GPIO_G.wifiReset, 0); InitGpio(GlobalConfig::GPIO_G.wifiPower, 1); // WiFi模组上电 @@ -255,7 +230,6 @@ void InitModule() { wpa.ReconnectWiFi(); system("/usr/sbin/wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf &"); system("udhcpc -b -i wlan0 &"); -#endif // G2UL_GATEWAY #endif // WIFI_MODULE } diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index fdce1a1..dcb4184 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -998,8 +998,7 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan } else { zlog_warn(zct, "send data , filename %s,size = %d\n", strFileName.c_str(), vecData.size()); } - -#ifdef G2UL_GATEWAY //存储6条波形数据 + char whereCon[1024] = {0x00}; char updateSql[1024] = {0x00}; char tmpWhere[128] = {0x00}; @@ -1043,8 +1042,6 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan system(tmpCmd); zlog_info(zct, "rm dat file %s ", tmpCmd); } - -#endif zlog_info(zct, "write data to filename %s", strFileName.c_str()); std::vector().swap(vecData); sleep(1); diff --git a/wifi_5g/wpa_client.h b/wifi_5g/wpa_client.h index 83f62c6..ec59e33 100644 --- a/wifi_5g/wpa_client.h +++ b/wifi_5g/wpa_client.h @@ -13,12 +13,8 @@ #include "common/global.hpp" namespace wifi { -#ifdef G2UL_GATEWAY const std::string WPA_PATH = "/var/run/wpa_supplicant/wlan0"; //进程间通信地址加上网络接口额名称 -#endif -#ifdef IMX6UL_GATEWAY -const std::string WPA_PATH = "/var/run/wpa_supplicant/wlan2"; //进程间通信地址加上网络接口额名称 -#endif + struct WPAContext { int s; struct sockaddr_un local;