/* Write one frame into wireshark (via the pipe).  */
static void write_frame(uint8_t frame_len)
/* Write one frame into wireshark (via the pipe).  */
static void write_frame(uint8_t frame_len)
{
    uint8_t i;
    frame_len -= PACKET_FCS;
    write_frame_hdr(frame_len);
    rd_idx = (rd_idx + 1) % BUFSIZE;
    for (i=0; i<frame_len; i++)
    {
        data_write(&circ_buf[rd_idx], 1);
        rd_idx = (rd_idx + 1) % BUFSIZE;
    }
    rd_idx = (rd_idx + 1) % BUFSIZE;
}