From 4bffda048bd7cd811814820cdb249661254b7ce7 Mon Sep 17 00:00:00 2001 From: xieming <2067057918@qq.com> Date: Fri, 10 Nov 2017 09:19:08 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=E5=8F=91=E9=80=817*n?= =?UTF-8?q?=EF=BC=88n>=3D2=EF=BC=8C3=EF=BC=8C4=EF=BC=8C5..=EF=BC=89?= =?UTF-8?q?=E5=AD=97=E8=8A=82=E6=95=B0=E6=8D=AE=EF=BC=8C=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?J1939=5FTP=5FTX=5FMessage=E4=BC=9A=E5=8F=91=E9=80=81n+1?= =?UTF-8?q?=E5=8C=85=E7=9A=84=E9=95=BF=E6=8A=A5=E6=96=87=EF=BC=88TP,?= =?UTF-8?q?=E5=A4=9A=E5=B8=A7=EF=BC=89=20=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/J1939.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/J1939.c b/source/J1939.c index 2aea642..2360501 100644 --- a/source/J1939.c +++ b/source/J1939.c @@ -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;