CoAP Simple Management Protocol (CSMP) is a device lifecycle management protocol optimized for resource constrained devices deployed within large-scale, bandwidth constrained IoT networks.
These instructions describe the build/run process for a C implementation of a sample CSMP Agent which incorporates the Cisco CSMP library csmp-agent-lib
.
These instructions have been verified to work on Ubuntu 20.10 Desktop 64bit (RPi4 build and target platform).
It is assumed a snapshot of the CSMP agent's source repository has been acquired and placed on the build platform via Github repository https://github.com/CiscoDevNet/csmp-agent-lib.
Change your default directory to the root of the CSMP Agent directory structure.
Install build tools. Install build-essential package (gcc compiler, make, etc.) as described here ... https://help.ubuntu.com/community/InstallingCompilers
Confirm build target platform If you are going to build for a different target platform, please set the correct gcc compiler for your target platform by modifying the line "CC=gcc" in "Makefile".
Build
chmod 777 build.sh ./build.sh
If everything goes well, you should see "CsmpAgentLib_sample" executable in "sample" directory.
./build.sh clean
./CsmpAgentLib_sample -d
Or provide full comamnd line parameter set to configure FND server's IPv6 address, agent's registration interval (in seconds), EUI of the Agent (example) ...
./CsmpAgentLib_sample -d 2020::2020 -min 10 -max 100 -eid 00173B1122334455
NOTE: a valid FND IPv6 address must be supplied.
Wireshark network analyzer may be used to observe CSMP messaging exchanged between the CSMP Agent and the FND instance.
Follow the instructions here ... https://itsfoss.com/install-wireshark-ubuntu/. As of this writting, version 3.2.7 is installed.
Wireshark Menu
-> Analyze
-> Decode As...
+
-> Field : UDP port
-> value : 61628
-> Current : CoAP
-> OK
Test your Wireshark install by opening and observing the contents of the sample PCAPs provided in the folder test/*.pcap
.
CSMP messaging implements RESTful idioms with payloads encoded as Type/Length/Value tuples Value is encoded using Google Protocol Buffers.
The Protocol Buffer definitions of CSMP TLVs are contained in the .proto file located in the src/csmpagent/tlvs folder.
See 'src/csmpagent/csmpagent.c' for TLVs supported by the agent GET and POST methods.
Additions to the TLV set require ...
Use protoc-c
(1.3.3 or later) to compile *.proto file into *.c and *.h files used during the agent build.
sudo apt-install protobuf-c-compiler
Go to src/csmpagent/tlvs/ and make
to verify protoc-c is operating successfully.
src/csmpagent/tlvs/CsmpTlvs.proto
and make to generate new CsmpTlvs.pb-c.c/CsmpTlvs.pb-c.h此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。