当前位置:网站首页>全网唯一OpenCyphal/UAVCAN教程(11)用candump和gawk工具写一个Cyphal协议解析小工具
全网唯一OpenCyphal/UAVCAN教程(11)用candump和gawk工具写一个Cyphal协议解析小工具
2022-08-08 04:17:00 【奇妙之二进制】
经常需要调试Cyphal协议,yakut的安装比较麻烦,所以就用candump和gawk实现了一个协议解析工具。
这个candump导出的数据,很明显这是一条心跳广播,7D55是心跳广播的id,而且还是条单帧消息。
can1 107D552A [8] 00 00 00 00 00 01 A1 E0
can1 107D552A [8] 01 00 00 00 00 01 A1 E1
can1 107D552A [8] 02 00 00 00 00 01 A1 E2
can1 107D552A [8] 03 00 00 00 00 01 A1 E3
解析的依据参考这个图片:
贴上我们的awk脚本:
#!/usr/bin/gawk
BEGIN {
id_name[7509] = "heart_beat";
# add your id and name map here
can_id_index = 2;
getline
#line example: (001.000) can0 11111 [8] 55555
if($1 ~/^\(/)
can_id_index = 3;
while (getline) {
# have timestamp
if(can_id_index == 3) {
timestamp = strtonum(substr($1, 2));
}
#line example: can0 1122233 [8] 5555555
can_id = strtonum("0x"$can_id_index);
source_id = and(can_id, 0x0000007F);
# 0 message
边栏推荐
- The sword refers to Offer 18. Delete the node of the linked list
- Some excellent blog recommendations for Qt event learning reference
- leetcode 112.路经总和 递归
- The fledgling Xiao Li's 115th blog project notes on the creation of the domestic GD32F103RCT6 basic project
- leetcode: 874. 模拟行走机器人
- 剑指 Offer 17. 打印从1到最大的n位数
- 【多任务CTR】阿里ESMM:Entire Space Multi-Task Model: An Effective Approach for Estimating Post-Click Conve
- L3-007 ladder map (test point 2 is stuck, you can see it)
- The use of mmedicting get_flops. Py
- Redis persistence mechanism, master-slave, sentry, cluster parsing cluster solution
猜你喜欢

Research on Blind Recognition of Digital Modulated Signal Based on MindSpore Framework
![MySQL from entry to entry [20W word collection]](/img/da/1a40e831aa541001773bb76fd369f4.png)
MySQL from entry to entry [20W word collection]

leetcode: 122. 买卖股票的最佳时机 II

让你的文字被更多人看到:来投稿吧,稿酬靠谱!

失业在家的6个月,我通过外包全款买了房:你看不起的行业,往往很赚钱

新零售项目及离线数仓核心面试,,220807,,

中国科学院金属研究所科研课题获华为技术认证,助力材料学发展新范式!

07查询表达式 及 page分页、order 排序《ThinkPHP6 入门到电商实战》

XDR技术

Machine Learning Notes: Learning Rate Warmup
随机推荐
New User Plane Design and Key Technologies in the 6G Era
【Review of Live Streaming】Synthesis MindSpore Usability SIG2022 First Half Review Summary
Vulfocus Shooting Range Scenario Mode - Intranet Dead End
topk()/eq( ) / gt( ) / lt( ) / t( )的用法
C language minesweeping
How does JS use hexadecimal to save 100-bit state
XDR技术
NorFlash的存储原理
Mini Program Optimization Practice
Some excellent blog recommendations for Qt event learning reference
leetcode 112. Path sum recursion
Exercise equipment responsive pbootcms template class web site
07查询表达式 及 page分页、order 排序《ThinkPHP6 入门到电商实战》
Knowledge of DisplayPort-DP interface
【多任务模型】《Multi-Faceted Hierarchical Multi-Task Learning for a Large Number of Tasks with Multi-dimens
L3-007 天梯地图(测试点2卡住了可以看下)
L3-005 垃圾箱分布
2022-08-07 mysql/stonedb慢SQL-子查询-半连接
剑指Offer 18.删除链表的节点
Cube - studio deployment process