src/slcan.c
/**
 * Sends a packet
 * 
 * @param pkt The packet to write it in.
 * 
 * @return True if a packet was sent
 */
Sends a packet

@param pkt The packet to write it in.

@return True if a packet was sent
Sends a packet @param pkt The packet to write it in . @return True if a packet was sent
bool slcan_send(SLPacket *pkt)
{
    uint16_t length;
    uint16_t index;
    uint8_t buf[64];
    if (pkt != NULL) {
        length = encodeSLPacket(buf, sizeof(buf), pkt);
        index = 0;
        while (length > index) {
            circbuf_push(&slcan_txbuf, buf[index]);
            index++;
        }
        return length > 0;
    }
    return false;
}
bool slcan_send ( SLPacket * pkt ) { uint16_t length ; uint16_t index ; uint8_t buf [ 64 ] ; if ( pkt != NULL ) { length = encodeSLPacket ( buf , sizeof ( buf ) , pkt ) ; index = 0 ; while ( length > index ) { circbuf_push ( & slcan_txbuf , buf [ index ] ) ; index ++ ; } return length > 0 ; } return false ; }
Sends a packet
Sends a packet