le_hex.h File Reference

Go to the source code of this file.

Functions

int32_t le_hex_StringToBinary (const char *stringPtr, uint32_t stringLength, uint8_t *binaryPtr, uint32_t binarySize)
 
int32_t le_hex_BinaryToString (const uint8_t *binaryPtr, uint32_t binarySize, char *stringPtr, uint32_t stringSize)
 
int le_hex_HexaToInteger (char s[])
 

Detailed Description

Legato Hex string API include file.

Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.

Function Documentation

int32_t le_hex_BinaryToString ( const uint8_t *  binaryPtr,
uint32_t  binarySize,
char *  stringPtr,
uint32_t  stringSize 
)

Converts binary to hex string format.

Returns
size of hex string, if < 0 it has failed
Parameters
[in]binaryPtrbinary array to convert
[in]binarySizesize of binary array
[out]stringPtrhex string array, terminated with '\0'.
[in]stringSizesize of string array
int le_hex_HexaToInteger ( char  s[])

This function convert hexa string into integer

Returns
return the value or -1 if not possible.
int32_t le_hex_StringToBinary ( const char *  stringPtr,
uint32_t  stringLength,
uint8_t *  binaryPtr,
uint32_t  binarySize 
)

Converts hex string to binary format.

Returns
size of binary, if < 0 it has failed
Parameters
[in]stringPtrstring to convert, terminated with '\0'.
[in]stringLengthstring length
[out]binaryPtrbinary result
[in]binarySizesize of the binary table