Skip to content

Instantly share code, notes, and snippets.

@delfick delfick/make_packet.py Secret
Created Mar 22, 2020

Embed
What would you like to do?
from photons_app.executor import library_setup
from photons_messages import protocol_register
from photons_protocol.messages import Messages
import binascii
async def make_packet(collector):
packet = {
"ack_required": False,
"res_required": True,
"sequence": 1,
"target": "d073d5001337",
"protocol": 1024,
"source": 1,
"pkt_type": 101,
}
bts = Messages.pack(packet, protocol_register).tobytes()
print(binascii.hexlify(bts).decode())
if __name__ == "__main__":
collector = library_setup()
collector.run_coro_as_main(make_packet(collector))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.