#include <AshtechG12_GPS_PhysicalDevice.h>
Collaboration diagram for AshtechG12_GPS_PhysicalDevice:
The intention is to send all commands synchronously over PortA. Asynchonous (periodic) messages are intended to be received from Port B. If no asynchonous operation is desired, Port B may be omitted at initialization. TODO: 1) If we need to use port B for control instead of A for some reason, supply interface to specify which port is for control and which (if any) is for asynch. 2) If necessary, make RecvAckNak() search for leading $PASH instead of just leading '$'. This would only be needed if there is "garbage" on the line that includes '$' characters. 3) As time permits and need dictates, find some way to handle synchronous and asynchronous messaging on the same port. Likely with a reader thread and ACE_Conditional or counting semaphore arrangement. The G12 signifigantly complicates this because messages are not always a single line with a $PASH header.
Definition at line 53 of file AshtechG12_GPS_PhysicalDevice.h.
Public Types | |
enum | { DEFAULT_PORT = 5002 } |
Public Member Functions | |
AshtechG12_GPS_PhysicalDevice () | |
Commands for G12 GPS Receiver Default constructor. Object will be useless until Connect() is called. Default constructor. Object will be useless until Connect() is called. | |
AshtechG12_GPS_PhysicalDevice (const char *serverName) | |
Constructs the device and calls Connect(). This method has no return value so failures in the Connect() method may not be reported. If failures must be handled, you should use the default constructor and call Connect() explicitly. | |
AshtechG12_GPS_PhysicalDevice (const char *serverName, int port) | |
Constructs the device and calls Connect(). This method has no return value so failures in the Connect() method may not be reported. If failures must be handled, you should use the default constructor and call Connect() explicitly. | |
~AshtechG12_GPS_PhysicalDevice () | |
Destroys the AshtechG12_GPS_PhysicalDevice. | |
int | Connect (const char *serverName) |
Attempts to connect the physical device to GPS Receiver. | |
int | Connect (const char *serverName, int portNumber) |
Attempts to connect the physical device to GPS Receiver. | |
int | Send_i (const char *buf) |
int | Send_i (const char *buf, unsigned int len) |
int | Recv_i (char *buf, unsigned int bufsize) |
int | GetCurrentPosition (Position &pos) |
Receive Data from Server Sends the $PASHQ,POS command to the G12. Queries the G12 for its present position. | |
Static Public Member Functions | |
int | ValidateChecksum (const char *message) |
Verifies that a message string matches its embedded checksum. The complete, including header and terminating linefeed, should be passed. | |
Private Attributes | |
ClientSocket * | m_clientSocket |
|
Definition at line 208 of file AshtechG12_GPS_PhysicalDevice.h. |
|
Commands for G12 GPS Receiver Default constructor. Object will be useless until
Definition at line 27 of file AshtechG12_GPS_PhysicalDevice.cpp. |
|
Constructs the device and calls Connect(). This method has no return value so failures in the Connect() method may not be reported. If failures must be handled, you should use the default constructor and call Connect() explicitly.
Definition at line 41 of file AshtechG12_GPS_PhysicalDevice.cpp. References Connect(). |
|
Constructs the device and calls Connect(). This method has no return value so failures in the Connect() method may not be reported. If failures must be handled, you should use the default constructor and call Connect() explicitly.
Definition at line 58 of file AshtechG12_GPS_PhysicalDevice.cpp. References Connect(). |
|
Destroys the AshtechG12_GPS_PhysicalDevice.
Definition at line 66 of file AshtechG12_GPS_PhysicalDevice.cpp. |
|
Attempts to connect the physical device to GPS Receiver.
Definition at line 92 of file AshtechG12_GPS_PhysicalDevice.cpp. References Connect(), and m_clientSocket. |
|
Attempts to connect the physical device to GPS Receiver.
Definition at line 79 of file AshtechG12_GPS_PhysicalDevice.cpp. References DEFAULT_PORT. Referenced by AshtechG12_GPS_PhysicalDevice(), Connect(), and GPSObserver::Initialize(). |
|
Receive Data from Server Sends the $PASHQ,POS command to the G12. Queries the G12 for its present position.
Command to be sent to GPS Receiver Send Command to GPS Receiver Server Retrieve Command from GPS Receiver Server Parse RESPONSE Character Array Definition at line 226 of file AshtechG12_GPS_PhysicalDevice.cpp. References Recv_i(), Send_i(), and AshtechG12_GPS_PhysicalDevice::Position::SetFromPOS_Message(). Referenced by GPSObserver::Run(). |
|
Referenced by GetCurrentPosition(). |
|
Definition at line 124 of file AshtechG12_GPS_PhysicalDevice.cpp. References m_clientSocket. |
|
Definition at line 118 of file AshtechG12_GPS_PhysicalDevice.cpp. Referenced by GetCurrentPosition(). |
|
Verifies that a message string matches its embedded checksum. The complete, including header and terminating linefeed, should be passed.
Definition at line 273 of file AshtechG12_GPS_PhysicalDevice.cpp. Referenced by AshtechG12_GPS_PhysicalDevice::Position::SetFromPOS_Message(). |
|
Definition at line 247 of file AshtechG12_GPS_PhysicalDevice.h. |