Skip to content

Commit

Permalink
feat(Simcom-A7670C):
Browse files Browse the repository at this point in the history
Add fabric to Simcom-A7670C #1378
BoATE-910
  • Loading branch information
zt222 committed Feb 21, 2023
1 parent 13a4529 commit 62f5e98
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 17 deletions.
22 changes: 14 additions & 8 deletions vendor/platform/Simcom-A7670C/BoatFabricDemo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@

1、拷贝 BoAT代码,将 BoAT-X-Framework 整个文件夹拷贝至`<A7670C Root>`下。

2、拷贝并覆盖 `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_demo``<A7670C Root>`下。
2、拷贝 `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_demo/src`下的文件到`<A7670C Root>/sc_demo/src`下。

3、拷贝并覆盖 `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_application.c``<A7670C Root>`下。
3、拷贝 `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_demo/inc`下的文件到`<A7670C Root>/sc_demo/inc`下。

4、拷贝并覆盖 `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_application.c``<A7670C Root>`下。

4、拷贝并覆盖 `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/BoAT-X-Framework``<A7670C Root>/BoAT-X-Framework`下。

拷贝后的目录和文件结构如下:
```
Expand Down Expand Up @@ -120,6 +121,11 @@
${CMAKE_SOURCE_DIR}/BoAT-X-Framework/sdk/network/hlfabric
```

再找到 `list(APPEND sc_demo_src ./src/demo_helloworld.c)`,然后在下方添加以下内容:
```
list(APPEND sc_demo_src ./src/boat_fabric_demo.c)
```


## 四、编译BoAT-X-Framework静态库

Expand All @@ -130,11 +136,11 @@
PLATFORM_TARGET ?= Simcom-A7670C
```

#### b、打开Cygwin终端进入BoAT-X-Framework目录编译BoAT静态库
#### b、打开终端进入BoAT-X-Framework目录编译BoAT静态库
```
cd <A7670C Root>/BoAT-X-Framework
../tools/win32/GNUmake.exe clean
../tools/win32/GNUmake.exe all
make clean
make all
```

编译成功后,在BoAT-X-Framework/lib下会生成静态库`libboatvendor.a``libboatwallet.a`
Expand All @@ -148,7 +154,7 @@
```
cd <A7670C Root>
make clean
make A7670C_LANS
make A7670C_LANS_1606_V701
```

编译成功会在`<A7670C Root>/out`下生成`A7670C_LANS.zip`下载文件。
编译成功会在`<A7670C Root>/out`下生成`A7670C_LANS_1606_V701.zip`下载文件。
24 changes: 15 additions & 9 deletions vendor/platform/Simcom-A7670C/BoatFabricDemo/README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ Assuming `<A7670C Root>` to be the root directory of A7670C SDK:

1. Copy the entire BoAT-X-Framework directory into `<A7670C Root>/app`.

2. Copy `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_demo` into `<A7670C Root>`.
2. Copy files under `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_demo/src` into `<A7670C Root>/sc_demo/src`.

3. Copy `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_application.c` into `<A7670C Root>`.
3. Copy files under `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_demo/inc` into `<A7670C Root>/sc_demo/inc`.

4. Copy and replace `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/A7670CRootDirCode/sc_application.c` into `<A7670C Root>`.

4. Copy `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatFabricDemo/BoAT-X-Framework` into `<A7670C Root>/BoAT-X-Framework`.


After these files copied, the directory structure should look like:
Expand Down Expand Up @@ -120,6 +121,11 @@ After these files copied, the directory structure should look like:
${CMAKE_SOURCE_DIR}/BoAT-X-Framework/vendor/platform/include
${CMAKE_SOURCE_DIR}/BoAT-X-Framework/sdk/network/hlfabric
```

Then, find `list(APPEND sc_demo_src ./src/demo_helloworld.c)`, add the following content in the last new line:
```
list(APPEND sc_demo_src ./src/boat_fabric_demo.c)
```


## Compile BoAT-X-Framework Static library
Expand All @@ -131,25 +137,25 @@ After these files copied, the directory structure should look like:
PLATFORM_TARGET ?= Simcom-A7670C
```

#### b. Open a Cygwin shell, enter <A7670C Root>/BoAT-X-Framework directory and compile BoAT static library
#### b. Open a Windows cmd, enter <A7670C Root>/BoAT-X-Framework directory and compile BoAT static library
```
cd <A7670C Root>/BoAT-X-Framework
../tools/win32/GNUmake.exe clean
../tools/win32/GNUmake.exe all
make clean
make all
```

After compiling, static library `libboatvendor.a` and `libboatwallet.a` will be created in `<A7670C Root>/BoAT-X-Framework/lib` directory.


### 2. Build demo program, generate .zip file for download

Demo code for accessing blockchain through BoAT-X Framework is in `<A7670C Root>/sc_demo/src/boat_fabric_demo.c`
Demo code for accessing blockchain through BoAT-X Framework is in `<A7670C Root>/sc_demo/src/boat_fabric_demo.c`.

Open a Windows cmd window and build the download file:
```
cd <A7670C Root>
make clean
make A7670C_LANS
make A7670C_LANS_1606_V701
```

The download file `A7670C_LANS.zip` will be generated under `<A7670C Root>/out` once compiled successfully.
The download file `A7670C_LANS_1606_V701.zip` will be generated under `<A7670C Root>/out` once compiled successfully.

0 comments on commit 62f5e98

Please sign in to comment.