Converts a binary-coded decimal string to a string of ASCII digits.
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. |
ISUPBCDtoASCII returns the number of successfully converted digits if successful. If unsuccessful, this function returns a zero.
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 ) );