bin2hexM

As for bin2hex, converts binary data into an ASCII HEX and then inserts a '\n' after every 'lineLen' characters for display formatting. 

Synopsis

int bin2hexM(
char * hex,
const void * bin,
unsigned maxLen,
unsigned int lineLen);
Parameter Description
bin Input A buffer of binary data
hex Output A buffer to receive the string of ASCII HEX characters
maxLen Input The number of characters that 'bin' contains that should be converted (this is not the length of the output buffer 'hex')
lineLen Number of characters before a new line (\n) is added