Skip to content

Commit

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

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

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

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

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

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

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


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

Expand All @@ -133,8 +141,8 @@
#### b、打开Cygwin终端进入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 +156,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`下载文件。
22 changes: 15 additions & 7 deletions vendor/platform/Simcom-A7670C/BoatPlatoneDemo/README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ 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/BoatPlatoneDemo/A7670CRootDirCode/sc_demo` into `<A7670C Root>`.
2. Copy files under `BoAT-X-Framework/vendor/platform/Simcom-A7670C/BoatPlatoneDemo/A7670CRootDirCode/sc_demo/src` into `<A7670C Root>/sc_demo/src`.

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

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


After these files copied, the directory structure should look like:
Expand Down Expand Up @@ -120,6 +122,12 @@ 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/platone
```

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_platone_demo.c)
list(APPEND sc_demo_src ./src/my_contract.cpp.abi.c)
```


## Compile BoAT-X-Framework Static library
Expand All @@ -131,11 +139,11 @@ 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.
Expand All @@ -149,7 +157,7 @@ After these files copied, the directory structure should look like:
```
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 13a4529

Please sign in to comment.