SccpBcdNumToAscii

Converts the binary coded decimal number pointed to by pBcd to an ASCII string of digits.

Prototype

SCCP_STATUS SccpBcdNumToAscii ( U8 *pBcd, U32 nDigits, char *pAsciiBuf, U32 nAsciiBufLen)

Argument

Description

pBcd

Pointer to an address of a binary coded decimal number.

nDigits

Number of digits contained in the number.

pAsciiBuf

Pointer to an address of a buffer for the converted number.

nAsciiBufLen

Size of the output buffer in bytes.


Return values

Return value

Description

SCCP_SUCCESS

 

SCCP_BADDIGIT

BCD number contains values other than zero through nine.

SCCP_BUFLEN

ASCII buffer is not large enough to hold the converted number.

SCCP_NULLPTR

Null pointer was passed as an input parameter.


Details

The results are placed in the buffer pointed to by pAsciiBuf. If the number of digits is less than the size of the ASCII buffer, the buffer is padded with null characters.

Note: The ASCII string does not end in a null-termination character when the buffer size is exactly the same as the number of digits.