代码拉取完成,页面将自动刷新
/*
* Copyright (C) 2023 HiHope Open Source Organization .
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
*
* limitations under the License.
*/
#ifndef PZCAR_NET_CONFIG_H
#define PZCAR_NET_CONFIG_H
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include "ohos_init.h"
#include "cmsis_os2.h"
#include "wifi_device.h"
#define AP_SSID "HiCar001"
#define AP_PSWD "12345678"
#define UDP_SERVERPORT (3861)
#define TCP_SERVERPORT (3862)
#define SERVER_UDP (1) // [1]-UDP Server
#define SERVER_TCP (0) // [1]-TCP Server
// 注意:当前项目中,任务数量已达到最大数量,当UDP Server和TCP Server同时运行的时候,
// UnisoundTask[云知声语音识别任务]就要关闭;
// 当退出 NetCtrl 模式的时候,如果需要在后台保持网络连接以及UDP Server在后台能工作,
// 就需要在UDP Server和TCP Server二选一
typedef enum {
flag_0, // 0-init
flag_1, // 1-bit0: UdpServer Recv SSID
flag_2, // 2-bit1: UdpServer Recv PSWD
flag_3, // 3-SSID+PSWD Ready
};
typedef enum {
Net_ST_DisCon = 0,
Net_ST_Conned = 1,
Net_ST_Config = 2,
Net_ST_MAX,
} NetState;
typedef enum {
Net_MODE_NET_SERVER = 0,
Net_MODE_NET_CONFIG,
Net_MODE_NET_MAX,
} NetCtrlMode;
extern char ssid[64];
extern char pswd[64];
extern char flag;
WifiErrorCode RegisterWifiEventListener(void);
WifiErrorCode UnRegisterWifiEventListener(void);
void OnHotspotStateChanged(int state);
void OnHotspotStaJoin(StationInfo* info);
void OnHotspotStaLeave(StationInfo* info);
WifiErrorCode StartHotspot(void);
WifiErrorCode StopHotspot(void);
void OnWifiConnectionChanged(int state, WifiLinkedInfo* info);
void OnWifiScanStateChanged(int state, int size);
WifiErrorCode StartStation(void);
WifiErrorCode StopStation(void);
void ProcessRecvMsg(unsigned char *buff, int msgLen);
osThreadId_t UdpServRecvTaskEntry(void);
osThreadId_t UdpServSendTaskEntry(void);
osThreadId_t TcpServRecvTaskEntry(void);
osThreadId_t TcpServSendTaskEntry(void);
osThreadId_t NetCtrlTaskEntry(void);
#endif //PZCAR_NET_CONFIG_H
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。