-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencode_data.py
More file actions
executable file
·21 lines (18 loc) · 863 Bytes
/
encode_data.py
File metadata and controls
executable file
·21 lines (18 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env python3
from argparse import ArgumentParser
from bdf import encode_data
from bqp import TRANSPORT_ID_BLUETOOTH, TRANSPORT_ID_LAN
from log_helper import setup_logging
from sys import stdout
if __name__ == "__main__":
parser = ArgumentParser(description='Encodes one item from a stream and displays it')
group = parser.add_mutually_exclusive_group()
group.add_argument("-v", "--verbose", action="count", help=('Verbose output (for debugging issues)'))
group.add_argument("-q", "--quiet", action="count", help=('Quiet down the output'))
args = parser.parse_args()
setup_logging(args)
protocol_version = 2
pk_commitment = b'\x12\xdb>\xbc;\x84\xbeQ\xd0?g\xab]m\xb7P'
transport = TRANSPORT_ID_LAN
data = encode_data([protocol_version, pk_commitment, [transport, b'\xbcv^X`\x82']])
stdout.buffer.write(data)