fix wifi bugs 2

This commit is contained in:
zhangsheng 2025-03-13 17:46:29 +08:00
parent c3d8b5cb66
commit e59d824ce8
4 changed files with 74 additions and 72 deletions

View File

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-469859550318386951" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1289772839912558009" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="-469859009740510951" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.internal.build.crossgcc.CrossGCCBuiltinSpecsDetector" console="false" env-hash="1289773380490434009" id="org.eclipse.cdt.build.crossgcc.CrossGCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT Cross GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

View File

@ -1,67 +1,69 @@
#ifndef GLOBAL_HPP_
#define GLOBAL_HPP_
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <sys/syscall.h>
#include <signal.h>
#include "common_func.hpp"
//#define SECTION_MAX_LEN 1024
//******************** 全局变量**********************
enum enumZigBeeTransmitStatus {
NO_ENTER_TRANSMITTING_STATUS = 0,
ENTER_TRANSMITTING_STATUS
};
//#define NR5G_MODULE
#define Q4G_MODULE
//#define WIFI_MODULE
//#define NR5G_MEIGE
class GlobalConfig
{
public :
static int RUN_MODE; //1调试模式 0运行模式
static int QuitFlag_G; //程序退出标志
static int LinkStatus_G; //和服务器连接状态
static int LinkCount;
static int NetSignal;
static int serverStatus;
static int net0Status;
static std::string NR5GTemp;
static std::string NetStatus;
static std::string NetType;
static std::string Version; //软件版本号
static std::string MacAddr_G; //设备MAC地址
static std::string MacAddr_G2; //设备光纤MAC地址
static std::string IpAddr_G; //设备IP
static std::string DbName_G; //数据库名字
static std::string Config_G; //配置文件
static std::string ServerIP; //服务器地址
static int ServerPort; //服务器端口
static int threadStatus;
static std::string UartName_G;
static TopicList Topic_G; //发布的主题
static ZigbeeInfo ZigbeeInfo_G; //gateway zigbee info
static ZIGBEE Zigbee_G;
static GPIOInfo GPIO_G;
static enumZigBeeTransmitStatus EnterZigBeeWaveTransmittingFlag_G; // 进入ZigBee网络原始数据传输状态标志
static int EnterZigBeeWaveTransmittingCnt_G; // 进入ZigBee网络原始数据传输状态计数器以秒为单位进行计数
static int day;
};
#define SAVE_COUNT 4320
#define OneWeek 432000 //5天
//按8 取整
#define Length_(len) do{ \
len = ((((len>>3) + ((len&0x7)>0?1:0))<<4) + 8); \
} while (0)
#endif
#ifndef GLOBAL_HPP_
#define GLOBAL_HPP_
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <sys/syscall.h>
#include <signal.h>
#include "common_func.hpp"
//#define SECTION_MAX_LEN 1024
//******************** 全局变量**********************
enum enumZigBeeTransmitStatus {
NO_ENTER_TRANSMITTING_STATUS = 0,
ENTER_TRANSMITTING_STATUS
};
//#define NR5G_MODULE
//#define Q4G_MODULE
//#define WIFI_MODULE
//#define NR5G_MEIGE
class GlobalConfig
{
public :
static int RUN_MODE; //1调试模式 0运行模式
static int QuitFlag_G; //程序退出标志
static int LinkStatus_G; //和服务器连接状态
static int LinkCount;
static int NetSignal;
static int serverStatus;
static int net0Status;
static std::string NR5GTemp;
static std::string NetStatus;
static std::string NetType;
static std::string Version; //软件版本号
static std::string MacAddr_G; //设备MAC地址
static std::string MacAddr_G2; //设备光纤MAC地址
static std::string IpAddr_G; //设备IP
static std::string DbName_G; //数据库名字
static std::string Config_G; //配置文件
static std::string ServerIP; //服务器地址
static int ServerPort; //服务器端口
static int threadStatus;
static std::string UartName_G;
static TopicList Topic_G; //发布的主题
static ZigbeeInfo ZigbeeInfo_G; //gateway zigbee info
static ZIGBEE Zigbee_G;
static GPIOInfo GPIO_G;
static enumZigBeeTransmitStatus EnterZigBeeWaveTransmittingFlag_G; // 进入ZigBee网络原始数据传输状态标志
static int EnterZigBeeWaveTransmittingCnt_G; // 进入ZigBee网络原始数据传输状态计数器以秒为单位进行计数
static int day;
};
#define SAVE_COUNT 4800*4
#define OneWeek 604800*7
//按8 取整
#define Length_(len) do{ \
len = ((((len>>3) + ((len&0x7)>0?1:0))<<4) + 8); \
} while (0)
#endif

View File

@ -167,7 +167,7 @@ std::string JsonData::JsonCmd_Cgi_52(Param_52 &param) {
std::vector<std::string> vecSsid;
boost::split(vecSsid, netssid, boost::is_any_of("\n"), boost::token_compress_off);
jsBody["type"] = "SCAN";
zlog_info(zct,"netssid : %s %d", netssid.c_str(), vecSsid.size());
zlog_info(zct,"netssid : %s ==== %d", netssid.c_str(), vecSsid.size());
for (unsigned int i = 1; i < vecSsid.size() - 1; i++) {
std::vector<std::string> data;
boost::split(data, vecSsid[i], boost::is_any_of("\t"), boost::token_compress_off);

View File

@ -409,8 +409,8 @@ bool WPAClient::Request(WPAContext *context, const std::string &cmd, std::string
res = select(wpa_context_->s + 1, &rfds, NULL, NULL, &tv);
if (res < 0) return false;
if (FD_ISSET(wpa_context_->s, &rfds)) {
char temp[1024] = {0};
int temp_len = 1024;
char temp[1024 * 3] = {0};
int temp_len = 1024 * 3;
res = recv(wpa_context_->s, temp, temp_len, 0);
if (res < 0) return false;
if (res > 0 && temp[0] == '<') {