• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 FuZhou Lockzhiner Electronic Co., Ltd. All rights reserved.
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 #ifndef _CONFIG_NETWORK_H_
16 #define _CONFIG_NETWORK_H_
17 #include "wifi_device.h"
18 #include "wifi_hotspot.h"
19 #include "lwip/inet.h"
20 #include "stdbool.h"
21 #include "lz_hardware.h"
22 
23 #ifdef __cplusplus
24 #if __cplusplus
25 extern "C" {
26 #endif /* __cpluscplus */
27 #endif /* __cpluscplus */
28 
29 #define WIFI_SCAN_ON 0
30 
31 typedef enum RK_BUTTOON_STATUS {
32     AP_BUTTON_UP = 0,       /* UP mode */
33     AP_BUTTON_DOWN = 1      /* DOWN mode */
34 } RKButtonStatus;
35 
36 typedef struct RK_WIFI_CONFIG {
37     char ssid[WIFI_MAX_SSID_LEN];
38     char psk[WIFI_MAX_KEY_LEN];
39     unsigned char bssid[WIFI_MAC_LEN];
40 } RKWifiConfig;
41 
42 typedef struct RK_BOARD_CONFIG {
43     char rkbc_head[4];    // head
44     char rkbc_led_status;      // led status
45     char rkbc_key_status[2]; // key status
46     char rkbc_buzzer_status; // buzzer status
47     char rkbc_light_status; // light status
48     char rkbc_human_body_sensor_status; // human body sensor status
49     char rkbc_gas_status; // gas status
50     char rkbc_temperature_value[2]; // temperature value
51     char rkbc_humidity_value[2]; // humidity value
52     char rkbc_expand_data[16]; // expand data
53 } RKBoardConfig;
54 
55 typedef struct RK_NETWORK_CONFIG {
56     char rknc_head[4];    // head
57     char rknc_ssid_length;      // ssid len
58     char  rknc_psk_length; // password len
59     char  rknc_data[]; // ssid data + password data
60 } RKNetworkConfig;
61 
62 
63 UINT32 ExternalTaskConfigNetwork(VOID);
64 int ExternalSyncBCState(RKBoardConfig BCstate);
65 void ExternalSetButtonStatus(bool isdown);
66 
67 #ifdef __cplusplus
68 #if __cplusplus
69 }
70 #endif /* __cpluscplus */
71 #endif /* __cpluscplus */
72 #endif /* _CONFIG_NETWORK_H_ */