eric2013 发表于 2024-1-2 01:28:45

J1939协议栈代码初步捋顺了,准备整理一期专题视频教程分享下




J1939比CANopen好理解,就是函数太多,也就是通信命令太多。

这几天整理下,准备录制一期视频,H7-TOOL的J1939通用版解析功能也做的差不多了




amlike 发表于 2024-1-2 08:51:39

有J1850的吗

eric2013 发表于 2024-1-2 09:08:09

amlike 发表于 2024-1-2 08:51
有J1850的吗

J1850的玩家不多,等玩家多了,也搞个,这种协议本身都比较简单。

missfox 发表于 2024-1-2 12:06:39

cool,想什么来什么{:8:}

eric2013 发表于 2024-1-3 08:18:13

批量数据处理解析也可以了


xukaiming 发表于 2024-1-3 09:21:02

1939里最复杂的就是j1939.TP,只要把这个弄明白了.其他的都挺简单的

tengye 发表于 2024-1-3 09:50:55

以后汽车车身网络对速度安全成本的要求越来越高。CAN总线已经越发吃力。新型的车载以太网技术是未来高速网络部分的应用趋势。博通公司研发的BroadR-Reach技术,采用单对的非屏蔽双绞线进行信号传输,电缆重量减轻,连接成本降低。

yunqi 发表于 2024-1-3 09:54:49

missfox 发表于 2024-1-2 12:06
cool,想什么来什么

您许愿内容是不是:心想事成:lol

amfy 发表于 2024-1-3 15:17:07

很好奇之前我提到的那个问题, 是我的理解不对还是协议栈真的有问题呀, 硬汉你怎么看?
https://github.com/DanielMartensson/Open-SAE-J1939/issues/25

eric2013 发表于 2024-1-4 08:52:28

amfy 发表于 2024-1-3 15:17
很好奇之前我提到的那个问题, 是我的理解不对还是协议栈真的有问题呀, 硬汉你怎么看?
https://github.com/ ...

这个函数从测试效果来看,好像没什么问题

/*
* Store information about sequence data packages from other ECU who are going to send to this ECU
* PGN: 0x00EC00 (60416)
*/
void SAE_J1939_Read_Transport_Protocol_Connection_Management(J1939 *j1939, uint8_t SA, uint8_t data[]) {
        j1939->from_other_ecu_tp_cm.control_byte = data;
        j1939->from_other_ecu_tp_cm.total_message_size = (data << 8) | data;
        j1939->from_other_ecu_tp_cm.number_of_packages = data;
        j1939->from_other_ecu_tp_cm.PGN_of_the_packeted_message = (data << 16) | (data << 8) | data;
        j1939->from_other_ecu_tp_cm.from_ecu_address = SA;

        /* Check if we got the Request To Send control byte - We need to answer with CTS - Clear To Send */
        if(j1939->from_other_ecu_tp_cm.control_byte == CONTROL_BYTE_TP_CM_RTS){
                j1939->this_ecu_tp_cm = j1939->from_other_ecu_tp_cm;                         /* Copy - We need to have the same data */
                j1939->this_ecu_tp_cm.control_byte = CONTROL_BYTE_TP_CM_CTS;        /* We only need to change the control byte from RTS to CTS */
                SAE_J1939_Send_Transport_Protocol_Connection_Management(j1939, SA);
        }

        /* When we answer with CTS, it means we are going to send the Transport Protocol Data Transfer package */
        if(j1939->from_other_ecu_tp_cm.control_byte == CONTROL_BYTE_TP_CM_CTS){
                SAE_J1939_Send_Transport_Protocol_Data_Transfer(j1939, SA);
        }
}

amfy 发表于 2024-1-4 08:58:29

eric2013 发表于 2024-1-4 08:52
这个函数从测试效果来看,好像没什么问题

/*


好吧,可能是我对那个说明文档的理解有问题,

陈66 发表于 2024-1-4 17:29:49

太爱了,最近的毕设任务刚好就需要学习到J1939

eric2013 发表于 2024-1-5 00:39:14

整理视频提纲,准备录制视频了。
页: [1]
查看完整版本: J1939协议栈代码初步捋顺了,准备整理一期专题视频教程分享下