XBinder
Version 2.6.x
|
Telephony Binary Coded Decimal (TBCD) helper functions provide assistance in converting TBCD strings to and from binary form as document in standard ITU-T Q.825. More...
Functions | |
EXTERNRT int | rtxQ825TBCDToString (OSSIZE numocts, const OSOCTET *data, char *buffer, OSSIZE bufsiz) |
This function converts a Q.825 TBCD value to a standard null-terminated string. More... | |
EXTERNRT int | rtxDecQ825TBCDString (OSCTXT *pctxt, OSSIZE numocts, char *buffer, OSSIZE bufsiz) |
This function decodes a Q.825 TBCD value to a standard null-terminated string. More... | |
EXTERNRT int | rtxEncQ825TBCDString (OSCTXT *pctxt, const char *str) |
This function encodes a null-terminated string Q.825 TBCD string. More... | |
EXTERNRT int | rtxTBCDBinToChar (OSUINT8 bcdDigit, char *pdigit) |
This function converts a TBCD binary character into its ASCII equivalent. More... | |
EXTERNRT int | rtxTBCDCharToBin (char digit, OSUINT8 *pbyte) |
This function converts a TBCD character ('0'-'9',"*#abc") into its binary equivalent. More... | |
Telephony Binary Coded Decimal (TBCD) helper functions provide assistance in converting TBCD strings to and from binary form as document in standard ITU-T Q.825.
EXTERNRT int rtxDecQ825TBCDString | ( | OSCTXT * | pctxt, |
OSSIZE | numocts, | ||
char * | buffer, | ||
OSSIZE | bufsiz | ||
) |
This function decodes a Q.825 TBCD value to a standard null-terminated string.
TBCD digits are read from the decode buffer/stream and converted to their character equivalents. See 'rtQ825TBCDToString' for a description of the Q.825 TBCD format.
pctxt | Pointer to a context structure block. |
numocts | The number of octets in the BCD value to be read from input stream. |
buffer | The destination buffer. Should not be less than bufsiz argument is. |
bufsiz | The size of the destination buffer (in octets). The buffer size should be at least ((numocts * 2) + 1) to hold the BCD to String conversion. |
EXTERNRT int rtxEncQ825TBCDString | ( | OSCTXT * | pctxt, |
const char * | str | ||
) |
This function encodes a null-terminated string Q.825 TBCD string.
TBCD digits are converted and written to the encode buffer/stream. See 'rtQ825TBCDToString' for a description of the Q.825 TBCD format.
pctxt | Pointer to a context structure block. |
str | Null-terminate string to be encoded. This string may only contain valid Q.825 TBCD characters. |
EXTERNRT int rtxQ825TBCDToString | ( | OSSIZE | numocts, |
const OSOCTET * | data, | ||
char * | buffer, | ||
OSSIZE | bufsiz | ||
) |
This function converts a Q.825 TBCD value to a standard null-terminated string.
Octet values can contain the filler digit to represent the odd number of BCD digits.
The encoding is as follows per Q.825:
This type (Telephony Binary Coded Decimal String) is used to represent digits from 0 through 9, *, #, a, b, c, two digits per octet, each digit encoded 0000 to 1001 (0 to 9), 1010 (*) 1011(#), 1100 (a), 1101 (b) or 1110 (c); 1111 (end of pulsing signal-ST); 0000 is used as a filler when there is an odd number of digits.
numocts | The number of octets in the BCD value. |
data | The pointer to the BCD value. |
buffer | The destination buffer. Should not be less than bufsiz argument is. |
bufsiz | The size of the destination buffer (in octets). The buffer size should be at least ((numocts * 2) + 1) to hold the BCD to String conversion. |
EXTERNRT int rtxTBCDBinToChar | ( | OSUINT8 | bcdDigit, |
char * | pdigit | ||
) |
This function converts a TBCD binary character into its ASCII equivalent.
tbcdDigit | TBCD digit |
pdigit | Pointer to character to receive converted character |
EXTERNRT int rtxTBCDCharToBin | ( | char | digit, |
OSUINT8 * | pbyte | ||
) |
This function converts a TBCD character ('0'-'9',"*#abc") into its binary equivalent.
digit | TBCD digit character ('0'-'9',"*#abc") |
pbyte | Pointer to byte to receive binary result. |