Skip to content

Commit

Permalink
[修复]发送7*n(n>=2,3,4,5..)字节数据,接口J1939_TP_TX_Message会发送n+1包的长报文(TP,多帧) 错误
Browse files Browse the repository at this point in the history
  • Loading branch information
XeiTongXueFlyMe committed Nov 10, 2017
1 parent 2d3830c commit 4bffda0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/J1939.c
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,11 @@ j1939_int8_t J1939_TP_TX_Message(j1939_uint32_t PGN,j1939_uint8_t SA,j1939_int8_
}
TP_TX_MSG.packet_offset_p = 0;
TP_TX_MSG.packets_request_num = 0;
TP_TX_MSG.packets_total = data_num/7 +1;
TP_TX_MSG.packets_total = data_num/7;
if((data_num%7) != 0)
{
TP_TX_MSG.packets_total ++;
}
TP_TX_MSG.time = J1939_TP_T3;
//触发开始CM_START
TP_TX_MSG.state = J1939_TP_TX_CM_START;
Expand Down

0 comments on commit 4bffda0

Please sign in to comment.