|
|
@@ -140,6 +140,12 @@ static uint8_t send_frame1(cbus_id_type id_type, uint32_t id, cbus_fr_format fr_
|
|
|
canbus_frame_t frame = { .id = id, .dlc = dlc, .id_type = id_type, .fr_format = fr_fmt };
|
|
|
memmove(frame.dt, dt, dlc);
|
|
|
//使用这个接口把收到的can数据放入解析库中.
|
|
|
+ printf("send can data size:%d,", dlc);
|
|
|
+ for (int i=0; i<dlc; i++)
|
|
|
+ {
|
|
|
+ printf("%x", frame.dt[i]);
|
|
|
+ }
|
|
|
+ printf("\r\n");
|
|
|
iso15765_enqueue(&handler2, &frame);
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -187,6 +193,12 @@ static void indn1(n_indn_t *info)
|
|
|
frame1.msg_sz = f_sz1;
|
|
|
rand_string(frame1.msg, frame1.msg_sz);
|
|
|
f_sz1 = f_sz1 == 512 ? 0 : f_sz1 + 1;
|
|
|
+ printf("handler1 send msg_size:%d,data:", frame1.msg_sz);
|
|
|
+ for(int i=0; i<frame1.msg_sz; i++)
|
|
|
+ {
|
|
|
+ printf("%x", frame1.msg[i]);
|
|
|
+ }
|
|
|
+ printf("\r\n");
|
|
|
iso15765_send(&handler1, &frame1);
|
|
|
}
|
|
|
static void indn2(n_indn_t *info)
|
|
|
@@ -204,7 +216,7 @@ static void indn2(n_indn_t *info)
|
|
|
printf("- Reception of H2. Msg_sz:[%d] | SZ_CH[%c] MSG_CH[%c]\n", info->msg_sz, s, v);
|
|
|
for (int i = 0; i < info->msg_sz; i++)
|
|
|
{
|
|
|
- printf("0x%x", info->msg[i]);
|
|
|
+ printf("%x", info->msg[i]);
|
|
|
}
|
|
|
printf("\r\n");
|
|
|
if ((v != 'V') || (s != 'V'))
|
|
|
@@ -216,6 +228,12 @@ static void indn2(n_indn_t *info)
|
|
|
frame2.msg_sz = f_sz2;
|
|
|
rand_string(frame2.msg, frame2.msg_sz);
|
|
|
f_sz2 = f_sz2 == 512 ? 0 : f_sz2 + 1;
|
|
|
+ printf("handler2 send msg_size:%d,", frame2.msg_sz);
|
|
|
+ for(int i=0; i<frame2.msg_sz; i++)
|
|
|
+ {
|
|
|
+ printf("%x", frame2.msg[i]);
|
|
|
+ }
|
|
|
+ printf("\r\n");
|
|
|
iso15765_send(&handler2, &frame2);
|
|
|
}
|
|
|
|
|
|
@@ -233,6 +251,13 @@ int main()
|
|
|
rand_string(frame1.msg, frame1.msg_sz);
|
|
|
f_sz1++;
|
|
|
iso15765_send(&handler1, &frame1);
|
|
|
+
|
|
|
+ printf("handler1 send msg_size:%d,", frame1.msg_sz);
|
|
|
+ for(int i=0; i<frame1.msg_sz; i++)
|
|
|
+ {
|
|
|
+ printf("%x", frame1.msg[i]);
|
|
|
+ }
|
|
|
+ printf("\r\n");
|
|
|
while (1)
|
|
|
{
|
|
|
cnt += 1;
|
|
|
@@ -251,5 +276,6 @@ int main()
|
|
|
// 1.ST应用收到数据时,调用iso15765_send往解析库发送,解析库底层调用send_frame1发给can接口.
|
|
|
// 2.can驱动接收到数据后,调用iso15765_enqueue(&handler2, &frame)发送给解析库,解析完成后向应用触发indn1事件.
|
|
|
|
|
|
-
|
|
|
+// 1.开发板调用iso15765_send,解析库底层是send_frame1为can发送接口.
|
|
|
+//
|
|
|
|