fprime_gds.executables.tcpserver

Module Contents

Classes

ThreadedTCPRequestHandler(request, client_address, server)

Derived from original Stable demo during R&TD and adapted

ThreadedUDPRequestHandler(request, client_address, server)

Derived from original Stable demo during R&TD and adapted

ThreadedTCPServer(server_address, RequestHandlerClass, bind_and_activate=True)

TCP Socket server.

ThreadedUDPServer(server_address, RequestHandlerClass, bind_and_activate=True)

UDP Socket server.

DestObj(name, request)

Destination object for all clients registered.

Functions

signal_handler(*_)

now()

main(argv=None)

fprime_gds.executables.tcpserver.__version__ = 0.1[source]
fprime_gds.executables.tcpserver.__date__ = 2015-04-03[source]
fprime_gds.executables.tcpserver.__updated__ = 2016-04-07[source]
fprime_gds.executables.tcpserver.SERVER[source]
fprime_gds.executables.tcpserver.LOCK[source]
fprime_gds.executables.tcpserver.shutdown_event[source]
fprime_gds.executables.tcpserver.FSW_clients = [][source]
fprime_gds.executables.tcpserver.GUI_clients = [][source]
fprime_gds.executables.tcpserver.FSW_ids = [][source]
fprime_gds.executables.tcpserver.GUI_ids = [][source]
fprime_gds.executables.tcpserver.signal_handler(*_)[source]
fprime_gds.executables.tcpserver.now()[source]
class fprime_gds.executables.tcpserver.ThreadedTCPRequestHandler(request, client_address, server)[source]

Bases: socketserver.StreamRequestHandler

Derived from original Stable demo during R&TD and adapted for use in new FSW gse.py applicaiton.

TCP socket server for commands, log events, and telemetry data. Later this will handle other things such as sequence files and parameters.

Handle is instanced in own thread for each client.

Registration is done by sending the string “Register <name>”. Sending a message to destination <name> is done as “A5A5 <name> <data>” Note only <data> is sent. Any client that sends a “List” comment makes the server display all registered clients.

allow_reuse_address = True[source]
timeout = 1[source]
handle(self)[source]

The function that is invoked upon a new client. This function listens for data on the socket. Packets for now are assumed to be separated by a newline. For each packet, call processPkt.

getCmds(self, inputString, end_of_command=b'\n')[source]

Build a command from partial or full socket input

processQueue(self)[source]
processRegistration(self, cmd)[source]
getNewMsg(self)[source]

After registration wait for an incoming message The first part must always be an “A5A5 ” or a “List “

recv(self, l)[source]

Read l bytes from socket.

readHeader(self)[source]
Read the 9 byte header (e.g. “A5A5 GUI ” or “A5A5 FSW “),

or just read the “List

” command.

readData(self, header)[source]

Read the data part of the message sent to either GUI or FSW. GUI receives telemetry. FSW receives commands of various lengths.

processNewPkt(self, header, data)[source]

Process a single command here header and data here. The command must always start with A5A5 except if it is a List. Once the entire header tstring is processed send it on queue. If something goes wrong report and shutdown server.

class fprime_gds.executables.tcpserver.ThreadedUDPRequestHandler(request, client_address, server)[source]

Bases: socketserver.BaseRequestHandler

Derived from original Stable demo during R&TD and adapted for use in new FSW gse.py applicaiton.

TCP socket server for commands, log events, and telemetry data. Later this will handle other things such as sequence files and parameters.

Handle is instanced in own thread for each client.

Registration is done by sending the string “Register <name>”. Sending a message to destination <name> is done as “A5A5 <name> <data>” Note only <data> is sent. Any client that sends a “List” comment makes the server display all registered clients.

allow_reuse_address = True[source]
handle(self)[source]

The function that is invoked when a packet is received. This function listens for data on the socket. Packets for now are assumed to be separated by a newline. For each packet, call processPkt.

getNewMsg(self, packet)[source]

After registration wait for an incoming message The first part must always be an “A5A5 ” or a “List “

readHeader(self, packet)[source]
Read the 9 byte header (e.g. “A5A5 GUI ” or “A5A5 FSW “),

or just read the “List

” command.

readData(self, header, packet)[source]

Read the data part of the message sent to either GUI or FSW. GUI receives telemetry. FSW receives commands of various lengths.

processNewPkt(self, header, data)[source]

Process a single command here header and data here. The command must always start with A5A5 except if it is a List. Once the entire header string is processed send it on queue. If something goes wrong report and shutdown server.

class fprime_gds.executables.tcpserver.ThreadedTCPServer(server_address, RequestHandlerClass, bind_and_activate=True)[source]

Bases: socketserver.ThreadingMixIn, socketserver.TCPServer

TCP Socket server.

Keep a dictionary of destination objects containing queues and socket id’s for writting to destinations.

dest_obj[source]
lock_obj[source]
class fprime_gds.executables.tcpserver.ThreadedUDPServer(server_address, RequestHandlerClass, bind_and_activate=True)[source]

Bases: socketserver.ThreadingMixIn, socketserver.UDPServer

UDP Socket server.

class fprime_gds.executables.tcpserver.DestObj(name, request)[source]

Destination object for all clients registered.

put(self, msg)[source]

Write out the message to the destination socket

fileno(self)[source]
fprime_gds.executables.tcpserver.main(argv=None)[source]

Build: 1.4.1