Searched refs:zframe (Results 1 – 4 of 4) sorted by relevance
/Zephyr-Core-3.5.0/include/zephyr/net/ |
D | socketcan_utils.h | 37 struct can_frame *zframe) in socketcan_to_can_frame() argument 39 memset(zframe, 0, sizeof(*zframe)); in socketcan_to_can_frame() 41 zframe->flags |= (sframe->can_id & BIT(31)) != 0 ? CAN_FRAME_IDE : 0; in socketcan_to_can_frame() 42 zframe->flags |= (sframe->can_id & BIT(30)) != 0 ? CAN_FRAME_RTR : 0; in socketcan_to_can_frame() 43 zframe->flags |= (sframe->flags & CANFD_FDF) != 0 ? CAN_FRAME_FDF : 0; in socketcan_to_can_frame() 44 zframe->flags |= (sframe->flags & CANFD_BRS) != 0 ? CAN_FRAME_BRS : 0; in socketcan_to_can_frame() 45 zframe->id = sframe->can_id & BIT_MASK(29); in socketcan_to_can_frame() 46 zframe->dlc = can_bytes_to_dlc(sframe->len); in socketcan_to_can_frame() 48 if ((zframe->flags & CAN_FRAME_RTR) == 0U) { in socketcan_to_can_frame() 49 memcpy(zframe->data, sframe->data, in socketcan_to_can_frame() [all …]
|
/Zephyr-Core-3.5.0/tests/net/socket/can/src/ |
D | main.c | 22 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-Core-3.5.0/samples/net/sockets/can/src/ |
D | main.c | 45 struct can_frame zframe = {0}; in tx() local 49 zframe.id = 0x1; in tx() 50 zframe.dlc = 8U; in tx() 52 for (i = 0; i < zframe.dlc; i++) { in tx() 53 zframe.data[i] = 0xF0 | i; in tx() 56 socketcan_from_can_frame(&zframe, &sframe); in tx() 105 struct can_frame zframe; in rx() local 125 socketcan_to_can_frame(&sframe, &zframe); in rx() 129 (zframe.flags & CAN_FRAME_IDE) != 0 ? 1 : 0, in rx() 130 (zframe.flags & CAN_FRAME_RTR) != 0 ? 1 : 0, in rx() [all …]
|
/Zephyr-Core-3.5.0/subsys/net/lib/sockets/ |
D | sockets_can.c | 108 struct can_frame *zframe = in zcan_received_cb() local 117 socketcan_from_can_frame(zframe, &sframe); in zcan_received_cb() 234 struct can_frame zframe; in zcan_sendto_ctx() local 266 socketcan_to_can_frame((struct socketcan_frame *)buf, &zframe); in zcan_sendto_ctx() 268 ret = net_context_sendto(ctx, (void *)&zframe, sizeof(zframe), in zcan_sendto_ctx() 284 struct can_frame zframe; in zcan_recvfrom_ctx() local 335 if (net_pkt_read(pkt, (void *)&zframe, sizeof(zframe))) { in zcan_recvfrom_ctx() 344 socketcan_from_can_frame(&zframe, (struct socketcan_frame *)buf); in zcan_recvfrom_ctx()
|