-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAX25Frame.py
More file actions
31 lines (25 loc) · 850 Bytes
/
AX25Frame.py
File metadata and controls
31 lines (25 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class AX25Frame:
## def __init__(self, flag, addres, control, fcs):
## self.flag = flag
## self.addres = addres
## self.control = control
## self.fcs = fcs
def __init__(self):
## self.flag = '{:08b}'.format(0x82)
self.flag = '{:08b}'.format(0x7e)
## self.flag = '0' * 8 * 200
def decode(self):
pass
def is_flag(self, string):
return string == self.flag
def get_flag_index(self, broadcast):
return broadcast.index(self.flag)
def get_all_flags_indecies(self, broadcast):
flag_indecies = []
i = 0;
while (self.flag in broadcast[i:]):
i = broadcast.index(self.flag, i)
flag_indecies.append(i)
i += 1
print(flag_indecies)
return flag_indecies