update sdk

Signed-off-by: BearPi <admin@bearpi.cn>
This commit is contained in:
BearPi
2021-08-19 10:42:27 +08:00
parent 8b6f0068ad
commit 2e3a304fd2
18061 changed files with 351145 additions and 214551 deletions
Executable
+127
View File
@@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2021 Huawei Device Co., Ltd.
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.
Notes:
This is project config file for OpenHarmony OSS Audit Tool, if you have any questions or concerns, please email chenyaxun.
-->
<!-- OAT(OSS Audit Tool) configuration guide:
basedir: Root dir, the basedir + project path is the real source file location.
licensefile:
1.If the project don't have "LICENSE" in root dir, please define all the license files in this project in , OAT will check license files according to this rule.
tasklist(only for batch mode):
1. task: Define oat check thread, each task will start a new thread.
2. task name: Only an name, no practical effect.
3. task policy: Default policy for projects under this task, this field is required and the specified policy must defined in policylist.
4. task filter: Default filefilter for projects under this task, this field is required and the specified filefilter must defined in filefilterlist.
5. task project: Projects to be checked, the path field define the source root dir of the project.
policyList:
1. policy: All policyitems will be merged to default OAT.xml rules, the name of policy doesn't affect OAT check process.
2. policyitem: The fields type, name, path, desc is required, and the fields rule, group, filefilter is optional,the default value is:
<policyitem type="" name="" path="" desc="" rule="may" group="defaultGroup" filefilter="defaultPolicyFilter"/>
3. policyitem type:
"compatibility" is used to check license compatibility in the specified path;
"license" is used to check source license header in the specified path;
"copyright" is used to check source copyright header in the specified path;
"import" is used to check source dependency in the specified path, such as import ... ,include ...
"filetype" is used to check file type in the specified path, supported file types: archive, binary
"filename" is used to check whether the specified file exists in the specified path(support projectroot in default OAT.xml), supported file names: LICENSE, README, README.OpenSource
4. policyitem name: This field is used for define the license, copyright, "*" means match all, the "!" prefix means could not match this value. For example, "!GPL" means can not use GPL license.
5. policyitem path: This field is used for define the source file scope to apply this policyitem, the "!" prefix means exclude the files. For example, "!.*/lib/.*" means files in lib dir will be exclude while process this policyitem.
6. policyitem rule and group: These two fields are used together to merge policy results. "may" policyitems in the same group means any one in this group passed, the result will be passed.
7. policyitem filefilter: Used to bind filefilter which define filter rules.
8. filefilter: Filter rules, the type filename is used to filter file name, the type filepath is used to filter file path.
Note:If the text contains special characters, please escape them according to the following rules:
" == &gt;
& == &gt;
' == &gt;
< == &gt;
> == &gt;
-->
<configuration>
<oatconfig>
<licensefile>sdk_liteos/license/LICENSE</licensefile>
<policylist>
<policy name="projectPolicy" desc="">
<policyitem type="copyright" name="Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED." path=".*" desc="HiSilicon copyright"/>
<policyitem type="copyright" name="Copyright (c) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED." path=".*" desc="HiSilicon copyright"/>
<policyitem type="copyright" name="Copyright (C) 2020 Hisilicon (Shanghai) Technologies Co., Ltd. All rights reserved." path=".*" desc="HiSilicon copyright"/>
<policyitem type="license" name="BSD-3-Clause" path=".*" desc="HiSilicon copyright"/>
<policyitem type="license" name="EndUserLicenseAgreement" path=".*" desc="HiSilicon copyright"/>
</policy>
</policylist>
<filefilterlist>
<filefilter name="defaultFilter" desc="Files not to check">
<!--filteritem type="filename" name="*.lds|*.pod"/-->
<!--filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/-->
</filefilter>
<filefilter name="defaultPolicyFilter" desc="Filters for compatibilitylicense header policies">
<!--filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/-->
<filteritem type="filepath" name="sdk_liteos/platform/os/.*" desc="liteos"/>
<filteritem type="filepath" name="sdk_liteos/third_party/.*" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="hi3861_adapter/.*" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/components/iperf2/include/iperf.h" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.mk" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.sh" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.gni" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.xml" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.cfg" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.csv" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.S|*.gn" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.txt" desc="Temp files"/>
</filefilter>
<filefilter name="copyrightPolicyFilter" desc="Filters for copyright header policies" >
<filteritem type="filepath" name="sdk_liteos/platform/os/.*" desc="liteos"/>
<filteritem type="filepath" name="sdk_liteos/third_party/.*" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="hi3861_adapter/.*" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/components/iperf2/include/iperf.h" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.mk" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.sh" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.gni" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.xml" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.cfg" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.png" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.csv" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.S|*.gn" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.txt" desc="Temp files"/>
</filefilter>
<filefilter name="licenseFileNamePolicyFilter" desc="Filters for LICENSE file policies" >
<!--filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/-->
</filefilter>
<filefilter name="readmeFileNamePolicyFilter" desc="Filters for README file policies" >
</filefilter>
<filefilter name="readmeOpenSourcefileNamePolicyFilter" desc="Filters for README.OpenSource file policies" >
<!--filteritem type="filepath" name="dir name underproject/.*" desc="Describe the reason for filtering scan results"/-->
</filefilter>
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for binary file policies" >
<filteritem type="filepath" name="sdk_liteos/build/libs/.*.a" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/build/libs/.*.o" desc="Describe the reason for filtering scan results"/>
<filteritem type="filename" name="*.exe|*.bin|*.png" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/tools/nvtool/tools/nv/cdbm" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/tools/lzma_tool/lzma_tool" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/build/scripts/ota_builder" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/tools/sign_tool/sign_tool" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/tools/nvtool/nv_builder" desc="Describe the reason for filtering scan results"/>
<filteritem type="filepath" name="sdk_liteos/third_party/u-boot-v2019.07/u-boot-v2019.07.tar.gz" desc="Describe the reason for filtering scan results"/>
</filefilter>
</filefilterlist>
</oatconfig>
</configuration>
Executable → Regular
View File
+216 -11
View File
@@ -19,20 +19,115 @@
#include <stdio.h>
#include <stdlib.h>
#include "lwip/if_api.h"
#include "lwip/netifapi.h"
#include "wifi_device_util.h"
#include "wifi_hotspot_config.h"
#include "utils_file.h"
#define WIFI_RECONN_POLICY_ENABLE 1
#define WIFI_RECONN_POLICY_TIMEOUT 60
#define WIFI_RECONN_POLICY_PERIOD 600
#define WIFI_RECONN_POLICY_MAX_TRY_COUNT 3
#define WIFI_RECONN_POLICY_TIMEOUT 0xFFFF
#define WIFI_RECONN_POLICY_PERIOD 100
#define WIFI_RECONN_POLICY_MAX_TRY_COUNT 100
#define WIFI_DISCONNECT_REASON_NO_AP 1
#define WIFI_DEFAULT_KEY_FOR_PSK "wifipskmode"
#define WLAN_STA_NAME "wlan0"
#define WIFI_FILE "/usrdata/hilink/wifi.cfg"
#define WIFI_FILE_EXIST 1
#define WIFI_FILE_UNEXIST 0
static int g_wifiStaStatus = WIFI_STA_NOT_ACTIVE;
static WifiDeviceConfig g_wifiConfigs[WIFI_MAX_CONFIG_SIZE] = {{{0}, {0}, {0}, 0, WIFI_CONFIG_INVALID, 0, 0}};
static WifiDeviceConfig g_wifiConfigs[WIFI_MAX_CONFIG_SIZE] = {
{0}, {0}, {0}, 0, WIFI_CONFIG_INVALID, 0, 0, UNKNOWN, {0, 0, {0, 0}, 0}
};
static WifiEvent* g_wifiEvents[WIFI_MAX_EVENT_SIZE] = {0};
static int g_connectState = WIFI_STATE_NOT_AVALIABLE;
static int g_networkId = -1;
static bool g_networkConfigReadFlag = false;
static int g_isNetworkConfigExist = WIFI_FILE_UNEXIST;
static bool IsFileExist(const char* path)
{
if (path == NULL) {
return false;
}
int32_t fd = UtilsFileOpen(path, O_RDONLY_FS, 0);
if (fd < 0) {
return false;
}
(void)UtilsFileClose(fd);
return true;
}
static int WriteNetworkConfig(const unsigned char *buf, unsigned int len)
{
int fd;
if (buf == 0) {
return ERROR_WIFI_UNKNOWN;
}
fd = UtilsFileOpen(WIFI_FILE, O_RDWR_FS | O_CREAT_FS | O_TRUNC_FS, 0);
if (fd < 0) {
return ERROR_WIFI_UNKNOWN;
}
if (UtilsFileWrite(fd, (const char *)buf, len) < 0) {
UtilsFileClose(fd);
return ERROR_WIFI_UNKNOWN;
}
UtilsFileClose(fd);
return WIFI_SUCCESS;
}
static int ReadNetworkConfig(unsigned char *buf, unsigned int len)
{
int fd;
unsigned int fileLen = 0;
int ret;
bool isFileExist = false;
if (buf == NULL) {
return ERROR_WIFI_UNKNOWN;
}
if (IsFileExist(WIFI_FILE) == true) {
isFileExist = true;
g_isNetworkConfigExist = WIFI_FILE_EXIST;
} else {
g_isNetworkConfigExist = WIFI_FILE_UNEXIST;
}
fd = UtilsFileOpen(WIFI_FILE, O_RDWR_FS | O_CREAT_FS, 0);
if (fd < 0) {
return ERROR_WIFI_UNKNOWN;
}
ret = UtilsFileStat(WIFI_FILE, &fileLen);
if (ret != WIFI_SUCCESS) {
UtilsFileClose(fd);
return ERROR_WIFI_UNKNOWN;
}
ret = UtilsFileSeek(fd, 0, SEEK_SET_FS);
if (ret != WIFI_SUCCESS) {
UtilsFileClose(fd);
return ERROR_WIFI_UNKNOWN;
}
if (fileLen > len) {
UtilsFileClose(fd);
return ERROR_WIFI_UNKNOWN;
}
if (isFileExist == true) {
ret = UtilsFileRead(fd, (char *)buf, len);
if (ret < 0) {
UtilsFileClose(fd);
return ERROR_WIFI_UNKNOWN;
}
}
UtilsFileClose(fd);
return WIFI_SUCCESS;
}
static void DispatchScanStateChangeEvent(const hi_wifi_event* hisiEvent,
const WifiEvent* hosEvent, WifiEventState event)
@@ -53,6 +148,69 @@ static void DispatchScanStateChangeEvent(const hi_wifi_event* hisiEvent,
}
}
static void StaSetLocaladdr(const struct netif *netif, int gw, int ipaddr, int netmask)
{
ip4_addr_t st_gw;
ip4_addr_t st_ipaddr;
ip4_addr_t st_netmask;
if (netif == NULL) {
printf("hisi_reset_addr::Null param of netdev\r\n");
return;
}
ip4_addr_set_u32(&st_gw, gw);
ip4_addr_set_u32(&st_ipaddr, ipaddr);
ip4_addr_set_u32(&st_netmask, netmask);
netifapi_netif_set_addr(netif, &st_ipaddr, &st_netmask, &st_gw);
return;
}
static void StaSetDNSServer(int switcher)
{
ip4_addr_t tmp_dns_ser[WIFI_MAX_DNS_NUM];
for (int i = 0; i < WIFI_MAX_DNS_NUM; i++) {
if (switcher == HI_WIFI_EVT_CONNECTED) {
ip4_addr_set_u32(&tmp_dns_ser[i], g_wifiConfigs[g_networkId].staticIp.dnsServers[i]);
} else {
ip4_addr_set_u32(&tmp_dns_ser[i], 0);
}
lwip_dns_setserver(i, &tmp_dns_ser[i]);
}
return;
}
static void StaSetWifiNetConfig(int switcher)
{
struct netif *netif_node = netif_find(WLAN_STA_NAME);
if (netif_node == NULL) {
printf("[wifi_service]:DispatchConnectEvent netif get fail\r\n");
return;
}
if (switcher == HI_WIFI_EVT_CONNECTED) {
if (g_wifiConfigs[g_networkId].ipType == DHCP) {
netifapi_dhcp_start(netif_node);
} else if (g_wifiConfigs[g_networkId].ipType == STATIC_IP) {
(void)netifapi_netif_set_link_up(netif_node);
StaSetLocaladdr(netif_node, g_wifiConfigs[g_networkId].staticIp.gateway,
g_wifiConfigs[g_networkId].staticIp.ipAddress, g_wifiConfigs[g_networkId].staticIp.netmask);
(void)netifapi_netif_set_up(netif_node);
StaSetDNSServer(HI_WIFI_EVT_CONNECTED);
}
} else if (switcher == HI_WIFI_EVT_DISCONNECTED) {
if (g_wifiConfigs[g_networkId].ipType == DHCP) {
netifapi_dhcp_stop(netif_node);
StaSetLocaladdr(netif_node, 0, 0, 0);
} else if (g_wifiConfigs[g_networkId].ipType == STATIC_IP) {
(void)netifapi_netif_set_link_down(netif_node);
(void)netifapi_netif_set_down(netif_node);
StaSetLocaladdr(netif_node, 0, 0, 0);
StaSetDNSServer(HI_WIFI_EVT_DISCONNECTED);
}
}
return;
}
static void DispatchConnectEvent(const hi_wifi_event* hisiEvent, const WifiEvent* hosEvent)
{
if (hosEvent->OnWifiConnectionChanged == NULL) {
@@ -78,6 +236,7 @@ static void DispatchConnectEvent(const hi_wifi_event* hisiEvent, const WifiEvent
return;
}
StaSetWifiNetConfig(HI_WIFI_EVT_CONNECTED);
hosEvent->OnWifiConnectionChanged(WIFI_STATE_AVALIABLE, &info);
return;
}
@@ -98,6 +257,7 @@ static void DispatchConnectEvent(const hi_wifi_event* hisiEvent, const WifiEvent
info.disconnectedReason = hisiEvent->info.wifi_disconnected.reason_code;
}
StaSetWifiNetConfig(HI_WIFI_EVT_DISCONNECTED);
hosEvent->OnWifiConnectionChanged(WIFI_STATE_NOT_AVALIABLE, &info);
}
@@ -173,18 +333,18 @@ static void HiWifiWpaEventCb(const hi_wifi_event *hisiEvent)
if (hisiEvent == NULL) {
return;
}
// if (LockWifiEventLock() != WIFI_SUCCESS) {
// return;
// }
if (LockWifiEventLock() != WIFI_SUCCESS) {
return;
}
for (int i = 0; i < WIFI_MAX_EVENT_SIZE; i++) {
if (g_wifiEvents[i] == NULL) {
continue;
}
DispatchEvent(hisiEvent, g_wifiEvents[i]);
}
// if (UnlockWifiEventLock() != WIFI_SUCCESS) {
// return;
// }
if (UnlockWifiEventLock() != WIFI_SUCCESS) {
return;
}
}
static void RegisterHisiCallback(void)
@@ -493,6 +653,10 @@ WifiErrorCode AddDeviceConfig(const WifiDeviceConfig* config, int* result)
}
g_wifiConfigs[netId].netId = netId;
if (WriteNetworkConfig((unsigned char *)&g_wifiConfigs[netId], sizeof(WifiDeviceConfig)) != WIFI_SUCCESS) {
return ERROR_WIFI_UNKNOWN;
}
if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
return ERROR_WIFI_UNKNOWN;
}
@@ -502,7 +666,7 @@ WifiErrorCode AddDeviceConfig(const WifiDeviceConfig* config, int* result)
WifiErrorCode GetDeviceConfigs(WifiDeviceConfig* result, unsigned int* size)
{
if (result == NULL || size == NULL || *size == 0) {
if (result == NULL || size == NULL) {
return ERROR_WIFI_INVALID_ARGS;
}
@@ -512,6 +676,16 @@ WifiErrorCode GetDeviceConfigs(WifiDeviceConfig* result, unsigned int* size)
return ERROR_WIFI_UNKNOWN;
}
if (g_networkConfigReadFlag == false) {
g_networkConfigReadFlag = true;
if (ReadNetworkConfig((unsigned char *)&g_wifiConfigs[0], sizeof(WifiDeviceConfig)) != WIFI_SUCCESS) {
return ERROR_WIFI_UNKNOWN;
}
if (g_isNetworkConfigExist == WIFI_FILE_UNEXIST) {
g_wifiConfigs[0].netId = WIFI_CONFIG_INVALID;
}
}
for (int i = 0; i < WIFI_MAX_CONFIG_SIZE; i++) {
if (g_wifiConfigs[i].netId != i) {
continue;
@@ -603,6 +777,7 @@ WifiErrorCode ConnectTo(int networkId)
return ERROR_WIFI_NOT_AVAILABLE;
}
g_networkId = networkId;
hi_wifi_assoc_request assocReq = {0};
assocReq.auth = HoSecToHiSec(g_wifiConfigs[networkId].securityType);
@@ -658,12 +833,38 @@ WifiErrorCode RemoveDevice(int networkId)
printf("[wifi_service]:removeDevice memset failed\n");
}
g_wifiConfigs[networkId].netId = WIFI_CONFIG_INVALID;
if (WriteNetworkConfig((unsigned char *)&g_wifiConfigs[networkId], sizeof(WifiDeviceConfig)) != WIFI_SUCCESS) {
return ERROR_WIFI_UNKNOWN;
}
if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
return ERROR_WIFI_UNKNOWN;
}
return WIFI_SUCCESS;
}
static int GetLocalWifiIp(int * const ip)
{
int ret;
struct netif *netif_node = netif_find(WLAN_STA_NAME);
if (netif_node == NULL) {
printf("GetLocalWifiIp netif get fail\r\n");
return HISI_FAIL;
}
ip4_addr_t ipAddr;
ip4_addr_t netMask;
ip4_addr_t gateWay;
ret = netifapi_netif_get_addr(netif_node, &ipAddr, &netMask, &gateWay);
if (ret == 0) {
*ip = ip4_addr_get_u32(&ipAddr);
return HISI_OK;
}
return HISI_FAIL;
}
WifiErrorCode GetLinkedInfo(WifiLinkedInfo* result)
{
if (result == NULL) {
@@ -695,6 +896,10 @@ WifiErrorCode GetLinkedInfo(WifiLinkedInfo* result)
result->connState = WIFI_DISCONNECTED;
}
if (GetLocalWifiIp(&(result->ipAddress)) != EOK) {
return ERROR_WIFI_UNKNOWN;
}
return WIFI_SUCCESS;
}
@@ -16,6 +16,7 @@
#include "wifi_hotspot.h"
#include <securec.h>
#include "hi_wifi_api.h"
#include "lwip/netifapi.h"
#include "wifi_device_util.h"
#define RSSI_LEVEL_4_2_G (-65)
@@ -28,9 +29,59 @@
#define RSSI_LEVEL_2_5_G (-79)
#define RSSI_LEVEL_1_5_G (-85)
#define IP_AP_ADDR0 192
#define IP_AP_ADDR1 168
#define IP_AP_ADDR2 5
#define IP_AP_ADDR3 1
#define GW_AP_ADDR0 192
#define GW_AP_ADDR1 168
#define GW_AP_ADDR2 5
#define GW_AP_ADDR3 1
#define NETMSK_ADDR0 255
#define NETMSK_ADDR1 255
#define NETMSK_ADDR2 255
#define NETMSK_ADDR3 0
#define WIFI_TPC_MAX_POWER 20
#define WIFI_TPC_ID 35
#define WIFI_TPC_LEN 2
#define WLAN_AP_NAME "ap0"
static int g_wifiApStatus = WIFI_HOTSPOT_NOT_ACTIVE;
static HotspotConfig g_wifiApConfig = {0};
static char g_wifiIfName[WIFI_IFNAME_MAX_SIZE + 1] = {0};
typedef struct {
unsigned char id;
unsigned char len;
signed char power;
unsigned char margin;
} TpcElement;
static WifiErrorCode SetHotspotIpConfig(void)
{
struct netif *netif = NULL;
netif = netif_find(WLAN_AP_NAME);
if (netif == NULL) {
printf("get netif failed\r\n");
return ERROR_WIFI_UNKNOWN;
}
ip4_addr_t ipAddr;
ip4_addr_t netMask;
ip4_addr_t gw;
IP4_ADDR(&ipAddr, IP_AP_ADDR0, IP_AP_ADDR1, IP_AP_ADDR2, IP_AP_ADDR3);
IP4_ADDR(&netMask, NETMSK_ADDR0, NETMSK_ADDR1, NETMSK_ADDR2, NETMSK_ADDR3);
IP4_ADDR(&gw, GW_AP_ADDR0, GW_AP_ADDR1, GW_AP_ADDR2, GW_AP_ADDR3);
netifapi_netif_set_addr(netif, &ipAddr, &netMask, &gw);
if (netifapi_dhcps_start(netif, 0, 0) != 0) {
printf("dhcps shell cmd excute fail!\r\n");
(void)hi_wifi_softap_stop();
return ERROR_WIFI_UNKNOWN;
}
return WIFI_SUCCESS;
}
WifiErrorCode EnableHotspot(void)
{
@@ -84,6 +135,10 @@ WifiErrorCode EnableHotspot(void)
if (UnlockWifiGlobalLock() != WIFI_SUCCESS) {
return ERROR_WIFI_UNKNOWN;
}
if (SetHotspotIpConfig() != WIFI_SUCCESS) {
return ERROR_WIFI_UNKNOWN;
}
return WIFI_SUCCESS;
}
@@ -168,6 +223,25 @@ int IsHotspotActive(void)
return ret;
}
static int GetPeerSTAWifiIp(const unsigned char *macAddress, int macLen, unsigned int * const ip)
{
int ret;
ip4_addr_t clientIP;
struct netif *netif_node = netif_find(WLAN_AP_NAME);
if (netif_node == NULL) {
printf("GetPeerSTAWifiIp netif get fail\r\n");
return HISI_FAIL;
}
ret = netifapi_dhcps_get_client_ip(netif_node, macAddress, macLen, &clientIP);
if (ret == 0) {
*ip = ntohl(ip4_addr_get_u32(&clientIP));
return HISI_OK;
}
return HISI_FAIL;
}
WifiErrorCode GetStationList(StationInfo* result, unsigned int* size)
{
if (result == NULL || size == NULL || *size == 0) {
@@ -175,11 +249,11 @@ WifiErrorCode GetStationList(StationInfo* result, unsigned int* size)
}
hi_wifi_ap_sta_info staList[WIFI_MAX_STA_NUM] = {0};
unsigned int staNum = 0;
unsigned int staNum = WIFI_MAX_STA_NUM;
int hiRet = hi_wifi_softap_get_connected_sta(staList, &staNum);
if (hiRet != HISI_OK) {
printf("[wifi_service]:GetStationList get connected sta failed, err = %d\n", hiRet);
printf("[wifi_service]:GetStationList get connected sta failed, err = %d\r\n", hiRet);
return ERROR_WIFI_NOT_AVAILABLE;
}
@@ -191,11 +265,19 @@ WifiErrorCode GetStationList(StationInfo* result, unsigned int* size)
for (unsigned int i = 0; i < staNum; i++) {
cpyErr = memcpy_s(result[i].macAddress, WIFI_MAC_LEN, staList[i].mac, HI_WIFI_MAC_LEN);
if (cpyErr != EOK) {
printf("[wifi_service]:GetStationList memcpy fail, err = %d\n", cpyErr);
printf("[wifi_service]:GetStationList memcpy fail, err = %d\r\n", cpyErr);
return ERROR_WIFI_UNKNOWN;
}
}
result[i].name = NULL;
#if LWIP_NETIFAPI_DHCPS_IP
int ret = GetPeerSTAWifiIp(staList[i].mac, WIFI_MAC_LEN, &(result[i].ipAddress));
if (ret != HISI_OK) {
printf("[wifi_service]:GetPeerSTAWifiIp fail, err = %d\r\n", ret);
return ERROR_WIFI_UNKNOWN;
}
#endif
}
*size = staNum;
return WIFI_SUCCESS;
}
@@ -317,3 +399,40 @@ WifiErrorCode GetHotspotInterfaceName(char* result, int size)
}
return WIFI_SUCCESS;
}
WifiErrorCode DisassociateSta(unsigned char* mac, int macLen)
{
int ret = hi_wifi_softap_deauth_sta(mac, macLen);
if (ret != HISI_OK) {
return ERROR_WIFI_UNKNOWN;
}
return WIFI_SUCCESS;
}
WifiErrorCode AddTxPowerInfo(int power)
{
TpcElement tpc = { WIFI_TPC_ID, WIFI_TPC_LEN, 0, 0 };
if (power > WIFI_TPC_MAX_POWER) {
printf("[wifi_service]:Invalid TPC Power (%d)\n", power);
return ERROR_WIFI_INVALID_ARGS;
} else {
tpc.power = power;
}
int ret = hi_wifi_add_usr_app_ie(HI_WIFI_IFTYPE_AP, HI_WIFI_FRAME_TYPE_BEACON, HI_WIFI_USR_IE_TYPE_DEFAULT,
(const unsigned char *)&tpc, sizeof(tpc));
if (ret != HISI_OK) {
printf("[wifi_service]:Wifi Add Beacon IE Fail (%d)\n", ret);
(void)hi_wifi_delete_usr_app_ie(HI_WIFI_IFTYPE_AP, HI_WIFI_FRAME_TYPE_BEACON, HI_WIFI_USR_IE_TYPE_DEFAULT);
return ret;
}
ret = hi_wifi_add_usr_app_ie(HI_WIFI_IFTYPE_AP, HI_WIFI_FRAME_TYPE_PROBE_RSP, HI_WIFI_USR_IE_TYPE_DEFAULT,
(const unsigned char *)&tpc, sizeof(tpc));
if (ret != HISI_OK) {
printf("Wifi Add ProbResp IE Fail (%d)\n", ret);
(void)hi_wifi_delete_usr_app_ie(HI_WIFI_IFTYPE_AP, HI_WIFI_FRAME_TYPE_PROBE_RSP, HI_WIFI_USR_IE_TYPE_DEFAULT);
return ret;
}
return WIFI_SUCCESS;
}
@@ -22,10 +22,6 @@ static_library("hal_iothardware") {
"hal_iot_watchdog.c",
"hal_lowpower.c",
"hal_reset.c",
"hal_iot_gpio_ex.c",
"hal_iot_adc.c",
"hal_iot_i2c_ex.c",
"hal_iot_spi.c",
]
include_dirs = [
"//utils/native/lite/include",
@@ -1,28 +0,0 @@
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* 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.
*/
#include "hi_adc.h"
#include "iot_adc.h"
#include "iot_errno.h"
unsigned int IoTAdcRead(unsigned int channel, unsigned short *data, IotAdcEquModelSel equModel,
IotAdcCurBais curBais, unsigned short rstCnt)
{
if (channel > HI_ADC_CHANNEL_BUTT) {
return IOT_FAILURE;
}
return hi_adc_read((hi_adc_channel_index)channel, (hi_u16*)data, (hi_adc_equ_model_sel)equModel,
(hi_adc_cur_bais)curBais, (hi_u16)rstCnt);
}
@@ -16,7 +16,7 @@
#include "iot_errno.h"
#include "iot_gpio.h"
#include "hi_gpio.h"
#include "hi_io.h"
#define GPIO_PIN_INIT 1
#define GPIO_PIN_UNINIT 0
@@ -1,35 +0,0 @@
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* 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.
*/
#include "iot_errno.h"
#include "iot_gpio_ex.h"
#include "hi_gpio.h"
#include "hi_io.h"
unsigned int IoTGpioSetPull(unsigned int id, IotGpioPull val)
{
if (id >= HI_GPIO_IDX_MAX) {
return IOT_FAILURE;
}
return hi_io_set_pull((hi_io_name)id, (hi_io_pull)val);
}
unsigned int IoTGpioSetFunc(unsigned int id, unsigned char val)
{
if (id >= HI_GPIO_IDX_MAX) {
return IOT_FAILURE;
}
return hi_io_set_func((hi_io_name)id, val);
}
@@ -39,8 +39,6 @@ unsigned int IoTI2cRead(unsigned int id, unsigned short deviceAddr, unsigned cha
return hi_i2c_read((hi_i2c_idx)id, deviceAddr, &i2cData);
}
unsigned int IoTI2cInit(unsigned int id, unsigned int baudrate)
{
return hi_i2c_init((hi_i2c_idx)id, baudrate);
@@ -1,84 +0,0 @@
/*
* Copyright (c) 2020 Huawei Device Co., Ltd.
* 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.
*/
#include "iot_spi.h"
#include <stdio.h>
#include "hi_spi.h"
unsigned int IoTSpiSlaveWrite(IotSpiIdx spiId, char *writeData, unsigned int byteLen, unsigned int timeOutMs)
{
return hi_spi_slave_write((hi_spi_idx)spiId, writeData, byteLen, timeOutMs);
}
unsigned int IoTSpiSlaveRead(IotSpiIdx spiId, char *readData, unsigned int byteLen, unsigned int timeOutMs)
{
return hi_spi_slave_read((hi_spi_idx)spiId, readData, byteLen, timeOutMs);
}
unsigned int IoTSpiHostWrite(IotSpiIdx spiId, char *writeData, unsigned int byteLen)
{
return hi_spi_host_write((hi_spi_idx)spiId, writeData, byteLen);
}
unsigned int IoTSpiHostRead(IotSpiIdx spiId, char *readData, unsigned int byteLen)
{
return hi_spi_host_read((hi_spi_idx)spiId, readData, byteLen);
}
unsigned int IoTSpiHostWriteread(IotSpiIdx spiId, char *writeData, char *readData, unsigned int byteLen)
{
return hi_spi_host_writeread((hi_spi_idx)spiId, writeData, readData, byteLen);
}
unsigned int IoTSpiSetBasicInfo(IotSpiIdx spiId, const IotSpiCfgBasicInfo *param)
{
return hi_spi_set_basic_info((hi_spi_idx)spiId, (const hi_spi_cfg_basic_info *)param);
}
unsigned int IoTSpiInit(IotSpiIdx spiId, IotSpiCfgInitParam initParam,
const IotSpiCfgBasicInfo *param)
{
hi_spi_cfg_init_param hiInitParam;
hiInitParam.is_slave = initParam.isSlave;
hiInitParam.pad = initParam.pad;
return hi_spi_init((hi_spi_idx)spiId, hiInitParam, (const hi_spi_cfg_basic_info *)param);
}
unsigned int IoTSpiDeinit(IotSpiIdx spiId)
{
return hi_spi_deinit((hi_spi_idx)spiId);
}
unsigned int IoTSpiSetIrqMode(IotSpiIdx spiId, unsigned char irqEn)
{
return hi_spi_set_irq_mode((hi_spi_idx)spiId, irqEn);
}
unsigned int IoTSpiSetDmaMode(IotSpiIdx spiId, unsigned char dmaEn)
{
return hi_spi_set_dma_mode((hi_spi_idx)spiId, dmaEn);
}
unsigned int IoTSpiRegisterUsrFunc(IotSpiIdx spiId, SpiIsrFunc prepareF, SpiIsrFunc restoreF)
{
return hi_spi_register_usr_func((hi_spi_idx)spiId, prepareF, restoreF);
}
unsigned int IoTSpiSetLoopBackMode(IotSpiIdx spiId, unsigned char lbEn)
{
return hi_spi_set_loop_back_mode((hi_spi_idx)spiId, lbEn);
}
+113 -2
View File
@@ -17,6 +17,56 @@
#include "hi_upg_api.h"
#include "stdio.h"
#define PUBKEY_LENGTH 270
static const unsigned char g_pubKeyBuf[PUBKEY_LENGTH] = {
0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xBF, 0xAA, 0xA5, 0xB3, 0xC2, 0x78, 0x5E,
0x63, 0x07, 0x84, 0xCF, 0x37, 0xF0, 0x45, 0xE8, 0xB9, 0x6E, 0xEF, 0x04, 0x88, 0xD3, 0x43, 0x06,
0x2C, 0xFC, 0x09, 0x8C, 0x84, 0x3B, 0x43, 0x07, 0x89, 0x6B, 0x23, 0x8F, 0xA2, 0xF0, 0x9D, 0x91,
0xCB, 0xA8, 0x02, 0x60, 0xD8, 0x5C, 0x18, 0xD9, 0x34, 0xF0, 0x3C, 0x49, 0x10, 0x0E, 0xE3, 0xC7,
0x19, 0xA5, 0x51, 0x93, 0x38, 0xFD, 0xE0, 0x62, 0x64, 0xBA, 0x6D, 0x11, 0x2E, 0xE1, 0x6E, 0x60,
0x12, 0x16, 0x1B, 0x35, 0xA6, 0x54, 0x3F, 0x0B, 0x5D, 0x54, 0x08, 0xC9, 0x23, 0x51, 0x15, 0xA9,
0xE2, 0x07, 0xCC, 0xF9, 0xFD, 0x19, 0x8A, 0xB3, 0x7E, 0xCE, 0x69, 0xED, 0x26, 0x34, 0xD2, 0x02,
0xF3, 0xEB, 0x07, 0x13, 0x69, 0xE3, 0x03, 0x87, 0xB3, 0x6A, 0x3E, 0x91, 0x94, 0xAC, 0x2C, 0xBA,
0xF6, 0xEE, 0x4C, 0x41, 0x0C, 0x2E, 0xD0, 0xE7, 0x58, 0xA7, 0xE6, 0x7F, 0x1A, 0xC0, 0xB8, 0xE3,
0x12, 0x18, 0x97, 0x8D, 0x99, 0xAB, 0x35, 0x7B, 0xAD, 0x41, 0xA0, 0xFB, 0xCB, 0x23, 0xF6, 0x51,
0xE6, 0x94, 0x1F, 0xF7, 0xD8, 0x16, 0xCD, 0x15, 0x67, 0x59, 0x10, 0xA2, 0x40, 0x55, 0xD1, 0x67,
0xDA, 0x18, 0xCD, 0x63, 0x5B, 0x10, 0xAF, 0x22, 0x99, 0xD8, 0x9D, 0x56, 0x66, 0xCD, 0x80, 0x64,
0x32, 0xB5, 0xD7, 0xF5, 0xBA, 0x91, 0x4A, 0x8D, 0x97, 0x14, 0x8A, 0xB2, 0xB0, 0x42, 0x4A, 0xE6,
0x43, 0x22, 0x3B, 0x6E, 0xD6, 0x1E, 0x1F, 0xDA, 0xEC, 0x83, 0xCF, 0x20, 0xFA, 0x02, 0xF3, 0xFB,
0x6E, 0x09, 0x2A, 0x0D, 0xB7, 0x81, 0x1E, 0xD5, 0x71, 0xDF, 0x80, 0xC5, 0x33, 0x78, 0xE5, 0x41,
0x33, 0xDF, 0x9A, 0xBD, 0x36, 0x51, 0xAC, 0x96, 0xF4, 0xC6, 0x11, 0xC3, 0x93, 0x78, 0x26, 0x96,
0x9F, 0x67, 0x05, 0x1D, 0xDF, 0xB3, 0xAA, 0x26, 0x25, 0x02, 0x03, 0x01, 0x00, 0x01
};
typedef enum {
PARTITION_PASS_THROUGH = 0,
PARTITION_BOOTLOADER = 2,
PARTITION_KERNEL_A = 3,
PARTITION_KERNEL_B = 4,
PARTITION_ROOTFS = 5,
PARTITION_APP = 6,
PARTITION_DATA = 7,
PARTITION_OTA_TAG = 8,
PARTITION_OTA_CONFIG = 9,
PARTITION_ROOTFS_EXT4 = 10,
PARTITION_MAX
} HotaPartition;
static const ComponentTableInfo g_componentTable[] = {
{ PARTITION_PASS_THROUGH, "", "/sdcard/update/ota_pkg_pass_through.bin", 0},
{ PARTITION_INFO_COMP, "", "/sdcard/update/infocomp.bin", 0},
{ PARTITION_BOOTLOADER, "bootloader", "/sdcard/update/u-boot.bin", 0},
{ PARTITION_KERNEL_A, "kernel_A", "/sdcard/update/kernel.bin", 0},
{ PARTITION_KERNEL_B, "kernel_B", "", 0},
{ PARTITION_ROOTFS, "rootfs", "/sdcard/update/rootfs.img", 0},
{ PARTITION_APP, "app", "", 0},
{ PARTITION_DATA, "data", "", 0},
{ PARTITION_OTA_TAG, "ota_tag", "/sdcard/update/OTA.tag", 0},
{ PARTITION_OTA_CONFIG, "config", "/sdcard/update/config", 0},
{ PARTITION_ROOTFS_EXT4, "rootfs_ext4", "/sdcard/update/rootfs_ext4.img", 0},
{ PARTITION_MAX, NULL, NULL, 0}
};
int HotaHalInit(void)
{
hi_u32 result = hi_upg_init();
@@ -46,7 +96,7 @@ int HotaHalDeInit(void)
return OHOS_SUCCESS;
}
int HotaHalRead(HotaPartition partition, unsigned int offset, unsigned int bufLen, unsigned char *buffer)
int HotaHalRead(int partition, unsigned int offset, unsigned int bufLen, unsigned char *buffer)
{
if ((buffer == NULL) || (bufLen == 0)) {
return OHOS_FAILURE;
@@ -60,7 +110,7 @@ int HotaHalRead(HotaPartition partition, unsigned int offset, unsigned int bufLe
return OHOS_SUCCESS;
}
int HotaHalWrite(HotaPartition partition, unsigned char *buffer, unsigned int offset, unsigned int buffLen)
int HotaHalWrite(int partition, unsigned char *buffer, unsigned int offset, unsigned int buffLen)
{
if (partition == PARTITION_INFO_COMP) {
printf("partition == PARTITION_INFO_COMP, skip it.");
@@ -94,3 +144,64 @@ int HotaHalRollback(void)
{
return OHOS_SUCCESS;
}
const ComponentTableInfo *HotaHalGetPartitionInfo()
{
return g_componentTable;
}
unsigned char *HotaHalGetPubKey(unsigned int *length)
{
if (length == NULL) {
printf("OTA pub key is NULL.\r\n");
return NULL;
}
*length = sizeof(g_pubKeyBuf);
return (unsigned char *)g_pubKeyBuf;
}
int HotaHalGetUpdateAbility(void)
{
return ABILITY_PKG_SEARCH | ABILITY_PKG_DLOAD;
}
int HotaHalGetOtaPkgPath(char *path, int len)
{
int ret = strcpy_s(path, len ,"/sdcard");
if (ret != 0) {
return OHOS_FAILURE;
}
return OHOS_SUCCESS;
}
int HotaHalIsDeviceCanReboot(void)
{
return 1;
}
int HotaHalGetMetaData(UpdateMetaData *metaData)
{
return OHOS_SUCCESS;
}
int HotaHalSetMetaData(UpdateMetaData *metaData)
{
return OHOS_SUCCESS;
}
int HotaHalRebootAndCleanUserData(void)
{
return OHOS_SUCCESS;
}
int HotaHalRebootAndCleanCache(void)
{
return OHOS_SUCCESS;
}
int HotaHalCheckVersionValid(const char *currentVersion, const char *pkgVersion, unsigned int pkgVersionLength)
{
return (strncmp(currentVersion, pkgVersion, pkgVersionLength) == 0) ? 1 : 0;
}
View File
View File
View File
View File
View File
View File
View File
+68 -6
View File
@@ -38,10 +38,19 @@
#include "lwip/sockets.h"
#include "hks_client.h"
#include "hi_fs.h"
#define RANDOM_DEV_FD LWIP_CONFIG_NUM_SOCKETS
#define RANDOM_DEV_FD (LWIP_SOCKET_OFFSET + LWIP_CONFIG_NUM_SOCKETS)
#define RANDOM_DEV_PATH "/dev/random"
#define IS_SOCKET_FD(fd) ((fd) >= LWIP_SOCKET_OFFSET && (fd) < (LWIP_SOCKET_OFFSET + LWIP_CONFIG_NUM_SOCKETS))
#define HI_FS_MAX_OPEN_FILES (32+1)
#define HI_FS_FD_OFFSET RANDOM_DEV_FD
#define IS_HI_FS_FD(fd) ((fd) >= HI_FS_FD_OFFSET && (fd) < (HI_FS_FD_OFFSET + HI_FS_MAX_OPEN_FILES))
#define HI_FS_FD(fd) ((fd) - HI_FS_FD_OFFSET)
#define FREE_AND_SET_NULL(ptr) do { \
free(ptr); \
ptr = NULL; \
@@ -136,6 +145,7 @@ static size_t GetCanonicalPath(const char *cwd, const char *path, char *buf, siz
int open(const char *file, int oflag, ...)
{
int fd = -1;
unsigned flags = O_RDONLY | O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_LARGEFILE | O_TRUNC | O_EXCL | O_DIRECTORY;
if (((unsigned)oflag & ~flags) || (file == NULL)) {
errno = EINVAL;
@@ -178,8 +188,11 @@ int open(const char *file, int oflag, ...)
return -1;
}
FREE_AND_SET_NULL(canonicalPath);
errno = ENOENT;
return -1;
fd = hi_open(file, (uint32_t)oflag);
if (fd < 0) {
return -1;
}
return fd + HI_FS_FD_OFFSET;
}
int close(int fd)
@@ -187,7 +200,14 @@ int close(int fd)
if (fd == RANDOM_DEV_FD) {
return 0;
}
return closesocket(fd);
if (IS_SOCKET_FD(fd)) {
return closesocket(fd);
}
if (IS_HI_FS_FD(fd)) {
return hi_close(HI_FS_FD(fd));
}
errno = EBADF;
return -1;
}
ssize_t read(int fd, void *buf, size_t nbytes)
@@ -210,7 +230,14 @@ ssize_t read(int fd, void *buf, size_t nbytes)
}
return (ssize_t)nbytes;
}
return recv(fd, buf, nbytes, 0);
if (IS_SOCKET_FD(fd)) {
return recv(fd, buf, nbytes, 0);
}
if (IS_HI_FS_FD(fd)) {
return hi_read(HI_FS_FD(fd), buf, nbytes);
}
errno = EBADF;
return -1;
}
ssize_t write(int fd, const void *buf, size_t nbytes)
@@ -219,5 +246,40 @@ ssize_t write(int fd, const void *buf, size_t nbytes)
errno = EBADF; /* "/dev/random" is readonly */
return -1;
}
return send(fd, buf, nbytes, 0);
if (IS_SOCKET_FD(fd)) {
return send(fd, buf, nbytes, 0);
}
if (IS_HI_FS_FD(fd)) {
return hi_write(HI_FS_FD(fd), (const char*)buf, nbytes);
}
errno = EBADF;
return -1;
}
off_t lseek(int fd, off_t offset, int whence)
{
if (fd == RANDOM_DEV_FD) {
errno = ENOTSUP;
return (off_t)-1;
}
if (IS_SOCKET_FD(fd)) {
errno = ESPIPE;
return (off_t)-1;
}
if (IS_HI_FS_FD(fd)) {
return hi_lseek(HI_FS_FD(fd), offset, whence);
}
errno = EBADF;
return (off_t)-1;
}
int unlink(const char *path)
{
return hi_unlink(path);
}
int fsync(int fd)
{
(void)fd;
return 0;
}
View File
View File
View File
View File
Binary file not shown.
+6 -1
View File
@@ -14,7 +14,12 @@ lite_subsystem("wifiiot_sdk") {
build_ext_component("run_wifiiot_scons") {
exec_path = rebase_path(".", root_build_dir)
outdir = rebase_path(root_out_dir)
command = "sh hm_build.sh $outdir"
if (host_os == "win") {
command = "sh hm_build.sh $outdir win"
} else {
command = "sh hm_build.sh $outdir linux"
}
deps = [
":sdk",
"//base/security/deviceauth/frameworks/deviceauth_lite:hichainsdk",
Executable → Regular
View File
Executable → Regular
View File
Executable → Regular
+2 -2
View File
@@ -26,7 +26,7 @@ import sys
import datetime
import atexit
from distutils import dir_util
sys.path.append(os.path.join(os.getcwd(), 'build'))
sys.path.insert(0,os.path.join(os.getcwd(), 'build'))
from scripts import common_env
from scripts import scons_utils
from scripts import scons_app
@@ -346,7 +346,7 @@ def burn_bin_builder(target, source, env):
if ((get_hilink_enable() == True) or (burn_tee_cert == True)):
cmd_list.append('%s|%d|%d|1'%(burn_for_erase_bin, 0x200000 - 0x8000 - 0x1000, 0x1000))
cmd_list.append('%s|%d|%d|1'%(boot_b, 0x200000 - boot_b_size, boot_b_size));
#cmd_list.append('%s|%d|%d|1'%(boot_b, 0x200000 - boot_b_size, boot_b_size));
if (burn_tee_cert == True):
cert_key_bin = bytearray(tee_cert_key_bin_max)
Executable → Regular
View File
Executable → Regular
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
-1
View File
@@ -22,7 +22,6 @@
#include "cmsis_os2.h"
#include "ohos_init.h"
#include "ohos_types.h"
#include "netcfg_service.h"
#include "wifi_device_config.h"
#include "wifiiot_gpio.h"
#include "wifiiot_gpio_ex.h"
View File
View File
+2 -2
View File
@@ -213,11 +213,11 @@ hi_void peripheral_init(hi_void)
} else {
ret = hi_uart_lp_restore(HI_UART_IDX_1);
if (ret != HI_ERR_SUCCESS) {
err_info |= PERIPHERAL_INIT_ERR_UART0;
err_info |= PERIPHERAL_INIT_ERR_UART1;
}
ret = hi_uart_lp_restore(HI_UART_IDX_0);
if (ret != HI_ERR_SUCCESS) {
err_info |= PERIPHERAL_INIT_ERR_UART1;
err_info |= PERIPHERAL_INIT_ERR_UART0;
}
ret = hi_uart_lp_restore(HI_UART_IDX_2);
if (ret != HI_ERR_SUCCESS) {
@@ -0,0 +1,609 @@
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* 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.
*/
/*-----------includes---------*/
#include <hi_blackbox.h>
#include <hi_blackbox_adapter.h>
#include <hi_crash.h>
#include <hi_flash.h>
#include <hi_fs.h>
#include <hi_partition_table.h>
#include <hi_reset.h>
#include <hi_stdlib.h>
/* ------------ local macroes -----------*/
#define FAULT_LOG_SIZE 0x800 /*2KB*/
#define LONG_BUF_SIZE 512
#define SHORT_BUF_SIZE 64
#define LOG_SAVED_FLAG "LOGSAVED!"
#define SYSERR_INFO_FLAG "====fault info====\r\n"
#define EXCP_INFO_FLAG "====exc info====\r\n"
#define REG_INFO_FLAG "====reg info====\r\n"
#define MEMORY_INFO_FLAG "====mem info====\r\n"
#define TASK_INFO_FLAG "====task info====\r\n"
#define TRACK_INFO_FLAG "====track info====\r\n"
#define CALL_STACK_START "====call stack====\r\n"
#define FAULT_LOG_PATH "/kernel_fault.log"
/* --------global variables----------*/
extern hi_u32 __rom_text_begin__;
extern hi_u32 __rom_text_end__;
extern hi_u32 __ram_text_start;
extern hi_u32 __ram_text_end;
extern hi_u32 __text_cache_start1_;
extern hi_u32 __text_cache_end1_;
extern hi_u32 __text_cache_start2_;
extern hi_u32 __text_cache_end2_;
/* ----function definitions---------*/
static void SaveSysInfo(const char* filePath, struct ErrorInfo *errInfo,
hi_syserr_info *sysErrInfo)
{
hi_s32 len;
hi_char buf[LONG_BUF_SIZE];
if (filePath == NULL || errInfo == NULL || sysErrInfo == NULL){
printf("filePath: %p, errInfo: %p, sysErrInfo: %p!\r\n",
filePath, errInfo, sysErrInfo);
return;
}
/* save header */
(hi_void)FullWriteFile(filePath, SYSERR_INFO_FLAG,
strlen(SYSERR_INFO_FLAG), 0);
/* format and save useful log */
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
ERROR_INFO_HEADER_FORMAT "Ver:%s\r\n",
errInfo->event, errInfo->module, errInfo->errorDesc,
sysErrInfo->basic_info.kernel_ver);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
} else {
printf("snprintf_s failed or the buffer is too short!\r\n");
}
}
static void SaveExcpInfo(const char *filePath, hi_syserr_info *sysErrInfo)
{
hi_s32 len;
hi_char buf[LONG_BUF_SIZE];
if (filePath == NULL || sysErrInfo == NULL) {
printf("filePath: %p, sysErrInfo: %p\r\n",
filePath, sysErrInfo);
return;
}
/* save neader*/
(hi_void)FullWriteFile(filePath, EXCP_INFO_FLAG,
strlen(EXCP_INFO_FLAG), 1);
/* format and save usefull log*/
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"TaskName:%s\r\n"
"TaskID:%d\r\n"
"CurTaskID:%d\r\n"
"StackSize:0x%x\r\n"
"ExcType:0x%x\r\n",
sysErrInfo->os_info.task.name,
sysErrInfo->os_info.task.id,
sysErrInfo->core_info.cur_task_id,
sysErrInfo->os_info.task.stack_size,
sysErrInfo->basic_info.rid);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
} else {
printf("snprintf_s failed or the buffer is too short!\r\n");
}
}
static void SaveRegInfo(const char* filePath, hi_syserr_info *sysErrInfo)
{
hi_s32 len;
hi_char buf[LONG_BUF_SIZE];
if (filePath == NULL || sysErrInfo == NULL) {
printf("filePath: %p, sysErrInfo: %p!\r\n",
filePath, sysErrInfo);
return;
}
/* save header */
(hi_void)FullWriteFile(filePath, REG_INFO_FLAG, strlen(REG_INFO_FLAG), 1);
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"mepc:0x%x\r\nmstatus:0x%x\r\nmtval:0x%x\r\n"
"mcause:0x%x\r\nccause:0x%x\r\n", sysErrInfo->reg_info.mepc,
sysErrInfo->core_info.mstatus, sysErrInfo->core_info.mtval,
sysErrInfo->core_info.mcause, sysErrInfo->core_info.ccause);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"ra:0x%x\r\nsp:0x%x\r\ngp:0x%x\r\ntp:0x%x\r\n",
sysErrInfo->reg_info.ra, sysErrInfo->reg_info.sp,
sysErrInfo->reg_info.gp, sysErrInfo->reg_info.tp);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"t0:0x%x\r\nt1:0x%x\r\nt2:0x%x\r\ns0:0x%x\r\n",
sysErrInfo->reg_info.t0, sysErrInfo->reg_info.t1,
sysErrInfo->reg_info.t2, sysErrInfo->reg_info.s0);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"s1:0x%x\r\na0:0x%x\r\na1:0x%x\r\na2:0x%x\r\n",
sysErrInfo->reg_info.s1, sysErrInfo->reg_info.a0,
sysErrInfo->reg_info.a1, sysErrInfo->reg_info.a2);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"a3:0x%x\r\na4:0x%x\r\na5:0x%x\r\na6:0x%x\r\n",
sysErrInfo->reg_info.a3, sysErrInfo->reg_info.a4,
sysErrInfo->reg_info.a5, sysErrInfo->reg_info.a6);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"a7:0x%x\r\ns2:0x%x\r\ns3:0x%x\r\ns4:0x%x\r\n",
sysErrInfo->reg_info.a7, sysErrInfo->reg_info.s2,
sysErrInfo->reg_info.s3, sysErrInfo->reg_info.s4);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"s5:0x%x\r\ns6:0x%x\r\ns7:0x%x\r\ns8:0x%x\r\n",
sysErrInfo->reg_info.s5, sysErrInfo->reg_info.s6,
sysErrInfo->reg_info.s7, sysErrInfo->reg_info.s8);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"s9:0x%x\r\ns10:0x%x\r\ns11:0x%x\r\n",
sysErrInfo->reg_info.s9, sysErrInfo->reg_info.s10,
sysErrInfo->reg_info.s11);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"t3:0x%x\r\nt4:0x%x\r\nt5:0x%x\r\nt6:0x%x\r\n",
sysErrInfo->reg_info.t3, sysErrInfo->reg_info.t4,
sysErrInfo->reg_info.t5, sysErrInfo->reg_info.t6);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
}
static void SaveMemInfo(const char *filePath, hi_syserr_info *sysErrInfo)
{
hi_s32 len;
hi_char buf[LONG_BUF_SIZE];
if (filePath == NULL || sysErrInfo == NULL) {
printf("filePath: %p, sysErrInfo: %p!\r\n",
filePath, sysErrInfo);
return;
}
/* save header */
(hi_void)FullWriteFile(filePath, MEMORY_INFO_FLAG,
strlen(MEMORY_INFO_FLAG), 1);
/* format and save usefull log*/
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"PoolAddr:0x%x\r\n"
"PoolSize:0x%x\r\n"
"FailCount:0x%x\r\n"
"PeekSize:0x%x\r\n"
"UsedSize:0x%x\r\n",
sysErrInfo->os_info.mem.pool_addr,
sysErrInfo->os_info.mem.pool_size,
sysErrInfo->os_info.mem.fail_count,
sysErrInfo->os_info.mem.peek_size,
sysErrInfo->os_info.mem.cur_use_size);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
} else {
printf("snprintf_s failed or the buffer is too short!\r\n");
}
}
static void SaveTaskInfo(const char *filePath, hi_syserr_info *sysErrInfo)
{
hi_s32 len;
hi_char buf[LONG_BUF_SIZE];
if (filePath == NULL || sysErrInfo == NULL) {
printf("filePath: %p, sysErrInfo: %p!\r\n",
filePath, sysErrInfo);
return;
}
/* save header */
(hi_void)FullWriteFile(filePath, TASK_INFO_FLAG,
strlen(TASK_INFO_FLAG), 1);
/* format and save usefull log */
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"Status:0x%x\r\n"
"StackIndex:0x%x\r\n"
"StackPeak:0x%x\r\n"
"StackSize:0x%x\r\n",
sysErrInfo->os_info.task.status,
sysErrInfo->os_info.task.stack_data_index,
sysErrInfo->os_info.task.stack_peak,
sysErrInfo->os_info.task.stack_size);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"SP:0x%x\r\n"
"Stack:0x%x to 0x%x\r\n"
"RealSP:0x%x\r\n"
"StackOverflow:%d\r\n",
sysErrInfo->os_info.task.sp,
sysErrInfo->os_info.task.stack[0], sysErrInfo->os_info.task.stack[1],
sysErrInfo->os_info.task.real_sp,
sysErrInfo->os_info.task.overflow_flag);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
}
static void SaveTrackInfo(const char *filePath, hi_syserr_info *sysErrInfo)
{
hi_s32 i;
hi_s32 len;
hi_char buf[LONG_BUF_SIZE];
if (filePath == NULL || sysErrInfo == NULL) {
printf("filePath: %p, sysErrInfo: %p!\r\n",
filePath, sysErrInfo);
return;
}
/* save header */
(hi_void)FullWriteFile(filePath, TRACK_INFO_FLAG,
strlen(TRACK_INFO_FLAG), 1);
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"CurItem:0x%x\r\n"
"ItemCnt:%d\r\n"
"Index Type ID CurTime Data1 Data2\r\n",
sysErrInfo->track_info.current_item,
sysErrInfo->track_info.item_cnt);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
for (i = 0; i < sysErrInfo->track_info.item_cnt; i++) {
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"%04d %04d %04d 0x%x 0x%x 0x%x\r\n",
i,
sysErrInfo->track_info.item[i].type,
sysErrInfo->track_info.item[i].id,
sysErrInfo->track_info.item[i].timestamp,
sysErrInfo->track_info.item[i].data,
sysErrInfo->track_info.item[i].entry);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
}
}
static hi_bool IsValidText(hi_u32 addr)
{
return ((addr >= (hi_u32)&__rom_text_begin__ &&
addr <= (hi_u32)&__rom_text_end__) ||
(addr >= (hi_u32)&__text_cache_start2_ &&
addr <= (hi_u32)&__text_cache_end2_) ||
(addr >= (hi_u32)&__ram_text_start &&
addr <= (hi_u32)&__ram_text_end) ||
(addr >= (hi_u32)&__text_cache_start1_ &&
addr <= (hi_u32)&__text_cache_end1_));
}
static void SaveCallBack(const char *filePath, hi_syserr_info *sysErrInfo)
{
hi_char buf[SHORT_BUF_SIZE];
hi_bool findMepc = HI_FALSE;
hi_s32 len;
hi_u32 addr;
hi_u32 size;
hi_u32 i;
hi_u32 index = 0;
hi_u32 stackSize = sysErrInfo->os_info.task.stack[1] -
sysErrInfo->os_info.task.stack[0];
hi_u32 *pData;
if (filePath == NULL || sysErrInfo == NULL) {
printf("filePath: %p, sysErrInfo: %p!\r\n",
filePath, sysErrInfo);
return;
}
if (hi_get_crash_partition_table(&addr, &size) != 0) {
printf("hi_get_crash_partition_table failed!\r\n");
return;
}
pData = hi_malloc(HI_MOD_ID_SAL_DFX, stackSize);
if (pData == NULL) {
printf("hi_malloc failed!\r\n");
return;
}
if (hi_flash_read(addr + size - stackSize, stackSize,
(hi_u8 *)pData) != HI_ERR_SUCCESS) {
printf("Read stack from crash partition failed!\r\n");
hi_free(HI_MOD_ID_SAL_DFX, pData);
return;
}
/* save header */
(hi_void) FullWriteFile(filePath, CALL_STACK_START,
strlen(CALL_STACK_START), 1);
for (i = 0; i < stackSize / sizeof(hi_u32); ++i) {
hi_u32 *ptemp = pData + i;
if (!findMepc && *ptemp == sysErrInfo->reg_info.mepc) {
findMepc = HI_TRUE;
}
if (IsValidText(*ptemp) && findMepc) {
len = snprintf_s(buf, sizeof(buf), sizeof(buf) - 1,
"#%d %x\r\n", index, *ptemp);
if (len > 0) {
(hi_void)FullWriteFile(filePath, buf, len, 1);
}
++index;
}
}
hi_free(HI_MOD_ID_SAL_DFX, pData);
}
static void SaveFaultLog(struct ErrorInfo *errInfo, hi_syserr_info *sysErrInfo)
{
if (errInfo == NULL || sysErrInfo == NULL) {
printf("errInfo: %p, sysErrInfo: %p!\r\n",
errInfo, sysErrInfo);
return;
}
SaveSysInfo(FAULT_LOG_PATH, errInfo, sysErrInfo);
SaveExcpInfo(FAULT_LOG_PATH, sysErrInfo);
SaveRegInfo(FAULT_LOG_PATH, sysErrInfo);
SaveMemInfo(FAULT_LOG_PATH, sysErrInfo);
SaveTaskInfo(FAULT_LOG_PATH, sysErrInfo);
SaveTrackInfo(FAULT_LOG_PATH, sysErrInfo);
SaveCallBack(FAULT_LOG_PATH, sysErrInfo);
}
static void SetLogSavedFlag(hi_void)
{
hi_u32 addr;
hi_u32 size;
if (hi_get_crash_partition_table(&addr, &size) != 0) {
printf("hi_get_crash_partition_table failed!\r\n");
return;
}
if (hi_flash_write(addr, sizeof(LOG_SAVED_FLAG),
(hi_u8 *)LOG_SAVED_FLAG, HI_TRUE) != HI_ERR_SUCCESS) {
printf("Set log saved flag failed!\r\n");
}
}
static char *GetEvent(hi_syserr_eid err_id)
{
switch (err_id) {
case HI_SYSERR_EID_POWER_DOWN:
return EVENT_POWEROFF;
case HI_SYSERR_EID_FAULT_IN_TASK:
case HI_SYSERR_EID_FAULT_IN_ISR:
return EVENT_PANIC;
case HI_SYSERR_EID_WATCHDOG_ISR:
case HI_SYSERR_EID_WATCHDOG_TSK:
return EVENT_SYS_WATCHDOG;
case HI_SYSERR_EID_SYS_SOFT_REBOOT:
return EVENT_SYSREBOOT;
default:
break;
}
return "Unknow";
}
static char *GetErrorDesc(hi_syserr_eid err_id)
{
switch (err_id) {
case HI_SYSERR_EID_POWER_DOWN:
return "Power down or hard reboot";
case HI_SYSERR_EID_FAULT_IN_TASK:
return "fault in task";
case HI_SYSERR_EID_FAULT_IN_ISR:
return "fault in interrupt";
case HI_SYSERR_EID_WATCHDOG_TSK:
return "watch dog fault in task";
case HI_SYSERR_EID_WATCHDOG_ISR:
return "watch dog fault in interrupt";
case HI_SYSERR_EID_SYS_SOFT_REBOOT:
return "soft reboot";
default:
break;
}
return "Unknown fault type!";
}
int FullWriteFile(const char *filePath, const char *buf, size_t bufSize, int isAppend)
{
int fd;
int totalToWrite = (int) bufSize;
int totalWrite = 0;
if (filePath == NULL || buf == NULL || bufSize == 0) {
printf("filePath: %p, buf: %p, bufSize: %lu!\n", filePath, buf, bufSize);
return -1;
}
fd = hi_open(filePath, HI_FS_O_WRONLY | HI_FS_O_CREAT |
(isAppend ? HI_FS_O_APPEND : HI_FS_O_TRUNC));
if (fd < 0) {
printf("Create file [%s] failed!\n", filePath);
return -1;
}
while (totalToWrite > 0) {
int writeThisTime = hi_write(fd, buf, totalToWrite);
if (writeThisTime < 0) {
printf("Failed to write file: %s\n", filePath);
(void)hi_close(fd);
return -1;
}
buf += writeThisTime;
totalToWrite -= writeThisTime;
totalWrite += writeThisTime;
}
(void)hi_close(fd);
return totalWrite == (int)bufSize ? 0 : -1;
}
char *GetFaultLogPath(void)
{
return FAULT_LOG_PATH;
}
void RebootSystem(void)
{
hi_hard_reboot(HI_SYS_REBOOT_CAUSE_CMD);
}
void SystemModuleDump(const char *logDir, struct ErrorInfo *info)
{
int len;
char *buf;
(void)logDir;
if (logDir == NULL || info == NULL) {
printf("logDir: %p, info: %p\r\n", logDir, info);
return;
}
buf = hi_malloc(HI_MOD_ID_SAL_DFX, FAULT_LOG_SIZE);
if (buf == NULL) {
printf("malloc failed!\r\n");
return;
}
(void)memset_s(buf, FAULT_LOG_SIZE, 0, FAULT_LOG_SIZE);
len = snprintf_s(buf, FAULT_LOG_SIZE, FAULT_LOG_SIZE - 1,
ERROR_INFO_HEADER ERROR_INFO_HEADER_FORMAT,
info->event, info->module, info->errorDesc);
if (len <= 0) {
printf("buf isn't enough or vsnprintf_s failed\r\n");
hi_free(HI_MOD_ID_SAL_DFX, buf);
return;
}
(hi_void)FullWriteFile(FAULT_LOG_PATH, buf, len, 0);
hi_free(HI_MOD_ID_SAL_DFX, buf);
}
void SystemModuleReset(struct ErrorInfo *info)
{
if (info == NULL) {
printf("info: %p\r\n", info);
return;
}
}
int SystemModuleGetLastLogInfo(struct ErrorInfo *info)
{
hi_u16 err_id = 0;
hi_u32 rid = 0;
hi_u32 ret;
hi_syserr_info *errInfo;
char *data;
if (info == NULL) {
printf("info: %p\r\n", info);
return -1;
}
errInfo = hi_malloc(HI_MOD_ID_SAL_DFX, sizeof(*errInfo));
if (errInfo == NULL) {
printf("hi_malloc failed!\r\n");
return -1;
}
memset_s(errInfo, sizeof(*errInfo), 0, sizeof(*errInfo));
ret = hi_syserr_get(errInfo);
if (ret != HI_ERR_SUCCESS) {
printf("No crash dump found!\r\n");
hi_free(HI_MOD_ID_SAL_DFX, errInfo);
return -1;
}
hi_free(HI_MOD_ID_SAL_DFX, errInfo);
ret = hi_syserr_get_reboot_reason(&err_id, &rid);
if (ret == HI_ERR_SUCCESS) {
printf("latest reboot reason:\r\neid:%d,"
" rid:%d:\r\n", err_id, rid);
}
(void)memset_s(info, sizeof(*info), 0, sizeof(*info));
data = GetEvent(err_id);
(void)strncpy_s(info->event, sizeof(info->event) - 1,
data, strlen(data));
(void)strncpy_s(info->module, sizeof(info->module) - 1,
MODULE_SYSTEM, strlen(MODULE_SYSTEM));
data = GetErrorDesc(err_id);
(void)strncpy_s(info->errorDesc, sizeof(info->errorDesc) - 1,
data, strlen(data));
return 0;
}
int SystemModuleSaveLastLog(const char *logDir, struct ErrorInfo *info)
{
hi_u32 ret;
hi_syserr_info *errInfo;
(void)logDir;
errInfo = hi_malloc(HI_MOD_ID_SAL_DFX, sizeof(*errInfo));
if (errInfo == NULL) {
printf("hi_malloc failed!\r\n");
return -1;
}
memset_s(errInfo, sizeof(*errInfo), 0, sizeof(*errInfo));
ret = hi_syserr_get(errInfo);
if (ret != HI_ERR_SUCCESS) {
printf("No crash dump found!\r\n");
return -1;
} else {
SaveFaultLog(info, errInfo);
SetLogSavedFlag();
}
hi_free(HI_MOD_ID_SAL_DFX, errInfo);
return 0;
}
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File
View File

Some files were not shown because too many files have changed in this diff Show More