static int upipe_tx(struct device *dev, struct net_pkt *pkt, struct net_buf *frag) { struct upipe_context *upipe = dev->driver_data; u8_t *pkt_buf = frag->data; u8_t len = frag->len; u8_t i, data; LOG_DBG("%p (%u)", frag, len); if (upipe->stopped) { return -EIO; } data = UART_PIPE_RADIO_15_4_FRAME_TYPE; uart_pipe_send(&data, 1); data = len; uart_pipe_send(&data, 1); for (i = 0U; i < len; i++) { uart_pipe_send(pkt_buf+i, 1); } return 0; }
void tester_send(uint8_t service, uint8_t opcode, uint8_t index, uint8_t *data, size_t len) { struct btp_hdr msg; msg.service = service; msg.opcode = opcode; msg.index = index; msg.len = len; uart_pipe_send((uint8_t *)&msg, sizeof(msg)); if (data && len) { uart_pipe_send(data, len); } }
static inline void slip_writeb(unsigned char c) { u8_t buf[1] = { c }; uart_pipe_send(&buf[0], 1); }