1 Star 1 Fork 0

SiliconLabs/cpc-daemon

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
iostream_bridge.md 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
Alexandre Autotte 提交于 3年前 . Add Doc

CPC Host Iostream Bridge

The CPC host code comes with the python script cpc_iostream_bridge.py under the script folder.

This can be used in conjunction with the cpc_iostream and cli components on the secondary side. Refer to the CLI documentation and IO stream documentation to se tup a CLI application on your secondary device. Once your secondary application and the CPC daemon are running, calling the script opens the CLI endpoint on the host side and opens a network bridge to redirect any data received and transfered on the CPC CLI endpoint over to the network connection. Once the bridge is ready and listening, a telnet terminal can be opened to send and receive data over CPC CLI endpoint.

The cpc_iostream_bridge.py script takes 3 mandatory arguments:

  • -n, --name INSTANCE_NAME: The CPC daemon instance name
  • -l, --library LIB_NAME: Path and name of the CPC library
  • -p, --port PORT_NUMBER: Network bridge port number to use

And one optional argument (-v, --verbose) can be passed to enable verbose tracing.

Here is an example of a cpc_iostream_bridge.py usage:

$ python cpc_iostream_bridge.py -n cpcd_0 -l build/libcpc.so -p 8080 -v
BRIDGE: Listen OK
BRIDGE: CPC Init success

You can then test the bridge by opening a telnet connection:

$ telnet localhost 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/SiliconLabs/cpc_daemon.git
git@gitee.com:SiliconLabs/cpc_daemon.git
SiliconLabs
cpc_daemon
cpc-daemon
main

搜索帮助