• 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 
16 /**
17  * @addtogroup Lockzhiner
18  *
19  * @file vendor.h
20  */
21 
22 #ifndef LZ_HARDWARE_VENDOR_H
23 #define LZ_HARDWARE_VENDOR_H
24 
25 #define RK2206_SOFT_AP_SSID      "softap"
26 #define RK2206_SOFT_AP_PASSWORD  "12345678"
27 #define RK2206_SOAT_AP_NFC_MSG   "RK2206_AP_SETTING\r\n" RK2206_SOFT_AP_SSID "\r\n" RK2206_SOFT_AP_PASSWORD
28 
29 #define VENDOR_ID_SIZE           64
30 
31 typedef enum {
32     /* 13Bytes Manufacture ID */
33     VENDOR_ID_SN = 0,
34     /* 6Bytes Mac Address */
35     VENDOR_ID_MAC,
36     /* Product ID */
37     VENDOR_ID_PRODUCT,
38     /* Factory Test flags */
39     VENDOR_ID_FACTORY,
40     /* Wifi hotspot mode: IP address */
41     VENDOR_ID_NET_IP,
42     /* Wifi hotspot mode: gateway */
43     VENDOR_ID_NET_GW,
44     /* Wifi hotspot mode: netmask */
45     VENDOR_ID_NET_MASK,
46     /* Wifi device mode: ssid */
47     VENDOR_ID_WIFI_SSID,
48     /* Wifi device mode: password */
49     VENDOR_ID_WIFI_PASSWD,
50 
51     /* Custom definition ID */
52     VENDOR_ID_CUSTOM = 32,
53     VENDOR_ID_MAX = 64,  // Each ID has 64Bytes storage space, Total is 4096Btyes(4K)
54 } VendorID;
55 
56 /**
57  * @brief Get vendor information.
58  *
59  * This function get vendor information by ID.
60  *
61  * @param id Indicates the vendor ID.
62  * @param buf Indicates the buffer to save vendor information.
63  * @param len Indicates the length of vendor information to get, it should be less than 64.
64  * @return Returns {@link LZ_HARDWARE_SUCCESS} if the vendor information is got successfully;
65  * returns {@link LZ_HARDWARE_FAILURE} otherwise. For details about other return values, see the chip description.
66  */
67 unsigned int VendorGet(VendorID id, unsigned char *buf, int len);
68 
69 /**
70  * @brief Set vendor information.
71  *
72  * This function set vendor information by ID.
73  *
74  * @param id Indicates the vendor ID.
75  * @param buf Indicates the buffer to save vendor information.
76  * @param len Indicates the length of vendor information to set, it should be less than 64.
77  * @return Returns {@link LZ_HARDWARE_SUCCESS} if the vendor information is set successfully;
78  * returns {@link LZ_HARDWARE_FAILURE} otherwise. For details about other return values, see the chip description.
79  */
80 unsigned int VendorSet(VendorID id, unsigned char *buf, int len);
81 
82 #endif
83 
84