SccpAsciiMaskToBcd

Converts the null-terminated ASCII address mask pointed to by pAscii to binary coded hexadecimal format.

Prototype

SCCP_STATUS SccpAsciiMaskToBcd ( char *pAscii, U8 *pBcdBuf, U32 nBcdBufLen, U32 *pnDigits)

Argument

Description

pAscii

Pointer to an address of a null-terminated ASCII string of digits.

pBcdBuf

Pointer to an address of a buffer for the converted BCD mask.

nBcdBufLen

Number of bytes in the BCD buffer.

pnDigits

Pointer to an address where number of digits converted is returned.


Return values

Return value

Description

SCCP_SUCCESS

 

SCCP_BADDIGIT

ASCII string contains characters other than 0 and f.

SCCP_BUFLEN

BCD buffer is not large enough to hold the converted mask.

SCCP_NULLPTR

Null pointer was passed as an input parameter.


Details

The results are placed in the buffer pointed to by pBcdBuf. If the length of the ASCII string is less than half the length of the BCD buffer, the BCD buffer is padded with BCD zeros. The number of digits converted is returned at the address pnDigits.