On this page
packet.bit
Reads one bit (0 = least significant, 7 = most significant) of a payload byte as true or false, or null when the offset or bit is out of range.
Syntax
Atlas Script
packet.bit(offset, bit)Parameters
offset- Byte offset into the packet. Payload-relative for packet.* methods, and absolute (whole IP packet) for the raw_* variants.
bit- Bit index within the byte, 0 for the least-significant bit through 7.
Return value
See the remarks for the returned value and runtime behavior.
Remarks
Reads one bit (0 = least significant, 7 = most significant) of a payload byte as true or false, or null when the offset or bit is out of range.
Examples
Usage pattern
// Replace offset, bit with values described above.
packet.bit(offset, bit);