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_packet_rx(SLPacket *pkt)
{
    uint16_t length;
    uint8_t buf[64];
    bool ret = false;
    if (pkt != NULL) {
        length = circbuf_getPacket(&slcan_rxbuf, buf, sizeof(buf));
        if (length > 0) {
            ret = decodeSLPacket(buf, length, pkt);
            slcan_send_reply(pkt); 
        }
    }
    return ret;
}
bool slcan_packet_rx ( SLPacket * pkt ) { uint16_t length ; uint8_t buf [ 64 ] ; bool ret = false ; if ( pkt != NULL ) { length = circbuf_getPacket ( & slcan_rxbuf , buf , sizeof ( buf ) ) ; if ( length > 0 ) { ret = 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
// Send a reply