Example: lrs_decimal_to_hex_string

In the following example, the lrs_decimal_to_hex_string function converts an integer into a hexadecimal string. The script displays the value of the HEX string if it is not NULL.

lrs_send("socket0", "buf3", LrsLastArg);
lrs_receive("socket0", "buf4", LrsLastArg);
tmp = lrs_get_received_buffer("socket0", 29, 1, NULL);
    /* translate 4 to \x04 */
tmp2 = lrs_decimal_to_hex_string("socket0",tmp,1);
if (NULL != tmp2 && lrs_get_user_buffer_size("socket0") == 4 )
{
    lr_output_message("tmp2=%s",tmp2);
}
lrs_send("socket0", "buf5", LrsLastArg);
lrs_receive("socket0", "buf6", LrsLastArg);