|
|
@ -1,18 +1,3 @@ |
|
|
|
class TF_Msg: |
|
|
|
|
|
|
|
def __init__(self, id=0, type=0, data=None): |
|
|
|
|
|
|
|
self.data = data if data is not None else bytearray() |
|
|
|
|
|
|
|
self.type = type |
|
|
|
|
|
|
|
self.id = id |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
|
|
|
return f"ID {self.id:X}h, type {self.type:X}h, body: {self.data}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TF: |
|
|
|
|
|
|
|
STAY = 'STAY' |
|
|
|
|
|
|
|
RENEW = 'RENEW' |
|
|
|
|
|
|
|
CLOSE = 'CLOSE' |
|
|
|
|
|
|
|
NEXT = 'NEXT' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TinyFrame: |
|
|
|
class TinyFrame: |
|
|
|
def __init__(self, peer=1): |
|
|
|
def __init__(self, peer=1): |
|
|
|
self.write = None # the writer function should be attached here |
|
|
|
self.write = None # the writer function should be attached here |
|
|
@ -348,19 +333,18 @@ class TinyFrame: |
|
|
|
'fn': lst, |
|
|
|
'fn': lst, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TF_Msg: |
|
|
|
|
|
|
|
def __init__(self): |
|
|
|
|
|
|
|
self.data = bytearray() |
|
|
|
|
|
|
|
self.len = 0 |
|
|
|
|
|
|
|
self.type = 0 |
|
|
|
|
|
|
|
self.id = 0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
|
|
|
|
return f"ID {self.id:X}h, type {self.type:X}h, len {self.len:d}, body: {self.data}" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TF: |
|
|
|
|
|
|
|
STAY = 'STAY' |
|
|
|
|
|
|
|
RENEW = 'RENEW' |
|
|
|
|
|
|
|
CLOSE = 'CLOSE' |
|
|
|
|
|
|
|
NEXT = 'NEXT' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|