Home
last modified time | relevance | path

Searched refs:zframe (Results 1 – 4 of 4) sorted by relevance

/Zephyr-latest/include/zephyr/net/
Dsocketcan_utils.h36 struct can_frame *zframe) in socketcan_to_can_frame() argument
38 memset(zframe, 0, sizeof(*zframe)); in socketcan_to_can_frame()
40 zframe->flags |= (sframe->can_id & BIT(31)) != 0 ? CAN_FRAME_IDE : 0; in socketcan_to_can_frame()
41 zframe->flags |= (sframe->can_id & BIT(30)) != 0 ? CAN_FRAME_RTR : 0; in socketcan_to_can_frame()
42 zframe->flags |= (sframe->flags & CANFD_FDF) != 0 ? CAN_FRAME_FDF : 0; in socketcan_to_can_frame()
43 zframe->flags |= (sframe->flags & CANFD_BRS) != 0 ? CAN_FRAME_BRS : 0; in socketcan_to_can_frame()
44 zframe->id = sframe->can_id & BIT_MASK(29); in socketcan_to_can_frame()
45 zframe->dlc = can_bytes_to_dlc(sframe->len); in socketcan_to_can_frame()
47 if ((zframe->flags & CAN_FRAME_RTR) == 0U) { in socketcan_to_can_frame()
48 memcpy(zframe->data, sframe->data, in socketcan_to_can_frame()
[all …]
/Zephyr-latest/tests/net/socket/can/src/
Dmain.c22 struct can_frame zframe; in ZTEST() local
35 socketcan_to_can_frame(&sframe, &zframe); in ZTEST()
38 LOG_HEXDUMP_DBG((const uint8_t *)&zframe, sizeof(zframe), "zframe"); in ZTEST()
41 zassert_equal(zframe.flags, expected.flags, "Flags not equal"); in ZTEST()
42 zassert_equal(zframe.id, expected.id, "CAN id invalid"); in ZTEST()
43 zassert_equal(zframe.dlc, expected.dlc, "Msg length invalid"); in ZTEST()
44 zassert_mem_equal(&zframe.data, &expected.data, can_dlc_to_bytes(expected.dlc), in ZTEST()
51 socketcan_to_can_frame(&sframe, &zframe); in ZTEST()
53 zassert_equal(zframe.flags, expected.flags, "Flags not equal"); in ZTEST()
54 zassert_equal(zframe.id, expected.id, "CAN id invalid"); in ZTEST()
[all …]
/Zephyr-latest/samples/net/sockets/can/src/
Dmain.c49 struct can_frame zframe = {0}; in tx() local
53 zframe.id = 0x1; in tx()
54 zframe.dlc = 8U; in tx()
56 for (i = 0; i < zframe.dlc; i++) { in tx()
57 zframe.data[i] = 0xF0 | i; in tx()
60 socketcan_from_can_frame(&zframe, &sframe); in tx()
111 struct can_frame zframe; in rx() local
131 socketcan_to_can_frame(&sframe, &zframe); in rx()
135 (zframe.flags & CAN_FRAME_IDE) != 0 ? 1 : 0, in rx()
136 (zframe.flags & CAN_FRAME_RTR) != 0 ? 1 : 0, in rx()
[all …]
/Zephyr-latest/subsys/net/lib/sockets/
Dsockets_can.c104 struct can_frame *zframe = in zcan_received_cb() local
113 socketcan_from_can_frame(zframe, &sframe); in zcan_received_cb()
230 struct can_frame zframe; in zcan_sendto_ctx() local
262 socketcan_to_can_frame((struct socketcan_frame *)buf, &zframe); in zcan_sendto_ctx()
264 ret = net_context_sendto(ctx, (void *)&zframe, sizeof(zframe), in zcan_sendto_ctx()
280 struct can_frame zframe; in zcan_recvfrom_ctx() local
331 if (net_pkt_read(pkt, (void *)&zframe, sizeof(zframe))) { in zcan_recvfrom_ctx()
340 socketcan_from_can_frame(&zframe, (struct socketcan_frame *)buf); in zcan_recvfrom_ctx()