ISUPBCDtoASCII

Converts a binary-coded decimal string to a string of ASCII digits.

Prototype

U8 TXISUPAPIFUNC ISUPBCDtoASCII ( U8 *bcd, U8 bcdLen, U8 *ascii, U8 asciiLen)

Argument

Description

bcd

Pointer to binary-coded decimal string.

bcdLen

Number of BCD digits in source string.

ascii

Pointer to destination string.

asciiLen

Number of bytes in destination string. Must be at least bcdLen plus one byte for NULL termination.


Return values

ISUPBCDtoASCII returns the number of successfully converted digits if successful. If unsuccessful, this function returns a zero.

Example

void prtTknAddr(TknStr *tk1, char* name)
{
    U8   addr[64];
    U8   addrLen;
 
     if(tk1->pres == PRESENT)
     {
        addrLen = tk1->len << 1;
        ISUPBCDtoASCII( tk1->val, addrLen, addr, sizeof( addr ) );