vendor: change "wblink_demo" to "iotlink_demo"

- Change "wblink_demo" to "iotlink_demo"
- Remove display_demo
- Update README_zh.md

Change-Id: I66f24a75028c1c0ef4da4ac09c9dde44c4478cd9

Signed-off-by: haobo <haobo@chipsea.com>
This commit is contained in:
haobo
2022-04-01 09:37:51 +08:00
parent a73bcf0fea
commit ad4860ef5d
33 changed files with 516 additions and 928 deletions
+20 -6
View File
@@ -2,22 +2,34 @@
## 介绍
该仓库托管芯海科技开发的产品例代码,主要包括用于演示wifi连接的示例代码。
该仓库托管芯海科技开发的产品例代码,主要包括:
1. 连接示例代码。
2. XTS示例代码。
3. 软总线示例代码。
该仓库在整个Openharmony架构中主要用于配置产品信息(config.json),比如:产品的名称、开发板的名称、公司名称以及产品包含的
子系统列表。Openharmony构建系统会根据该配置来生成构建使用的基础信息。
## 软件架构
支持基于芯海CST85F01 SoC 的cst85_wblink单板进行开发的产品例。
支持基于芯海CST85F01的cst85_wblink单板进行开发的产品例。
代码路径:
```
vendor/chipsea/ --- vendor_chipsea仓库路径
── wblink_demo --- 样例
vendor/chipsea/ // vendor_chipsea 仓的仓库路径
── dsoftbus_demo // 软总线示例代码
├── iotlink_demo // 连接示例代码
└── xts_demo // XTS示例代码
```
* 软总线的示例主要用于演示验证软总线的服务启动功能,其依赖于软总线的框架。
* 连接示例主要用于演示WIFI的STATION和AP的功能。
* XTS示例主要用于进行XTS的测试验证。
## 安装教程
参考 [安装调试教程](https://gitee.com/openharmony-sig/device_soc_chipsea/blob/master/README.md)
参考 [安装调试教程](https://gitee.com/openharmony-sig/device_soc_chipsea/blob/master/README_zh.md)
## 使用说明
@@ -30,5 +42,7 @@ vendor/chipsea/ --- vendor_chipsea仓库路径
## 相关仓
[device/soc/chipsea](https://gitee.com/openharmony/device_soc_chipsea/blob/HEAD/README_zh.md)
[device_board_chipsea](https://gitee.com/openharmony-sig/device_board_chipsea)
[device_soc_chipsea](https://gitee.com/openharmony-sig/device_soc_chipsea)
-19
View File
@@ -1,19 +0,0 @@
# Copyright (c) 2021 Chipsea Co., Ltd. All rights reserved.
# 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.
static_library("example") {
sources = [
"example.c",
]
deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static" ]
}
-96
View File
@@ -1,96 +0,0 @@
{
"product_name": "display_demo",
"ohos_version": "OpenHarmony 2.3",
"version": "3.0",
"device_company": "chipsea",
"board": "cst85_wblink",
"kernel_type": "liteos_m",
"kernel_version": "3.0.0",
"subsystems": [
{
"subsystem": "kernel",
"components": [
{ "component": "liteos_m",
"features":[
]
}
]
},
{
"subsystem": "utils",
"components": [
{
"component": "kv_store"
}
]
},
{
"subsystem": "startup",
"components": [
{
"component": "bootstrap_lite"
},
{
"component": "syspara_lite",
"features": [
"enable_ohos_startup_syspara_lite_use_posix_file_api = true"
]
}
]
},
{
"subsystem": "hiviewdfx",
"components": [
{
"component": "hilog_lite",
"optional": "true"
},
{
"component": "hievent_lite",
"optional": "true"
}
]
},
{
"subsystem": "distributedschedule",
"components": [
{
"component": "samgr_lite",
"features": [
"config_ohos_distributedschedule_samgr_lite_shared_task_size = 4096"
]
}
]
},
{
"subsystem": "communication",
"components": [
{
"component": "wifi_lite",
"optional": "true"
}
]
}
],
"vendor_adapter_dir": "",
"third_party_dir": "//third_party",
"product_adapter_dir": "//vendor/chipsea/display_demo/hals",
"ohos_product_type":"",
"ohos_manufacture":"",
"ohos_brand":"",
"ohos_market_name":"",
"ohos_product_series":"",
"ohos_product_model":"",
"ohos_software_model":"",
"ohos_hardware_model":"",
"ohos_hardware_profile":"",
"ohos_serial":"",
"ohos_bootloader_version":"",
"ohos_secure_patch_level":"",
"ohos_abi_list":""
}
-8
View File
@@ -1,8 +0,0 @@
# LOSCFG_ARCH_UNALIGNED_EXC is not set
LOSCFG_SOC_SERIES_CST85=y
LOSCFG_KERNEL_BACKTRACE=y
LOSCFG_KERNEL_CPUP=y
LOSCFG_PLATFORM_EXC=y
LOSCFG_LIBC_NEWLIB=y
LOSCFG_DRIVERS_HDF=y
LOSCFG_DRIVERS_HDF_PLATFORM=y
-10
View File
@@ -1,10 +0,0 @@
{
"parts": {
"product_display_demo": {
"module_list": [
"//vendor/chipsea/display_demo:display_demo"
]
}
},
"subsystem": "product_display_demo"
}
@@ -1,35 +1,35 @@
/*
* 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.
*/
#include "softbus_config_adapter.h"
#define MAX_BYTES_LENGTH 4194304
void SoftbusConfigAdapterInit(const ConfigSetProc *sets)
{
int32_t val;
val = MAX_BYTES_LENGTH;
sets->SetConfig(SOFTBUS_INT_MAX_BYTES_LENGTH, (unsigned char*)&val, sizeof(val));
val = 0x1;
sets->SetConfig(SOFTBUS_INT_AUTH_ABILITY_COLLECTION, (unsigned char*)&val, sizeof(val));
val = 3; // SOFTBUS_LOG_ERROR
sets->SetConfig(SOFTBUS_INT_ADAPTER_LOG_LEVEL, (unsigned char*)&val, sizeof(val));
val = 0;
sets->SetConfig(SOFTBUS_INT_AUTO_NETWORKING_SWITCH, (unsigned char*)&val, sizeof(val));
unsigned char *ifName = "0:eth0,1:wl1\0";
sets->SetConfig(SOFTBUS_STR_LNN_NET_IF_NAME, ifName, 13);
}
/*
* 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.
*/
#include "softbus_config_adapter.h"
#define MAX_BYTES_LENGTH 4194304
void SoftbusConfigAdapterInit(const ConfigSetProc *sets)
{
int32_t val;
val = MAX_BYTES_LENGTH;
sets->SetConfig(SOFTBUS_INT_MAX_BYTES_LENGTH, (unsigned char*)&val, sizeof(val));
val = 0x1;
sets->SetConfig(SOFTBUS_INT_AUTH_ABILITY_COLLECTION, (unsigned char*)&val, sizeof(val));
val = 3; // SOFTBUS_LOG_ERROR
sets->SetConfig(SOFTBUS_INT_ADAPTER_LOG_LEVEL, (unsigned char*)&val, sizeof(val));
val = 0;
sets->SetConfig(SOFTBUS_INT_AUTO_NETWORKING_SWITCH, (unsigned char*)&val, sizeof(val));
unsigned char *ifName = "0:eth0,1:wl1\0";
sets->SetConfig(SOFTBUS_STR_LNN_NET_IF_NAME, ifName, 13);
}
@@ -1,34 +1,34 @@
/*
* 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.
*/
#ifndef SOFTBUS_CONFIG_ADAPT_H
#define SOFTBUS_CONFIG_ADAPT_H
#include "softbus_config_type.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
void SoftbusConfigAdapterInit(const ConfigSetProc *sets);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif
/*
* 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.
*/
#ifndef SOFTBUS_CONFIG_ADAPT_H
#define SOFTBUS_CONFIG_ADAPT_H
#include "softbus_config_type.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
void SoftbusConfigAdapterInit(const ConfigSetProc *sets);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif
@@ -1,65 +1,65 @@
/*
* 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.
*/
#ifndef SOFTBUS_CONFIG_TYPE_H
#define SOFTBUS_CONFIG_TYPE_H
#include <stdint.h>
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
typedef enum {
SOFTBUS_INT_MAX_BYTES_LENGTH, /* the default val is 4194304 */
SOFTBUS_INT_MAX_MESSAGE_LENGTH, /* the default val is 4096 */
SOFTBUS_INT_CONN_BR_MAX_DATA_LENGTH, /* the default val is 4096 */
SOFTBUS_INT_CONN_RFCOM_SEND_MAX_LEN, /* the default val is 990 */
SOFTBUS_INT_CONN_BR_RECEIVE_MAX_LEN, /* the default val is 10 */
SOFTBUS_INT_CONN_BR_MAX_CONN_NUM, /* the default val is 20 */
SOFTBUS_INT_CONN_TCP_MAX_LENGTH, /* the default val is 3072 */
SOFTBUS_INT_CONN_TCP_MAX_CONN_NUM, /* the default val is 30 */
SOFTBUS_INT_CONN_TCP_TIME_OUT, /* the default val is 100 */
SOFTBUS_INT_MAX_NODE_STATE_CB_CNT, /* the default val is 10 */
SOFTBUS_INT_MAX_LNN_CONNECTION_CNT, /* the default val is 10 */
SOFTBUS_INT_LNN_SUPPORT_CAPBILITY, /* the default val is 30 */
SOFTBUS_INT_AUTH_ABILITY_COLLECTION, /* the default val is 0 */
SOFTBUS_INT_ADAPTER_LOG_LEVEL, /* the default val is 0 */
SOFTBUS_STR_STORAGE_DIRECTORY, /* the max length is MAX_STORAGE_PATH_LEN */
SOFTBUS_INT_SUPPORT_TCP_PROXY, /* the l0 devices val is 0 , others is 1 */
SOFTBUS_INT_SUPPORT_SECLECT_INTERVAL, /* the l0 devices val is 100000us , others is 10000us */
SOFTBUS_INT_LNN_UDID_INIT_DELAY_LEN, /* the default val is 0 */
SOFTBUS_STR_LNN_NET_IF_NAME, /* the default val is 0:eth0,1:wlan0 */
SOFTBUS_INT_LNN_MAX_CONCURENT_NUM, /* the default val is 0 */
SOFTBUS_INT_AUTH_MAX_BYTES_LENGTH, /* L1: 4K, L2: 64K */
SOFTBUS_INT_AUTH_MAX_MESSAGE_LENGTH, /* L1: 1K, L2: 4K */
SOFTBUS_INT_AUTO_NETWORKING_SWITCH, /* support auto networking: true, not support: false */
SOFTBUS_BOOL_SUPPORT_TOPO, /* support: true, not support: false */
SOFTBUS_CONFIG_TYPE_MAX,
} ConfigType;
typedef struct {
int32_t (* SetConfig)(ConfigType type, const unsigned char *val, uint32_t len);
} ConfigSetProc;
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
/*
* 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.
*/
#ifndef SOFTBUS_CONFIG_TYPE_H
#define SOFTBUS_CONFIG_TYPE_H
#include <stdint.h>
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
typedef enum {
SOFTBUS_INT_MAX_BYTES_LENGTH, /* the default val is 4194304 */
SOFTBUS_INT_MAX_MESSAGE_LENGTH, /* the default val is 4096 */
SOFTBUS_INT_CONN_BR_MAX_DATA_LENGTH, /* the default val is 4096 */
SOFTBUS_INT_CONN_RFCOM_SEND_MAX_LEN, /* the default val is 990 */
SOFTBUS_INT_CONN_BR_RECEIVE_MAX_LEN, /* the default val is 10 */
SOFTBUS_INT_CONN_BR_MAX_CONN_NUM, /* the default val is 20 */
SOFTBUS_INT_CONN_TCP_MAX_LENGTH, /* the default val is 3072 */
SOFTBUS_INT_CONN_TCP_MAX_CONN_NUM, /* the default val is 30 */
SOFTBUS_INT_CONN_TCP_TIME_OUT, /* the default val is 100 */
SOFTBUS_INT_MAX_NODE_STATE_CB_CNT, /* the default val is 10 */
SOFTBUS_INT_MAX_LNN_CONNECTION_CNT, /* the default val is 10 */
SOFTBUS_INT_LNN_SUPPORT_CAPBILITY, /* the default val is 30 */
SOFTBUS_INT_AUTH_ABILITY_COLLECTION, /* the default val is 0 */
SOFTBUS_INT_ADAPTER_LOG_LEVEL, /* the default val is 0 */
SOFTBUS_STR_STORAGE_DIRECTORY, /* the max length is MAX_STORAGE_PATH_LEN */
SOFTBUS_INT_SUPPORT_TCP_PROXY, /* the l0 devices val is 0 , others is 1 */
SOFTBUS_INT_SUPPORT_SECLECT_INTERVAL, /* the l0 devices val is 100000us , others is 10000us */
SOFTBUS_INT_LNN_UDID_INIT_DELAY_LEN, /* the default val is 0 */
SOFTBUS_STR_LNN_NET_IF_NAME, /* the default val is 0:eth0,1:wlan0 */
SOFTBUS_INT_LNN_MAX_CONCURENT_NUM, /* the default val is 0 */
SOFTBUS_INT_AUTH_MAX_BYTES_LENGTH, /* L1: 4K, L2: 64K */
SOFTBUS_INT_AUTH_MAX_MESSAGE_LENGTH, /* L1: 1K, L2: 4K */
SOFTBUS_INT_AUTO_NETWORKING_SWITCH, /* support auto networking: true, not support: false */
SOFTBUS_BOOL_SUPPORT_TOPO, /* support: true, not support: false */
SOFTBUS_CONFIG_TYPE_MAX,
} ConfigType;
typedef struct {
int32_t (* SetConfig)(ConfigType type, const unsigned char *val, uint32_t len);
} ConfigSetProc;
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif
+171 -171
View File
@@ -1,171 +1,171 @@
/*
* Copyright (c) 2021 chipsea Co., Ltd. All rights reserved.
* 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 "hal_sys_param.h"
#define OHOS_DEVICE_TYPE "UNKNOWN"
#define OHOS_DISPLAY_VERSION "OpenHarmony-2.2-Beta2"
#define OHOS_MANUFACTURE "chipsea"
#define OHOS_BRAND "chipsea"
#define OHOS_MARKET_NAME "****"
#define OHOS_PRODUCT_SERIES "****"
#define OHOS_PRODUCT_MODEL "****"
#define OHOS_SOFTWARE_MODEL "****"
#define OHOS_HARDWARE_MODEL "cst85"
#define OHOS_HARDWARE_PROFILE "aout:true,display:true"
#define OHOS_BOOTLOADER_VERSION "bootloader"
#define OHOS_ABI_LIST "****"
#define OHOS_SERIAL "1234567890"
#define OHOS_FIRST_API_VERSION 1
#define ETH_ALEN 6
#define MAC_BITS 4
#define HEX_A 0xa
#define MAC_HIGH_MASK 0xf0
#define MAC_LOW_MASK 0x0f
#define CHAR_NUM_OFFSET 0x30
#define CHAR_CAPITAL_OFFSET 0x37
#define STR_END_FLAG '\0'
typedef unsigned char u8;
static char serialNumber[2*ETH_ALEN + 1];
const char* HalGetDeviceType(void)
{
return OHOS_DEVICE_TYPE;
}
const char* HalGetManufacture(void)
{
return OHOS_MANUFACTURE;
}
const char* HalGetBrand(void)
{
return OHOS_BRAND;
}
const char* HalGetMarketName(void)
{
return OHOS_MARKET_NAME;
}
const char* HalGetProductSeries(void)
{
return OHOS_PRODUCT_SERIES;
}
const char* HalGetProductModel(void)
{
return OHOS_PRODUCT_MODEL;
}
const char* HalGetSoftwareModel(void)
{
return OHOS_SOFTWARE_MODEL;
}
const char* HalGetHardwareModel(void)
{
return OHOS_HARDWARE_MODEL;
}
const char* HalGetHardwareProfile(void)
{
return OHOS_HARDWARE_PROFILE;
}
static char Hex2Char(u8 hex)
{
if (hex < HEX_A) {
return hex + CHAR_NUM_OFFSET;
} else {
return hex + CHAR_CAPITAL_OFFSET;
}
}
const char* HalGetSerial(void)
{
char macAddr[ETH_ALEN];
// as devboard has no production serial number, we just
// use wifi mac address as device serial number.
if (serialNumber[0] == STR_END_FLAG) {
GetDeviceMacAddress(macAddr);
int j = 0;
for (int i = 0; i < ETH_ALEN; i++) {
u8 lowFour, highFour;
highFour = (macAddr[i] & MAC_HIGH_MASK) >> MAC_BITS;
serialNumber[j] = Hex2Char(highFour);
j++;
lowFour = macAddr[i] & MAC_LOW_MASK;
serialNumber[j] = Hex2Char(lowFour);
j++;
}
}
return serialNumber;
}
const char* HalGetBootloaderVersion(void)
{
return OHOS_BOOTLOADER_VERSION;
}
const char* HalGetAbiList(void)
{
return OHOS_ABI_LIST;
}
const char* HalGetDisplayVersion(void)
{
return OHOS_DISPLAY_VERSION;
}
const char* HalGetIncrementalVersion(void)
{
return INCREMENTAL_VERSION;
}
const char* HalGetBuildType(void)
{
return BUILD_TYPE;
}
const char* HalGetBuildUser(void)
{
return BUILD_USER;
}
const char* HalGetBuildHost(void)
{
return BUILD_HOST;
}
const char* HalGetBuildTime(void)
{
return BUILD_TIME;
}
int HalGetFirstApiVersion(void)
{
return OHOS_FIRST_API_VERSION;
}
/**
* @brief implement for js kvstorekit/filekit
*/
const char *GetDataPath()
{
return "/data";
}
/*
* Copyright (c) 2021 chipsea Co., Ltd. All rights reserved.
* 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 "hal_sys_param.h"
#define OHOS_DEVICE_TYPE "UNKNOWN"
#define OHOS_DISPLAY_VERSION "OpenHarmony-2.2-Beta2"
#define OHOS_MANUFACTURE "chipsea"
#define OHOS_BRAND "chipsea"
#define OHOS_MARKET_NAME "****"
#define OHOS_PRODUCT_SERIES "****"
#define OHOS_PRODUCT_MODEL "****"
#define OHOS_SOFTWARE_MODEL "****"
#define OHOS_HARDWARE_MODEL "cst85"
#define OHOS_HARDWARE_PROFILE "aout:true,display:true"
#define OHOS_BOOTLOADER_VERSION "bootloader"
#define OHOS_ABI_LIST "****"
#define OHOS_SERIAL "1234567890"
#define OHOS_FIRST_API_VERSION 1
#define ETH_ALEN 6
#define MAC_BITS 4
#define HEX_A 0xa
#define MAC_HIGH_MASK 0xf0
#define MAC_LOW_MASK 0x0f
#define CHAR_NUM_OFFSET 0x30
#define CHAR_CAPITAL_OFFSET 0x37
#define STR_END_FLAG '\0'
typedef unsigned char u8;
static char serialNumber[2*ETH_ALEN + 1];
const char* HalGetDeviceType(void)
{
return OHOS_DEVICE_TYPE;
}
const char* HalGetManufacture(void)
{
return OHOS_MANUFACTURE;
}
const char* HalGetBrand(void)
{
return OHOS_BRAND;
}
const char* HalGetMarketName(void)
{
return OHOS_MARKET_NAME;
}
const char* HalGetProductSeries(void)
{
return OHOS_PRODUCT_SERIES;
}
const char* HalGetProductModel(void)
{
return OHOS_PRODUCT_MODEL;
}
const char* HalGetSoftwareModel(void)
{
return OHOS_SOFTWARE_MODEL;
}
const char* HalGetHardwareModel(void)
{
return OHOS_HARDWARE_MODEL;
}
const char* HalGetHardwareProfile(void)
{
return OHOS_HARDWARE_PROFILE;
}
static char Hex2Char(u8 hex)
{
if (hex < HEX_A) {
return hex + CHAR_NUM_OFFSET;
} else {
return hex + CHAR_CAPITAL_OFFSET;
}
}
const char* HalGetSerial(void)
{
char macAddr[ETH_ALEN];
// as devboard has no production serial number, we just
// use wifi mac address as device serial number.
if (serialNumber[0] == STR_END_FLAG) {
GetDeviceMacAddress(macAddr);
int j = 0;
for (int i = 0; i < ETH_ALEN; i++) {
u8 lowFour, highFour;
highFour = (macAddr[i] & MAC_HIGH_MASK) >> MAC_BITS;
serialNumber[j] = Hex2Char(highFour);
j++;
lowFour = macAddr[i] & MAC_LOW_MASK;
serialNumber[j] = Hex2Char(lowFour);
j++;
}
}
return serialNumber;
}
const char* HalGetBootloaderVersion(void)
{
return OHOS_BOOTLOADER_VERSION;
}
const char* HalGetAbiList(void)
{
return OHOS_ABI_LIST;
}
const char* HalGetDisplayVersion(void)
{
return OHOS_DISPLAY_VERSION;
}
const char* HalGetIncrementalVersion(void)
{
return INCREMENTAL_VERSION;
}
const char* HalGetBuildType(void)
{
return BUILD_TYPE;
}
const char* HalGetBuildUser(void)
{
return BUILD_USER;
}
const char* HalGetBuildHost(void)
{
return BUILD_HOST;
}
const char* HalGetBuildTime(void)
{
return BUILD_TIME;
}
int HalGetFirstApiVersion(void)
{
return OHOS_FIRST_API_VERSION;
}
/**
* @brief implement for js kvstorekit/filekit
*/
const char *GetDataPath()
{
return "/data";
}
+103 -103
View File
@@ -1,103 +1,103 @@
/*
* Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved.
* 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 "hal_token.h"
#include "ohos_errno.h"
#include "ohos_types.h"
static int OEMReadToken(char *token, unsigned int len)
{
// OEM need add here, read token from device
(void)(token);
(void)(len);
return EC_SUCCESS;
}
static int OEMWriteToken(const char *token, unsigned int len)
{
// OEM need add here, write token to device
(void)(token);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetAcKey(char *acKey, unsigned int len)
{
// OEM need add here, get AcKey
(void)(acKey);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetProdId(char *productId, unsigned int len)
{
// OEM need add here, get ProdId
(void)(productId);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetProdKey(char *productKey, unsigned int len)
{
// OEM need add here, get ProdKey
(void)(productKey);
(void)(len);
return EC_SUCCESS;
}
int HalReadToken(char *token, unsigned int len)
{
if (token == NULL) {
return EC_FAILURE;
}
return OEMReadToken(token, len);
}
int HalWriteToken(const char *token, unsigned int len)
{
if (token == NULL) {
return EC_FAILURE;
}
return OEMWriteToken(token, len);
}
int HalGetAcKey(char *acKey, unsigned int len)
{
if (acKey == NULL) {
return EC_FAILURE;
}
return OEMGetAcKey(acKey, len);
}
int HalGetProdId(char *productId, unsigned int len)
{
if (productId == NULL) {
return EC_FAILURE;
}
return OEMGetProdId(productId, len);
}
int HalGetProdKey(char *productKey, unsigned int len)
{
if (productKey == NULL) {
return EC_FAILURE;
}
return OEMGetProdKey(productKey, len);
}
/*
* Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., Ltd. All rights reserved.
* 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 "hal_token.h"
#include "ohos_errno.h"
#include "ohos_types.h"
static int OEMReadToken(char *token, unsigned int len)
{
// OEM need add here, read token from device
(void)(token);
(void)(len);
return EC_SUCCESS;
}
static int OEMWriteToken(const char *token, unsigned int len)
{
// OEM need add here, write token to device
(void)(token);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetAcKey(char *acKey, unsigned int len)
{
// OEM need add here, get AcKey
(void)(acKey);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetProdId(char *productId, unsigned int len)
{
// OEM need add here, get ProdId
(void)(productId);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetProdKey(char *productKey, unsigned int len)
{
// OEM need add here, get ProdKey
(void)(productKey);
(void)(len);
return EC_SUCCESS;
}
int HalReadToken(char *token, unsigned int len)
{
if (token == NULL) {
return EC_FAILURE;
}
return OEMReadToken(token, len);
}
int HalWriteToken(const char *token, unsigned int len)
{
if (token == NULL) {
return EC_FAILURE;
}
return OEMWriteToken(token, len);
}
int HalGetAcKey(char *acKey, unsigned int len)
{
if (acKey == NULL) {
return EC_FAILURE;
}
return OEMGetAcKey(acKey, len);
}
int HalGetProdId(char *productId, unsigned int len)
{
if (productId == NULL) {
return EC_FAILURE;
}
return OEMGetProdId(productId, len);
}
int HalGetProdKey(char *productKey, unsigned int len)
{
if (productKey == NULL) {
return EC_FAILURE;
}
return OEMGetProdKey(productKey, len);
}
@@ -11,8 +11,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
print("CHIPSEA-CST85F01-display_demo")
group("display_demo") {
print("CHIPSEA-CST85F01-iotlink_demo")
group("iotlink_demo") {
deps = [
"app:example"
]
@@ -14,6 +14,7 @@
declare_args() {
wifi_sta_demo = false
wifi_ap_demo = false
led_demo = false
}
static_library("example") {
@@ -29,4 +30,14 @@ static_library("example") {
if (wifi_ap_demo) {
sources += ["wifi_demo/wifi_ap_demo.c"]
}
if (led_demo) {
sources += ["led_demo/led_example.c"]
include_dirs = [
"//drivers/framework/include/platform",
"//drivers/framework/include/utils",
"//drivers/adapter/khdf/liteos_m/osal/include/",
"//drivers/framework/include/osal",
]
}
}
+58
View File
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2020 Nanjing Xiaoxiongpai Intelligent Technology 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 "gpio_if.h"
#include "rtos_al.h"
#include "dbg.h"
#include "ohos_init.h"
#define LED_GPIO 0
/**
* @brief led task output high and low levels to turn on and off LED
*
*/
static void LedTask(void)
{
// set GPIO_2 is output mode
uint16_t gpioVal;
while (1) {
if (GpioRead(LED_GPIO, &gpioVal) == HDF_SUCCESS) {
if (gpioVal == GPIO_VAL_HIGH) {
GpioWrite(LED_GPIO, GPIO_VAL_LOW);
} else {
GpioWrite(LED_GPIO, GPIO_VAL_HIGH);
}
}
rtos_task_suspend(1000);
}
}
/**
* @brief Main Entry of the Led Example
*
*/
void LedExampleEntry(void)
{
dbg("[%s:%d]: %s\n", __FILE__, __LINE__, __func__);
if (rtos_task_create(LedTask, "led demo task", 0, 0x500, NULL, RTOS_TASK_PRIORITY(1), NULL)) {
return -1;
}
}
SYS_RUN(LedExampleEntry);
@@ -1,5 +1,5 @@
{
"product_name": "wblink_demo",
"product_name": "iotlink_demo",
"ohos_version": "OpenHarmony 2.3",
"version": "3.0",
"device_company": "chipsea",
@@ -80,7 +80,7 @@
],
"vendor_adapter_dir": "",
"third_party_dir": "//third_party",
"product_adapter_dir": "//vendor/chipsea/wblink_demo/hals",
"product_adapter_dir": "//vendor/chipsea/iotlink_demo/hals",
"ohos_product_type":"",
"ohos_manufacture":"",
"ohos_brand":"",
@@ -4,7 +4,8 @@ LOSCFG_KERNEL_BACKTRACE=y
LOSCFG_KERNEL_CPUP=y
LOSCFG_PLATFORM_EXC=y
LOSCFG_LIBC_NEWLIB=y
LOSCFG_FS_LITTLEFS=y
LOSCFG_NET_LWIP=y
LOSCFG_DRIVERS_HDF=y
LOSCFG_DRIVERS_HDF_PLATFORM=y
LOSCFG_FS_LITTLEFS=y
LOSCFG_NET_LWIP=y
LOSCFG_DRIVERS_HDF_PLATFORM_GPIO=y
+10
View File
@@ -0,0 +1,10 @@
{
"parts": {
"product_iotlink_demo": {
"module_list": [
"//vendor/chipsea/iotlink_demo:iotlink_demo"
]
}
},
"subsystem": "product_iotlink_demo"
}
-19
View File
@@ -1,19 +0,0 @@
# 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.
print("CHIPSEA-CST85F01-wblink_demo")
group("wblink_demo") {
deps = [
"app:example"
]
}
-22
View File
@@ -1,22 +0,0 @@
/*
* Copyright (c) 2021 Chipsea Co., Ltd. All rights reserved.
* 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 "ohos_init.h"
#include "log.h"
void DemoSdkMain(void)
{
HILOG_INFO(HILOG_MODULE_APP, "%s: demo entry! \r\n", __func__);
}
APP_FEATURE_INIT(DemoSdkMain);
-25
View File
@@ -1,25 +0,0 @@
# Copyright (c) 2021 chipsea Co., Ltd. All rights reserved.
# 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.
static_library("hal_sysparam") {
sources = [ "hal_sys_param.c" ]
include_dirs = [ "//base/startup/syspara_lite/hals" ]
defines = [
"INCREMENTAL_VERSION=\"${ohos_version}\"",
"BUILD_TYPE=\"${ohos_build_type}\"",
"BUILD_USER=\"${ohos_build_user}\"",
"BUILD_TIME=\"${ohos_build_time}\"",
"BUILD_HOST=\"${ohos_build_host}\"",
"BUILD_ROOTHASH=\"${ohos_build_roothash}\"",
]
}
@@ -1,172 +0,0 @@
/*
* Copyright (c) 2021 chipsea Co., Ltd. All rights reserved.
* 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 "hal_sys_param.h"
#define OHOS_DEVICE_TYPE "linkiot"
#define OHOS_DISPLAY_VERSION "OpenHarmony-2.2-Beta2"
#define OHOS_MANUFACTURE "chipsea"
#define OHOS_BRAND "chipsea"
#define OHOS_MARKET_NAME "****"
#define OHOS_PRODUCT_SERIES "****"
#define OHOS_PRODUCT_MODEL "****"
#define OHOS_SOFTWARE_MODEL "****"
#define OHOS_HARDWARE_MODEL "cst85"
#define OHOS_HARDWARE_PROFILE "aout:true,display:true"
#define OHOS_BOOTLOADER_VERSION "bootloader"
#define OHOS_ABI_LIST "****"
#define OHOS_SERIAL "1234567890"
#define OHOS_FIRST_API_VERSION 1
#define ETH_ALEN 6
#define MAC_BITS 4
#define HEX_A 0xa
#define MAC_HIGH_MASK 0xf0
#define MAC_LOW_MASK 0x0f
#define CHAR_NUM_OFFSET 0x30
#define CHAR_CAPITAL_OFFSET 0x37
#define STR_END_FLAG '\0'
typedef unsigned char u8;
static char serialNumber[2*ETH_ALEN + 1];
const char* HalGetDeviceType(void)
{
return OHOS_DEVICE_TYPE;
}
const char* HalGetManufacture(void)
{
return OHOS_MANUFACTURE;
}
const char* HalGetBrand(void)
{
return OHOS_BRAND;
}
const char* HalGetMarketName(void)
{
return OHOS_MARKET_NAME;
}
const char* HalGetProductSeries(void)
{
return OHOS_PRODUCT_SERIES;
}
const char* HalGetProductModel(void)
{
return OHOS_PRODUCT_MODEL;
}
const char* HalGetSoftwareModel(void)
{
return OHOS_SOFTWARE_MODEL;
}
const char* HalGetHardwareModel(void)
{
return OHOS_HARDWARE_MODEL;
}
const char* HalGetHardwareProfile(void)
{
return OHOS_HARDWARE_PROFILE;
}
static char Hex2Char(u8 hex)
{
if (hex < HEX_A) {
return hex + CHAR_NUM_OFFSET;
} else {
return hex + CHAR_CAPITAL_OFFSET;
}
}
const char* HalGetSerial(void)
{
char macAddr[ETH_ALEN];
// as devboard has no production serial number, we just
// use wifi mac address as device serial number.
if (serialNumber[0] == STR_END_FLAG) {
extern int bwifi_get_own_mac(u8 *addr);
bwifi_get_own_mac(macAddr);
int j = 0;
for (int i = 0; i < ETH_ALEN; i++) {
u8 lowFour, highFour;
highFour = (macAddr[i] & MAC_HIGH_MASK) >> MAC_BITS;
serialNumber[j] = Hex2Char(highFour);
j++;
lowFour = macAddr[i] & MAC_LOW_MASK;
serialNumber[j] = Hex2Char(lowFour);
j++;
}
}
return serialNumber;
}
const char* HalGetBootloaderVersion(void)
{
return OHOS_BOOTLOADER_VERSION;
}
const char* HalGetAbiList(void)
{
return OHOS_ABI_LIST;
}
const char* HalGetDisplayVersion(void)
{
return OHOS_DISPLAY_VERSION;
}
const char* HalGetIncrementalVersion(void)
{
return INCREMENTAL_VERSION;
}
const char* HalGetBuildType(void)
{
return BUILD_TYPE;
}
const char* HalGetBuildUser(void)
{
return BUILD_USER;
}
const char* HalGetBuildHost(void)
{
return BUILD_HOST;
}
const char* HalGetBuildTime(void)
{
return BUILD_TIME;
}
int HalGetFirstApiVersion(void)
{
return OHOS_FIRST_API_VERSION;
}
/**
* @brief implement for js kvstorekit/filekit
*/
const char *GetDataPath()
{
return "/data";
}
-22
View File
@@ -1,22 +0,0 @@
# Copyright (c) 2020 chipsea 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.
static_library("hal_token_static") {
sources = [ "hal_token.c" ]
include_dirs = [
"//base/startup/syspara_lite/hals",
"//utils/native/lite/include",
]
deps = []
}
-104
View File
@@ -1,104 +0,0 @@
/*
* Copyright (c) 2021 chipsea 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 "hal_token.h"
#include "ohos_errno.h"
#include "ohos_types.h"
static int OEMReadToken(char *token, unsigned int len)
{
// OEM need add here, read token from device
(void)(token);
(void)(len);
return EC_SUCCESS;
}
static int OEMWriteToken(const char *token, unsigned int len)
{
// OEM need add here, write token to device
(void)(token);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetAcKey(char *acKey, unsigned int len)
{
// OEM need add here, get AcKey
(void)(acKey);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetProdId(char *productId, unsigned int len)
{
// OEM need add here, get ProdId
(void)(productId);
(void)(len);
return EC_SUCCESS;
}
static int OEMGetProdKey(char *productKey, unsigned int len)
{
// OEM need add here, get ProdKey
(void)(productKey);
(void)(len);
return EC_SUCCESS;
}
int HalReadToken(char *token, unsigned int len)
{
if (token == NULL) {
return EC_FAILURE;
}
return OEMReadToken(token, len);
}
int HalWriteToken(const char *token, unsigned int len)
{
if (token == NULL) {
return EC_FAILURE;
}
return OEMWriteToken(token, len);
}
int HalGetAcKey(char *acKey, unsigned int len)
{
if (acKey == NULL) {
return EC_FAILURE;
}
return OEMGetAcKey(acKey, len);
}
int HalGetProdId(char *productId, unsigned int len)
{
if (productId == NULL) {
return EC_FAILURE;
}
return OEMGetProdId(productId, len);
}
int HalGetProdKey(char *productKey, unsigned int len)
{
if (productKey == NULL) {
return EC_FAILURE;
}
return OEMGetProdKey(productKey, len);
}
-10
View File
@@ -1,10 +0,0 @@
{
"parts": {
"product_wblink_demo": {
"module_list": [
"//vendor/chipsea/wblink_demo:wblink_demo"
]
}
},
"subsystem": "product_wblink_demo"
}
+3 -2
View File
@@ -4,7 +4,8 @@ LOSCFG_KERNEL_BACKTRACE=y
LOSCFG_KERNEL_CPUP=y
LOSCFG_PLATFORM_EXC=y
LOSCFG_LIBC_NEWLIB=y
LOSCFG_FS_LITTLEFS=y
LOSCFG_NET_LWIP=y
LOSCFG_DRIVERS_HDF=y
LOSCFG_DRIVERS_HDF_PLATFORM=y
LOSCFG_FS_LITTLEFS=y
LOSCFG_NET_LWIP=y
LOSCFG_DRIVERS_HDF_PLATFORM_GPIO=y