PTT_STATE

This commit is contained in:
DJ2LS 2021-02-19 09:58:12 +01:00 committed by GitHub
parent 60bea070ec
commit 7f1a502a81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 3 deletions

View file

@ -64,6 +64,7 @@ class RF():
def transmit_arq_ack(self,ack_buffer):
#print(ack_buffer)
static.ARQ_STATE = 'SENDING_ACK'
static.PTT_STATE = True
self.c_lib.freedv_open.restype = ctypes.POINTER(ctypes.c_ubyte)
freedv = self.c_lib.freedv_open(static.FREEDV_SIGNALLING_MODE)
@ -99,11 +100,12 @@ class RF():
self.stream_tx.write(bytes(txbuffer))
self.stream_tx.write(bytes(txbuffer))
static.PTT_STATE = False
static.ARQ_STATE = 'RECEIVING_DATA'
#--------------------------------------------------------------------------------------------------------
# GET ARQ BURST FRAME VOM BUFFER AND MODULATE IT
def transmit_arq_burst(self):
static.PTT_STATE = True
static.ARQ_STATE = 'SENDING_DATA'
self.c_lib.freedv_open.restype = ctypes.POINTER(ctypes.c_ubyte)
@ -160,7 +162,7 @@ class RF():
self.c_lib.freedv_rawdatatx(freedv,mod_out,data) # modulate DATA and safe it into mod_out pointer
txbuffer += bytes(mod_out)
txbuffer = txbuffer.rstrip(b'\x00') #lets remove unallocated memory because of wrong buffer :-/
elif static.ARQ_RPT_RECEIVED == True:
for n in range(0,len(static.ARQ_RPT_FRAMES)):
@ -207,7 +209,7 @@ class RF():
#time.sleep(0.5)
static.ARQ_STATE = 'IDLE'
#static.ARQ_STATE = 'RECEIVING_SIGNALLING'
static.PTT_STATE = False
#--------------------------------------------------------------------------------------------------------
def receive(self,data_mode,signalling_mode):
force = False

View file

@ -60,7 +60,16 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
if data == 'GET:DXCALLSIGN':
self.request.sendall(bytes(static.DXCALLSIGN, encoding))
if data == 'GET:TNC_STATE':
self.request.sendall(static.TNC_STATE)
if data == 'GET:PTT_STATE':
self.request.sendall(bytes(str(static.PTT_STATE), encoding))
# ARQ
if data == 'GET:ARQ_STATE':
self.request.sendall(bytes(static.ARQ_STATE, encoding))

View file

@ -17,6 +17,8 @@ MYGRID = b''
TNC_STATE = b'IDLE'
PTT_STATE = False
#---------------------------------
# Server Defaults