1 // Copyright (C) 2022 Beken Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #include "wlan_defs_pub.h" 22 23 #define INFO_TLV_HEADER (0x00564c54) // ASCII TLV 24 25 typedef enum{ 26 #if CONFIG_WIFI_FAST_CONNECT 27 FAST_CONNECT_ITEM = 0x00001111, 28 #endif 29 AUTO_CONNECT_ITEM = 0x11111111, 30 WIFI_MODE_ITEM = 0x22222222, 31 DHCP_MODE_ITEM = 0x33333333, 32 WIFI_MAC_ITEM = 0x44444444, 33 SSID_KEY_ITEM = 0x55555555, 34 IP_CONFIG_ITEM = 0x66666666, 35 RF_CFG_TSSI_ITEM = 0x77777777, 36 RF_CFG_DIST_ITEM = 0x88888888, 37 RF_CFG_MODE_ITEM = 0x99999999, 38 CHARGE_CONFIG_ITEM = 0xaaaaaaaa, 39 RF_CFG_TSSI_B_ITEM = 0xbbbbbbbb, 40 USER_COMM1_ITEM = 0x11112222, 41 DID_STR_ITEM = 0xcccccccc, 42 USER_PSW_ITEM = 0xdddddddd, 43 CAMERA_PARA_ITEM = 0xeeeeeeee, 44 REBOOT_FLAG_ITEM = 0xffffffff 45 }NET_INFO_ITEM; 46 47 typedef struct info_item_st 48 { 49 UINT32 type; 50 UINT32 len; 51 }INFO_ITEM_ST,TLV_HEADER_ST,*INFO_ITEM_ST_PTR; 52 53 typedef struct item_common_st 54 { 55 INFO_ITEM_ST head; 56 UINT32 value; 57 }ITEM_COMM_ST,*ITEM_COMM_ST_PTR; 58 59 typedef struct item_mac_addr_st 60 { 61 INFO_ITEM_ST head; 62 char mac[6]; 63 char reserved[2];// 4bytes boundary 64 }ITEM_MAC_ADDR_ST,*ITEM_MAC_ADDR_ST_PTR; 65 66 typedef struct item_charge_st 67 { 68 INFO_ITEM_ST head; 69 #if (CONFIG_SOC_BK7251) 70 char chrg[4]; 71 #else 72 char chrg[3]; 73 char reserved[1]; 74 #endif 75 }ITEM_CHARGE_ST,*ITEM_CHARGE_ST_PTR; 76 77 #if CONFIG_WIFI_FAST_CONNECT 78 typedef struct item_fastconnect_st 79 { 80 INFO_ITEM_ST head; 81 uint8_t ssid[33]; 82 uint8_t bssid[6]; 83 uint8_t security; 84 uint8_t channel; 85 uint8_t psk[65]; 86 uint8_t pwd[65]; 87 uint8_t ip_addr[4]; 88 uint8_t netmask[4]; 89 uint8_t gw[4]; 90 uint8_t dns1[4]; 91 }ITEM_FASTCONNECT_ST,*ITEM_FASTCONNECT_ST_PTR; 92 #endif 93 94 typedef struct item_ssidkey_st 95 { 96 INFO_ITEM_ST head; 97 char wifi_ssid[32]; 98 char wifi_key[64]; 99 }ITEM_SSIDKEY_ST,*ITEM_SSIDKEY_ST_PTR; 100 101 typedef struct item_ip_config_st 102 { 103 INFO_ITEM_ST head; 104 char local_ip_addr[16]; 105 char net_mask[16]; 106 char gateway_ip_addr[16]; 107 }ITEM_IP_CONFIG_ST,*ITEM_IP_CONFIG_ST_PTR; 108 109 UINT32 test_get_whole_tbl(UINT8 *ptr); 110 UINT32 save_info_item(NET_INFO_ITEM item,UINT8 *ptr0,UINT8*ptr1,UINT8 *ptr2); 111 UINT32 get_info_item(NET_INFO_ITEM item,UINT8 *ptr0,UINT8 *ptr1, UINT8 *ptr2); 112 113 #ifdef __cplusplus 114 } 115 #endif 116