device temperature set parsing
This commit is contained in:
@ -7,21 +7,16 @@ from tmtccmd.logging import get_console_logger
|
||||
from tmtccmd.utility.obj_id import ObjectId
|
||||
from dle_encoder import DleEncoder
|
||||
|
||||
# TODO add to configuration parameters
|
||||
SERVER_HOST = "localhost"
|
||||
SERVER_PORT = 7305
|
||||
|
||||
LOGGER = get_console_logger()
|
||||
|
||||
|
||||
class TmTcpServer:
|
||||
_Instance = None
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, ip_address: str, port: int):
|
||||
|
||||
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||
|
||||
self.server_socket.bind((SERVER_HOST, SERVER_PORT))
|
||||
self.server_socket.bind((ip_address, port))
|
||||
|
||||
# for now, only accept one connection
|
||||
self.server_socket.listen(0)
|
||||
@ -43,12 +38,6 @@ class TmTcpServer:
|
||||
if self.client_connection is not None:
|
||||
self.client_connection.close()
|
||||
|
||||
@staticmethod
|
||||
def get_instance():
|
||||
if TmTcpServer._Instance is None:
|
||||
TmTcpServer._Instance = TmTcpServer()
|
||||
return TmTcpServer._Instance
|
||||
|
||||
def _send_dictionary_over_socket(self, dictionary):
|
||||
# keep listeners current
|
||||
if self.client_connection is None:
|
||||
|
Reference in New Issue
Block a user