Skip to content

Add 0x00 Packet ID #7

@DavesCodeMusings

Description

@DavesCodeMusings

Example:

# Auto-incrementing property
class Test:
    _packet_id = -1

    @property
    def packet_id(self):
        self._packet_id += 1
        self._packet_id &= 0xFF  # Truncate to 8-bit max
        return self._packet_id

def demo():
    test = Test()
    for i in range(0, 260):
        print(getattr(test, "packet_id"))

if __name__ == "__main__":
    demo()

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions