src/slcan.c
/**
 * Sends a packet
 * 
 * @param id     The CAN ID to send
 * @param length The length of the data
 * @param data   The data to send out
 * @param ext    True if this is an extended packet
 * 
 * @return True if a packet was sent
 */
Sends a packet

@param id     The CAN ID to send
@param length The length of the data
@param data   The data to send out
@param ext    True if this is an extended packet

@return True if a packet was sent
Sends a packet @param id The CAN ID to send @param length The length of the data @param data The data to send out @param ext True if this is an extended packet @return True if a packet was sent
bool slcan_send_frame(uint32_t id, uint8_t length, uint8_t *data, bool ext)
{
    SLPacket pkt;
    pkt.type = Frame;
    pkt.frame.id = id;
    pkt.frame.length = length;
    pkt.frame.rtr = false;
    pkt.frame.ext = ext;
    if (data != NULL) {
        memcpy (pkt.frame.data, data, length);
    }
    return slcan_send(&pkt);
}
bool slcan_send_frame ( uint32_t id , uint8_t length , uint8_t * data , bool ext ) { SLPacket pkt ; pkt . type = Frame ; pkt . frame . id = id ; pkt . frame . length = length ; pkt . frame . rtr = false ; pkt . frame . ext = ext ; if ( data != NULL ) { memcpy ( pkt . frame . data , data , length ) ; } return slcan_send ( & pkt ) ; }
Sends a packet
Sends a packet