Converts the null-terminated ASCII string of decimal digits pointed to by pAscii to binary coded decimal format.
SCCP_STATUS SccpAsciiNumToBcd ( 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 number. |
nBcdBufLen |
Number of bytes in the BCD buffer. |
pnDigits |
Pointer to an address where number of digits converted is returned. |
Return value |
Description |
SCCP_SUCCESS |
|
SCCP_BADDIGIT |
ASCII string contains characters other than digits. |
SCCP_BUFLEN |
BCD buffer is not large enough to hold the converted number. |
SCCP_NULLPTR |
Null pointer was passed as an input parameter. |
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.