| /*-----------------------------------------------------------------------------------------------*/ |
| /** |
| @file ql_wifi_internal.h |
| @brief WIFI internal define |
| */ |
| /*-----------------------------------------------------------------------------------------------*/ |
| |
| /*------------------------------------------------------------------------------------------------- |
| Copyright (c) 2018 Quectel Wireless Solution, Co., Ltd. All Rights Reserved. |
| Quectel Wireless Solution Proprietary and Confidential. |
| -------------------------------------------------------------------------------------------------*/ |
| |
| /*------------------------------------------------------------------------------------------------- |
| EDIT HISTORY |
| This section contains comments describing changes made to the file. |
| Notice that changes are listed in reverse chronological order. |
| $Header: $ |
| when who what, where, why |
| -------- --- -------------------------------------------uint8_t--------------- |
| 2020-11-09 tyler.kuang Created . |
| -------------------------------------------------------------------------------------------------*/ |
| |
| #ifndef __QL_WIFI_INTERNAL_H__ |
| #define __QL_WIFI_INTERNAL_H__ |
| #include <stdint.h> |
| #include "ql_wifi_common.h" |
| |
| #define QL_WIFI_SRV_READY_FLAG "/tmp/ql_wifi_service_ready.flag" |
| typedef struct |
| { |
| int msg_id; |
| int msg_req_size; |
| int msg_rsp_size; |
| } ql_wifi_msg_t; |
| |
| typedef enum |
| { |
| QL_WIFI_REQ_MSG_ID_IM = 0, |
| QL_WIFI_REQ_MSG_ID_SET_ENABLE, |
| QL_WIFI_REQ_MSG_ID_GET_STATUS, |
| QL_WIFI_REQ_MSG_ID_SET_CFG, |
| QL_WIFI_REQ_MSG_ID_GET_CFG, |
| QL_WIFI_REQ_MSG_ID_SET_AP_CFG, |
| QL_WIFI_REQ_MSG_ID_GET_AP_CFG, |
| QL_WIFI_REQ_MSG_ID_START_AP, |
| QL_WIFI_REQ_MSG_ID_GET_AP_STATUS, |
| QL_WIFI_REQ_MSG_ID_SET_STA_CFG, |
| QL_WIFI_REQ_MSG_ID_GET_STA_CFG, |
| QL_WIFI_REQ_MSG_ID_START_STA, |
| QL_WIFI_REQ_MSG_ID_GET_STA_STATUS, |
| QL_WIFI_REQ_MSG_ID_STA_START_SCAN, |
| QL_WIFI_REQ_MSG_ID_P2P_SET_CFG, |
| QL_WIFI_REQ_MSG_ID_P2P_GET_CFG, |
| QL_WIFI_REQ_MSG_ID_P2P_ENABLE, |
| QL_WIFI_REQ_MSG_ID_P2P_DEV_FIND, |
| QL_WIFI_REQ_MSG_ID_P2P_CONNECT, |
| QL_WIFI_REQ_MSG_ID_P2P_DISCONNECT, |
| QL_WIFI_REQ_MSG_ID_P2P_GET_STATUS, |
| QL_WIFI_REQ_MSG_ID_EVENT_REG, |
| QL_WIFI_IND_MSG_ID_WIFI_STATUS, |
| QL_WIFI_IND_MSG_ID_WIFI_AP_STATUS, |
| QL_WIFI_IND_MSG_ID_WIFI_STA_STATUS, |
| QL_WIFI_IND_MSG_ID_WIFI_STA_SCAN_RESULT, |
| QL_WIFI_IND_MSG_ID_WIFI_AP_STA_CONNECT, |
| QL_WIFI_IND_MSG_ID_WIFI_P2P_ENABLE_STATUS, |
| QL_WIFI_IND_MSG_ID_WIFI_P2P_DEV_FOUND, |
| QL_WIFI_IND_MSG_ID_WIFI_P2P_PEER_DEV_REQ, |
| QL_WIFI_IND_MSG_ID_WIFI_P2P_STATUS |
| } QL_WIFI_REQ_MSG_ID_E; |
| |
| typedef struct { |
| uint8_t is_enable; |
| }ql_wifi_req_msg_set_wifi_enable_t; |
| |
| typedef struct { |
| QL_WIFI_ENABLE_STATUS_E status; |
| }ql_wifi_rsp_msg_get_wifi_status_t; |
| |
| typedef struct { |
| uint8_t work_mode_valid; |
| QL_WIFI_WORK_MODE_E work_mode; |
| uint8_t country_code_valid; |
| uint8_t bridge_code_valid; |
| char country_code[3]; |
| char bridge[50]; |
| } ql_wifi_req_msg_set_wifi_cfg_t; |
| |
| typedef struct { |
| QL_WIFI_WORK_MODE_E work_mode; |
| char country_code[3]; |
| } ql_wifi_rsp_msg_get_wifi_cfg_t; |
| |
| typedef struct{ |
| QL_WIFI_AP_INDEX_E idx; |
| uint8_t ssid_valid; |
| char ssid[33]; |
| uint8_t mode_valid; |
| QL_WIFI_AP_MODE_TYPE_E mode; |
| uint8_t auth_valid; |
| ql_wifi_ap_auth_t auth; |
| uint8_t channel_valid; |
| uint16_t channel; |
| uint8_t bandwidth_valid; |
| QL_WIFI_BANDWIDTH_E bandwidth; |
| uint8_t max_sta_valid; |
| uint8_t max_sta; |
| uint8_t isolate_valid; |
| uint8_t isolate; |
| uint8_t ssid_hidden_valid; |
| uint8_t ssid_hidden; |
| uint8_t country_code_valid; |
| char country_code[3]; |
| uint8_t acl_rule_valid; |
| QL_WIFI_MAC_ACL_RULE_E acl_rule; |
| uint8_t acl_mac_valid; |
| QL_WIFI_ACL_MAC_CMD_E cmd; |
| char macaddr[18]; |
| } ql_wifi_req_msg_set_wifi_ap_cfg_t; |
| |
| typedef struct |
| { |
| QL_WIFI_AP_INDEX_E idx; |
| } ql_wifi_req_msg_get_wifi_ap_cfg_t; |
| |
| typedef struct{ |
| QL_WIFI_AP_INDEX_E idx; |
| char ssid[33]; |
| char country_code[3]; |
| QL_WIFI_AP_MODE_TYPE_E mode; |
| ql_wifi_ap_auth_t auth; |
| uint16_t channel; |
| QL_WIFI_BANDWIDTH_E bandwidth; |
| uint8_t max_sta; |
| uint8_t isolate; |
| uint8_t ssid_hidden; |
| QL_WIFI_MAC_ACL_RULE_E acl_rule; |
| ql_wifi_acl_mac_list_t mac_list; |
| } ql_wifi_rsp_msg_get_wifi_ap_cfg_t; |
| |
| typedef struct { |
| QL_WIFI_AP_INDEX_E idx; |
| uint8_t is_start; |
| }ql_wifi_req_msg_start_wifi_ap_t; |
| |
| typedef struct { |
| QL_WIFI_AP_INDEX_E idx; |
| }ql_wifi_req_msg_get_wifi_ap_status_t; |
| |
| typedef struct { |
| ql_wifi_ap_status_t status; |
| }ql_wifi_rsp_msg_get_wifi_ap_status_t; |
| |
| typedef struct { |
| uint8_t ssid_valid; |
| char ssid[33]; |
| uint8_t auth_valid; |
| ql_wifi_ap_auth_t auth; |
| } ql_wifi_req_msg_set_wifi_sta_cfg_t; |
| |
| typedef struct { |
| char ssid[33]; |
| ql_wifi_sta_auth_t auth; |
| } ql_wifi_rsp_msg_get_wifi_sta_cfg_t; |
| |
| typedef struct { |
| uint8_t is_start; |
| } ql_wifi_req_msg_start_wifi_sta_t; |
| |
| typedef struct { |
| ql_wifi_sta_status_t status; |
| } ql_wifi_rsp_msg_get_wifi_sta_status_t; |
| |
| typedef struct { |
| uint8_t is_enable; |
| }ql_wifi_req_msg_p2p_enable_t; |
| |
| typedef struct{ |
| uint8_t dev_name_valid; |
| char dev_name[32]; |
| uint8_t dev_type_valid; |
| char dev_type[32]; |
| uint8_t oper_class_channel_valid; |
| int oper_class; |
| int oper_channel; |
| uint8_t ssid_postfix_valid; |
| char ssid_postfix[32]; |
| } ql_wifi_req_msg_p2p_set_cfg_t; |
| |
| typedef struct{ |
| char dev_name[32]; |
| char dev_type[32]; |
| char ssid_postfix[32]; |
| int oper_class; |
| int oper_channel; |
| } ql_wifi_req_msg_p2p_get_cfg_t; |
| |
| typedef struct { |
| uint8_t is_find; |
| }ql_wifi_req_msg_p2p_dev_find_t; |
| |
| typedef struct { |
| char macaddr[18]; |
| char method[9]; |
| int go_intent; |
| }ql_wifi_req_msg_p2p_connect_t; |
| |
| typedef struct { |
| ql_wifi_p2p_status_t status; |
| } ql_wifi_rsp_msg_p2p_get_status_t; |
| |
| typedef struct { |
| uint8_t wifi_valid; |
| uint8_t wifi; |
| uint8_t wifi_ap_valid; |
| uint8_t wifi_ap; |
| uint8_t wifi_sta_valid; |
| uint8_t wifi_sta; |
| uint8_t wifi_sta_scan_vaild; |
| uint8_t wifi_sta_scan; |
| uint8_t wifi_ap_sta_connect_valid; |
| uint8_t wifi_ap_sta_connect; |
| uint8_t wifi_p2p_enable_status_valid; |
| uint8_t wifi_p2p_enable_status; |
| uint8_t wifi_p2p_dev_found_valid; |
| uint8_t wifi_p2p_dev_found; |
| uint8_t wifi_p2p_peer_dev_req_valid; |
| uint8_t wifi_p2p_peer_dev_req; |
| uint8_t wifi_p2p_status_valid; |
| uint8_t wifi_p2p_status; |
| }ql_wifi_req_msg_event_reg_t; |
| |
| typedef struct { |
| QL_WIFI_ENABLE_STATUS_E pre_status; |
| QL_WIFI_ENABLE_STATUS_E status; |
| } ql_wifi_ind_msg_wifi_status_t; |
| |
| typedef struct { |
| QL_WIFI_AP_INDEX_E index; |
| QL_WIFI_AP_STATUS_E pre_status; |
| ql_wifi_ap_status_t status; |
| } ql_wifi_ind_msg_wifi_ap_status_t; |
| |
| typedef struct { |
| QL_WIFI_STA_STATUS_E pre_status; |
| ql_wifi_sta_status_t status; |
| } ql_wifi_ind_msg_wifi_sta_status_t; |
| |
| typedef struct { |
| ql_wifi_sta_scan_result_t scan_result; |
| } ql_wifi_ind_msg_wifi_sta_scan_result_t; |
| |
| typedef struct { |
| QL_WIFI_AP_INDEX_E index; |
| ql_wifi_sta_connect_status_t conn_status; |
| }ql_wifi_ind_msg_wifi_ap_sta_connect_status_t; |
| |
| typedef struct { |
| QL_WIFI_P2P_ENABLE_STATUS_E pre_status; |
| QL_WIFI_P2P_ENABLE_STATUS_E status; |
| } ql_wifi_ind_msg_wifi_p2p_enable_status_t; |
| |
| typedef struct { |
| ql_wifi_p2p_found_dev_info_t dev_info; |
| }ql_wifi_ind_msg_wifi_p2p_dev_found_t; |
| |
| typedef struct { |
| ql_wifi_p2p_req_peer_dev_info_t dev_info; |
| }ql_wifi_ind_msg_wifi_p2p_peer_dev_req_t; |
| |
| typedef struct { |
| QL_WIFI_P2P_STATUS_E pre_status; |
| ql_wifi_p2p_status_t status; |
| }ql_wifi_ind_msg_wifi_p2p_status_t; |
| |
| |
| static ql_wifi_msg_t ql_wifi_msgs[] = |
| { |
| {QL_WIFI_REQ_MSG_ID_SET_ENABLE, sizeof(ql_wifi_req_msg_set_wifi_enable_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_GET_STATUS, 0, sizeof(ql_wifi_rsp_msg_get_wifi_status_t)}, |
| {QL_WIFI_REQ_MSG_ID_SET_CFG, sizeof(ql_wifi_req_msg_set_wifi_cfg_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_GET_CFG, 0, sizeof(ql_wifi_rsp_msg_get_wifi_cfg_t)}, |
| {QL_WIFI_REQ_MSG_ID_SET_AP_CFG, sizeof(ql_wifi_req_msg_set_wifi_ap_cfg_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_GET_AP_CFG, sizeof(ql_wifi_req_msg_get_wifi_ap_cfg_t), sizeof(ql_wifi_rsp_msg_get_wifi_ap_cfg_t)}, |
| {QL_WIFI_REQ_MSG_ID_START_AP, sizeof(ql_wifi_req_msg_start_wifi_ap_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_GET_AP_STATUS, sizeof(ql_wifi_req_msg_get_wifi_ap_status_t), sizeof(ql_wifi_rsp_msg_get_wifi_ap_status_t)}, |
| {QL_WIFI_REQ_MSG_ID_SET_STA_CFG, sizeof(ql_wifi_req_msg_set_wifi_sta_cfg_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_GET_STA_CFG, 0, sizeof(ql_wifi_rsp_msg_get_wifi_sta_cfg_t)}, |
| {QL_WIFI_REQ_MSG_ID_START_STA, sizeof(ql_wifi_req_msg_start_wifi_sta_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_GET_STA_STATUS, 0, sizeof(ql_wifi_rsp_msg_get_wifi_sta_status_t)}, |
| {QL_WIFI_REQ_MSG_ID_STA_START_SCAN, 0, 0}, |
| {QL_WIFI_REQ_MSG_ID_P2P_SET_CFG, sizeof(ql_wifi_req_msg_p2p_set_cfg_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_P2P_GET_CFG, 0, sizeof(ql_wifi_req_msg_p2p_get_cfg_t)}, |
| {QL_WIFI_REQ_MSG_ID_P2P_ENABLE, sizeof(ql_wifi_req_msg_p2p_enable_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_P2P_DEV_FIND, sizeof(ql_wifi_req_msg_p2p_dev_find_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_P2P_CONNECT, sizeof(ql_wifi_req_msg_p2p_connect_t), 0}, |
| {QL_WIFI_REQ_MSG_ID_P2P_DISCONNECT, 0, 0}, |
| {QL_WIFI_REQ_MSG_ID_P2P_GET_STATUS, 0, sizeof(ql_wifi_rsp_msg_p2p_get_status_t)}, |
| {QL_WIFI_REQ_MSG_ID_EVENT_REG, sizeof(ql_wifi_req_msg_event_reg_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_STATUS, sizeof(ql_wifi_ind_msg_wifi_status_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_AP_STATUS, sizeof(ql_wifi_ind_msg_wifi_ap_status_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_STA_STATUS, sizeof(ql_wifi_ind_msg_wifi_sta_status_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_STA_SCAN_RESULT, sizeof(ql_wifi_ind_msg_wifi_sta_scan_result_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_AP_STA_CONNECT, sizeof(ql_wifi_ind_msg_wifi_ap_sta_connect_status_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_P2P_ENABLE_STATUS, sizeof(ql_wifi_ind_msg_wifi_p2p_enable_status_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_P2P_DEV_FOUND, sizeof(ql_wifi_ind_msg_wifi_p2p_dev_found_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_P2P_PEER_DEV_REQ, sizeof(ql_wifi_ind_msg_wifi_p2p_peer_dev_req_t), 0}, |
| {QL_WIFI_IND_MSG_ID_WIFI_P2P_STATUS, sizeof(ql_wifi_ind_msg_wifi_p2p_status_t), 0} |
| }; |
| |
| |
| #endif |
| |