... | ... | @@ -10,7 +10,7 @@ The images underneath is the class diagram of the antenna 34. It started from th |
|
|
|
|
|
### Receiving messages from the server
|
|
|
|
|
|
The server sends coordinates in the form of a ServerAntennaCommunicationMessage. After initialisation and starting all the threads of the driver as a last step the Humain34mDriverApp creates a server socket that listens to the incoming messages of the driver. Once a message is received a new thread is started with the AntennaMessageReceiverRunner as runnable. This runnable will read the message from the socket, parse the message, request the correct AntennaMessageHandler from the AntennaMessageHandlerFactory and passes the message to the handler. The AntennaMessageHandler returns a AntennaMessageHandlerStream that can be used to return a message to the server over the same socket. If this is done, the socket is closed. At the moment there are two different messages being send by the server: antenna instructions and the antenna stop message.
|
|
|
The server sends coordinates in the form of a ServerAntennaCommunicationMessage. After initialisation and starting all the threads of the driver, as a last step, the Humain34mDriverApp creates a server socket that listens to the incoming messages of the driver. Once a message is received a new thread is started with the AntennaMessageReceiverRunner as runnable. This runnable will read the message from the socket, parse the message, request the correct AntennaMessageHandler from the AntennaMessageHandlerFactory and passes the message to the handler. The AntennaMessageHandler returns a AntennaMessageHandlerStream that can be used to return a message to the server over the same socket. If this is done, the socket is closed. At the moment there are two different messages being send by the server: antenna instructions and the antenna stop message.
|
|
|
|
|
|
#### Handling antenna instructions
|
|
|
The AntennaMessageHandlerFactory needs a handler to handle the antenna instructions. In this case the AntennaInstructionHandler is responsible for handling the antenna instructions. The AntenneInstructionHandler implements the AntennaMessageHandler interface and is added to the AntennaMessageHandlerFactory by the Humain34mDriverApp. The AntennaInstructionHandler will convert the coordinates in useful coordinates for the driver. The coordinates are offered to the InstructionHandlerDBService.
|
... | ... | |