src/slcan.c
/**
 * Reads a packet out of the receive buffer
 * 
 * @param pkt The packet to write it in.
 * 
 * @return True if a packet was received
 */
Reads a packet out of the receive buffer

@param pkt The packet to write it in.

@return True if a packet was received
Reads a packet out of the receive buffer @param pkt The packet to write it in . @return True if a packet was received
bool slcan_frame_rx(SLCANFrame *frame)
{
    uint16_t length;
    uint8_t buf[64];
    SLPacket pkt;
    bool ret = false;
    if (frame != NULL) {
        length = circbuf_getPacket(&slcan_rxbuf, buf, sizeof(buf));
        if (length > 0) {
            ret = decodeSLCANFrame(buf, length, frame);
            if (ret == false) {
                decodeSLPacket(buf, length, &pkt);
                slcan_send_reply(&pkt);
            }
        }
    }
    return ret;
}
bool slcan_frame_rx ( SLCANFrame * frame ) { uint16_t length ; uint8_t buf [ 64 ] ; SLPacket pkt ; bool ret = false ; if ( frame != NULL ) { length = circbuf_getPacket ( & slcan_rxbuf , buf , sizeof ( buf ) ) ; if ( length > 0 ) { ret = decodeSLCANFrame ( buf , length , frame ) ; if ( ret == false ) { decodeSLPacket ( buf , length , & pkt ) ; slcan_send_reply ( & pkt ) ; } } } return ret ; }
Reads a packet out of the receive buffer
Reads a packet out of the receive buffer