Functions

Sysex utility functions

Functions

uint16_t sysex_encoded_length (uint16_t decoded_length)
 Compute the length of a message after it is encoded.
uint16_t sysex_decoded_length (uint16_t encoded_length)
 Compute the length of a message after it is decoded.
uint16_t sysex_encode (uint8_t *encoded, const uint8_t *source, uint16_t length)
 Encode data so that it can be transmitted safely in a sysex message.
uint16_t sysex_decode (uint8_t *decoded, const uint8_t *source, uint16_t length)
 Decode encoded data.

Function Documentation

uint16_t sysex_decode ( uint8_t *  decoded,
const uint8_t *  source,
uint16_t  length 
)

Decode encoded data.

Parameters:
decoded The output data buffer, must be at least sysex_decoded_length(length) bytes long.
source The input buffer of data to be decoded.
length The number of bytes from the input buffer to decode.
Returns:
number of bytes decoded.
uint16_t sysex_decoded_length ( uint16_t  encoded_length  ) 

Compute the length of a message after it is decoded.

Parameters:
encoded_length The length, in bytes, of the encoded message.
Returns:
The length, in bytes, of the message after it is decoded.
uint16_t sysex_encode ( uint8_t *  encoded,
const uint8_t *  source,
uint16_t  length 
)

Encode data so that it can be transmitted safely in a sysex message.

Parameters:
encoded The output data buffer, must be at least sysex_encoded_length(length) bytes long.
source The input buffer of data to be encoded.
length The number of bytes from the input buffer to encode.
Returns:
number of bytes encoded.
uint16_t sysex_encoded_length ( uint16_t  decoded_length  ) 

Compute the length of a message after it is encoded.

Parameters:
decoded_length The length, in bytes, of the message to encode.
Returns:
The length, in bytes, of the message after encodeing.