|
My Project
|
Public Types | |
| enum | Request { INVALID, SERVO_ENGAGE, GET_AZEL, GET_PRIOR_LOC, SEND_POS, SEND_POS_TRIP, LOAD_LOOP_PARAMS_A, LOAD_LOOP_PARAMS_B, LOAD_LOOP_PARAMS_C, LOAD_LOOP_PARAMS_D, QUERY_STATUS, AZ_BRAKE_ON, AZ_BRAKE_OFF, EL_BRAKE_ON, EL_BRAKE_OFF, CLUTCHES_ON, CLUTCHES_OFF, AZ_CONTACTORS_ON, AZ_CONTACTORS_OFF, EL_CONTACTORS_ON, EL_CONTACTORS_OFF, POSITION_ERRORS } |
Public Member Functions | |
| void | constructMap () |
| ServoCommandSa () | |
| ~ServoCommandSa () | |
| void | packCommand (Request req) |
| void | packCommand (Request req, std::vector< float > &values) |
| void | checkOneOutput () |
| void | checkTwoOutputs () |
| void | checkManyOutputs () |
| void | interpretStatusResponse (const char *response) |
| void | interpretResponse () |
| bool | simpleValidityCheck () |
| size_t | responseLength () |
| size_t | size () |
Public Attributes | |
| std::map< Request, std::string > | commandMap_ |
| unsigned char | request_ |
| std::string | messageToSend_ |
| std::string | expectedResponse_ |
| char | responseReceived_ [SERVO_DATA_MAX_LEN] |
| unsigned short | cmdSize_ |
| bool | expectsResponse_ |
| unsigned short | responseLength_ |
| unsigned char | readData_ [SERVO_DATA_MAX_LEN] |
| unsigned char | tmpBuffer_ [SERVO_DATA_MAX_LEN] |
| bool | responseValid_ |
| bool | responseValueValid_ |
| bool | ppsPresent_ |
| float | responseValue_ [MAX_RESPONSE_SAMPLES] |
Friends | |
| class | ServoComms |
Enumerate supported commands
| ServoCommandSa::ServoCommandSa | ( | ) |
Constructor.
....................................................................... Constructor initializes request type to invalid and constructs the command map.
| ServoCommandSa::~ServoCommandSa | ( | ) |
Destructor.
....................................................................... Constructor initializes request type to invalid.
| void ServoCommandSa::checkManyOutputs | ( | ) |
Check if box output is valid when many return values.
....................................................................... Check if box output is valid, and what its value is.
| void ServoCommandSa::checkOneOutput | ( | ) |
Check if box output is valid when one return value.
....................................................................... Check if box output is valid, and what its value is.
| void ServoCommandSa::checkTwoOutputs | ( | ) |
Check if box output is valid when two return values.
....................................................................... Check if box output is valid, and what its value is.
| void ServoCommandSa::constructMap | ( | ) |
Construct the map
....................................................................... Construct our map from enums to strings to issue.
| void ServoCommandSa::interpretResponse | ( | ) |
Interpret what we get back
....................................................................... Interpret Command to see if something valid happened.
| void ServoCommandSa::interpretStatusResponse | ( | const char * | response | ) |
Interpret our awful status response
....................................................................... Interpret our awful status response
| void ServoCommandSa::packCommand | ( | Request | req | ) |
General Pack Command
....................................................................... pack all our commands
| size_t ServoCommandSa::responseLength | ( | ) |
Return the number of bytes read.
....................................................................... Return the response length.
| bool ServoCommandSa::simpleValidityCheck | ( | ) |
Simple check that two strings match.
....................................................................... Simple Check if two strings match
| size_t ServoCommandSa::size | ( | ) |
The size of the command to send.
....................................................................... Return our size as a size_t suitable for passing to write(2) or read(2).
| unsigned short gcp::antenna::control::ServoCommandSa::cmdSize_ |
The size of the command to send.
| std::string gcp::antenna::control::ServoCommandSa::expectedResponse_ |
Expected Response
| bool gcp::antenna::control::ServoCommandSa::expectsResponse_ |
True if we are expecting a response to a command
| std::string gcp::antenna::control::ServoCommandSa::messageToSend_ |
Command to be issued
| bool gcp::antenna::control::ServoCommandSa::ppsPresent_ |
Whether 1 PPS is present
| unsigned char gcp::antenna::control::ServoCommandSa::readData_[SERVO_DATA_MAX_LEN] |
A buffer into which we can read data returned by the pmac.
| unsigned char gcp::antenna::control::ServoCommandSa::request_ |
Index pertaining to all request types.
| unsigned short gcp::antenna::control::ServoCommandSa::responseLength_ |
If we are expecting a response, how many bytes should be received?
| char gcp::antenna::control::ServoCommandSa::responseReceived_[SERVO_DATA_MAX_LEN] |
Response Received
| bool gcp::antenna::control::ServoCommandSa::responseValid_ |
Whether the response is valid
| float gcp::antenna::control::ServoCommandSa::responseValue_[MAX_RESPONSE_SAMPLES] |
Value of the response
| bool gcp::antenna::control::ServoCommandSa::responseValueValid_ |
Whether the response value is valid
| unsigned char gcp::antenna::control::ServoCommandSa::tmpBuffer_[SERVO_DATA_MAX_LEN] |
A pointer to this buffer may be handed back via calls to unsigned int* readRegResponse(), above