Bit decode functions.
More...
Go to the source code of this file.
|
EXTERNRT int | rtxDecBit (OSCTXT *pctxt, OSBOOL *pvalue) |
| This function will decode a single bit and return the result in an OSBOOL value. More...
|
|
EXTERNRT int | rtxDecBits (OSCTXT *pctxt, OSUINT32 *pvalue, OSSIZE nbits) |
| This function decodes up to sizeof(unsigned) bits and returns the result in an unsigned integer value. More...
|
|
EXTERNRT int | rtxDecBitsToSize (OSCTXT *pctxt, OSSIZE *pvalue, OSSIZE nbits) |
| This function decodes up to sizeof(size_t) bits and returns the result in a size-typed value. More...
|
|
EXTERNRT int | rtxDecBitsToByte (OSCTXT *pctxt, OSUINT8 *pvalue, OSUINT8 nbits) |
| This function decodes bits and returns the result in a byte (octet) value. More...
|
|
EXTERNRT int | rtxDecBitsToUInt16 (OSCTXT *pctxt, OSUINT16 *pvalue, OSUINT8 nbits) |
| This function decodes bits and returns the result in an unsigned 16-bit (short) value. More...
|
|
EXTERNRT int | rtxDecBitsToByteArray (OSCTXT *pctxt, OSOCTET *pbuffer, OSSIZE bufsiz, OSSIZE nbits) |
| This function decodes bits and returns the result in an octet array. More...
|
|
EXTERNRT int | rtxPeekBit (OSCTXT *pctxt, OSBOOL *pvalue) |
| This function decodes the bit at the current position and the resets the bit cursor back to the original position. More...
|
|
EXTERNRT int | rtxSkipBits (OSCTXT *pctxt, OSSIZE nbits) |
| This function skips the given number of bits. More...
|
|
Bit decode functions.
Definition in file rtxBitDecode.h.
◆ rtxDecBit()
EXTERNRT int rtxDecBit |
( |
OSCTXT * |
pctxt, |
|
|
OSBOOL * |
pvalue |
|
) |
| |
This function will decode a single bit and return the result in an OSBOOL value.
- Parameters
-
pctxt | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
pvalue | A pointer to the BOOLEAN value to receive the decoded result. A null pointer value may be passed to skip the bit. |
- Returns
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
◆ rtxDecBits()
EXTERNRT int rtxDecBits |
( |
OSCTXT * |
pctxt, |
|
|
OSUINT32 * |
pvalue, |
|
|
OSSIZE |
nbits |
|
) |
| |
This function decodes up to sizeof(unsigned) bits and returns the result in an unsigned integer value.
- Parameters
-
pctxt | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
pvalue | Pointer to value to be receive decoded result. |
nbits | Number of bits to read from decode buffer. |
- Returns
- Status of the operation. Zero if successful; a negative status code if failed.
◆ rtxDecBitsToByte()
EXTERNRT int rtxDecBitsToByte |
( |
OSCTXT * |
pctxt, |
|
|
OSUINT8 * |
pvalue, |
|
|
OSUINT8 |
nbits |
|
) |
| |
This function decodes bits and returns the result in a byte (octet) value.
Bits are shifted to the right in the decode byte to remove unused bits. For example, if a single bit is decoded from octet 0x80, the decoded byte value will be 1.
- Parameters
-
pctxt | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
pvalue | Pointer to byte value to receive decoded data. |
nbits | Number of bits to read from decode buffer. The maximum that can be read is eight. |
- Returns
- Status of the operation. Zero if successful; a negative status code if failed.
◆ rtxDecBitsToByteArray()
EXTERNRT int rtxDecBitsToByteArray |
( |
OSCTXT * |
pctxt, |
|
|
OSOCTET * |
pbuffer, |
|
|
OSSIZE |
bufsiz, |
|
|
OSSIZE |
nbits |
|
) |
| |
This function decodes bits and returns the result in an octet array.
- Parameters
-
pctxt | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
pbuffer | Address of buffer to receive decoded binary data. |
bufsiz | Size of output buffer. |
nbits | Number of bits to read from decode buffer. |
- Returns
- Status of the operation. Zero if successful; a negative status code if failed.
◆ rtxDecBitsToSize()
EXTERNRT int rtxDecBitsToSize |
( |
OSCTXT * |
pctxt, |
|
|
OSSIZE * |
pvalue, |
|
|
OSSIZE |
nbits |
|
) |
| |
This function decodes up to sizeof(size_t) bits and returns the result in a size-typed value.
- Parameters
-
pctxt | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
pvalue | Pointer to value to be receive decoded result. |
nbits | Number of bits to read from decode buffer. |
- Returns
- Status of the operation. Zero if successful; a negative status code if failed.
◆ rtxDecBitsToUInt16()
EXTERNRT int rtxDecBitsToUInt16 |
( |
OSCTXT * |
pctxt, |
|
|
OSUINT16 * |
pvalue, |
|
|
OSUINT8 |
nbits |
|
) |
| |
This function decodes bits and returns the result in an unsigned 16-bit (short) value.
Bits are shifted to the right in the decode byte to remove unused bits. For example, if a single bit is decoded from octet 0x80, the decoded byte value will be 1.
- Parameters
-
pctxt | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
pvalue | Pointer to byte value to receive decoded data. |
nbits | Number of bits to read from decode buffer. The maximum that can be read is sixteen. |
- Returns
- Status of the operation. Zero if successful; a negative status code if failed.
◆ rtxPeekBit()
EXTERNRT int rtxPeekBit |
( |
OSCTXT * |
pctxt, |
|
|
OSBOOL * |
pvalue |
|
) |
| |
This function decodes the bit at the current position and the resets the bit cursor back to the original position.
- Parameters
-
pctxt | A pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
pvalue | A pointer to the BOOLEAN value to receive the decoded result. A null pointer value may be passed to skip the bit. |
- Returns
- Completion status of operation:
- 0 (0) = success,
- negative return value is error.
◆ rtxSkipBits()
EXTERNRT int rtxSkipBits |
( |
OSCTXT * |
pctxt, |
|
|
OSSIZE |
nbits |
|
) |
| |
This function skips the given number of bits.
- Parameters
-
pctxt | Pointer to a context structure. This provides a storage area for the function to store all working variables that must be maintained between function calls. |
nbits | Number of bits to skip. |
- Returns
- Status of the operation. Zero if successful; a negative status code if failed.