TReK ANSI-C
5.3.3
All ANSI-C APIs
|
Defines the Release 3 Compatible Command API. More...
Functions | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UplinkPOICCommand (const char *dest_name_ptr, const char *cmd_name_ptr) |
This function sends a request to the POIC that will build the command uplink pattern from the current values stored in the POIC Operational Command Database (OCDB). More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UplinkUserCommand (const char *dest_name_ptr, const char *cmd_name_ptr, const unsigned char *cmd_data_ptr, unsigned long len_of_cmd_data) |
This function sends the user provided command to the specified destination. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | AddHeaderAndUplinkCommand (const char *dest_name_ptr, const char *cmd_name_ptr, const char *header_name_ptr, const unsigned char *cmd_data_ptr, unsigned long len_of_cmd_data) |
This function builds the specified header from the information contained in the TReK database associated with the destination and appends the user provided command data to the header. The resulting bit pattern is sent to the destination. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | BuildAndUplinkCommand (const char *dest_name_ptr, const char *cmd_name_ptr) |
This function builds the uplink pattern from the information contained in the TReK database for this destination. Both the header and command are built and the resulting bit pattern is sent to the destination. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UplinkUserCommandVB (const char *dest_name_ptr, const char *cmd_name_ptr, const char *cmd_data_ptr, long len_of_cmd_data) |
This function sends the user provided command to the specified destination. This function is specifically written for Visual Basic users. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | AddHeaderAndUplinkCommandVB (const char *dest_name_ptr, const char *cmd_name_ptr, const char *header_name_ptr, const char *cmd_data_ptr, long len_of_cmd_data) |
This function builds the specified header from the information contained in the TReK database associated with the destination and appends the user provided command data to the header. The resulting bit pattern is sent to the destination. This function is specifically written for Visual Basic users. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UpdateNumericFieldValue (int field_type, const char *dest_name_ptr, const char *mnemonic_ptr, const char *field_name_ptr, double new_value) |
This function updates a local command or header field value with the specified double precision floating point value. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UpdateStringFieldValue (int field_type, const char *dest_name_ptr, const char *mnemonic_ptr, const char *field_name_ptr, const char *new_value_ptr) |
This function updates a local command or header field value with the specified NULL terminated string value. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UpdateBinaryFieldValue (int field_type, const char *dest_name_ptr, const char *mnemonic_ptr, const char *field_name_ptr, const unsigned char *new_value_ptr, unsigned long length) |
This function updates a local command or header field value with the specified binary value. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UpdateBinaryFieldValueVB (int field_type, const char *dest_name_ptr, const char *mnemonic_ptr, const char *field_name_ptr, const char *new_value_ptr, long length) |
This function updates a local command or header field value with the specified binary value. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UpdatePOICDatabase (int field_type, const char *dest_name_ptr, const char *mnemonic_ptr) |
This function updates the modifiable fields in the POIC database with the contents of the local database for the specified command. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | GetNumericFieldValue (int field_type, const char *dest_name_ptr, const char *mnemonic_ptr, const char *field_name_ptr, double *value_ptr) |
This function gets the current value of a local command or header field. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | GetStringFieldValue (int field_type, const char *dest_name_ptr, const char *mnemonic_ptr, const char *field_name_ptr, long *size_of_data_ptr, char *value_ptr) |
This function gets the current value of a local command or header field. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | GetBinaryFieldValue (int field_type, const char *dest_name_ptr, const char *mnemonic_ptr, const char *field_name_ptr, long *size_of_data_ptr, unsigned char *value_ptr) |
This function gets the current value of a local command or header field. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | GetPOICCommandSystemConfiguration (const char *dest_name_ptr, POIC_Command_System_Configuration *config_ptr) |
This function retrieves the Command System Configuration message for a destination. This message contains all of the items found in the most recent message received from the POIC. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | GetPOICCommandSystemStatus (const char *dest_name_ptr, POIC_Command_System_Status *status_ptr) |
This function retrieves the Command System Status message for a destination. This message contains all of the items found in the most recent message received from the POIC. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | GetCommandAPIReturnCodeAsString (int error_code, long size_of_data, char *message_ptr) |
This function provides a way to retrieve a string value that corresponds to a Command API integer value return code. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | UnblockDestination (const char *dest_name_ptr) |
This function bypasses the built in blocking (i.e., waiting for the appropriate "Clear to Send" message to be returned from the POIC) for a destination in TReK. More... | |
int EXPORT_THIS_CMD_USER_C_FUNCTION | SetNumberOfRetries (const char *dest_name_ptr, long num_retries) |
This function sets the number of retries for the POIC system to attempt when sending a command uplink to the MCC-H. More... | |
Defines the Release 3 Compatible Command API.
int EXPORT_THIS_CMD_USER_C_FUNCTION AddHeaderAndUplinkCommand | ( | const char * | dest_name_ptr, |
const char * | cmd_name_ptr, | ||
const char * | header_name_ptr, | ||
const unsigned char * | cmd_data_ptr, | ||
unsigned long | len_of_cmd_data | ||
) |
This function builds the specified header from the information contained in the TReK database associated with the destination and appends the user provided command data to the header. The resulting bit pattern is sent to the destination.
[in] | dest_name_ptr | The name of the destination to send the command. |
[in] | cmd_name_ptr | The name of the command to request for uplink. |
[in] | header_name_ptr | The name of the header to build. This input is not used, but still must be supplied (an empty string is ok). |
[in] | cmd_data_ptr | The bit pattern for the command data. |
[in] | len_of_cmd_data | The length of the command data bit pattern in bytes. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION AddHeaderAndUplinkCommandVB | ( | const char * | dest_name_ptr, |
const char * | cmd_name_ptr, | ||
const char * | header_name_ptr, | ||
const char * | cmd_data_ptr, | ||
long | len_of_cmd_data | ||
) |
This function builds the specified header from the information contained in the TReK database associated with the destination and appends the user provided command data to the header. The resulting bit pattern is sent to the destination. This function is specifically written for Visual Basic users.
[in] | dest_name_ptr | The name of the destination to send the command. |
[in] | cmd_name_ptr | The name of the command to request for uplink. |
[in] | header_name_ptr | The name of the header to build. This input is not used, but still must be supplied (an empty string is ok). |
[in] | cmd_data_ptr | The bit pattern for the command data. |
[in] | len_of_cmd_data | The length of the command data bit pattern in bytes. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION BuildAndUplinkCommand | ( | const char * | dest_name_ptr, |
const char * | cmd_name_ptr | ||
) |
This function builds the uplink pattern from the information contained in the TReK database for this destination. Both the header and command are built and the resulting bit pattern is sent to the destination.
[in] | dest_name_ptr | The name of the destination to send the command. This destination must be a POIC type destination. |
[in] | cmd_name_ptr | The name of the command to build for uplink. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION GetBinaryFieldValue | ( | int | field_type, |
const char * | dest_name_ptr, | ||
const char * | mnemonic_ptr, | ||
const char * | field_name_ptr, | ||
long * | size_of_data_ptr, | ||
unsigned char * | value_ptr | ||
) |
This function gets the current value of a local command or header field.
The command or header must be defined in the database associated with the destination. This function is used to data that cannot be represented as a number or string.
[in] | field_type | Either COMMAND_FIELD or HEADER_FIELD. |
[in] | dest_name_ptr | The name of the destination to get the command or header. |
[in] | mnemonic_ptr | The name of the command or header. |
[in] | field_name_ptr | The name of the field to retrieve the current value for. |
[in] | size_of_data_ptr | The size of data allocated by the calling program in bytes. You must specify enough space for the data to be copied. |
[out] | value_ptr | The returned value for the command or header field. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION GetCommandAPIReturnCodeAsString | ( | int | error_code, |
long | size_of_data, | ||
char * | message_ptr | ||
) |
This function provides a way to retrieve a string value that corresponds to a Command API integer value return code.
The user must allocate memory for the string.
[in] | error_code | Returned from a call to another TReK Command API function. |
[in] | size_of_data | The size of data allocated. Should be at least 70 bytes. |
[out] | message_ptr | The returned message string. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION GetNumericFieldValue | ( | int | field_type, |
const char * | dest_name_ptr, | ||
const char * | mnemonic_ptr, | ||
const char * | field_name_ptr, | ||
double * | value_ptr | ||
) |
This function gets the current value of a local command or header field.
The command or header must be defined in the database associated with the destination. This function is used to get all numeric data, including integers and unsigned integers.
[in] | field_type | Either COMMAND_FIELD or HEADER_FIELD. |
[in] | dest_name_ptr | The name of the destination to get the command or header. |
[in] | mnemonic_ptr | The name of the command or header. |
[in] | field_name_ptr | The name of the field to retrieve the current value for. |
[out] | value_ptr | The returned value for the command or header field. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION GetPOICCommandSystemConfiguration | ( | const char * | dest_name_ptr, |
POIC_Command_System_Configuration * | config_ptr | ||
) |
This function retrieves the Command System Configuration message for a destination. This message contains all of the items found in the most recent message received from the POIC.
[in] | dest_name_ptr | The name of the destination. This destination must be a POIC type destination. |
[out] | config_ptr | A structure defined in trek_cmd_user_api.h. You must have allocated memory for this variable before calling the function. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION GetPOICCommandSystemStatus | ( | const char * | dest_name_ptr, |
POIC_Command_System_Status * | status_ptr | ||
) |
This function retrieves the Command System Status message for a destination. This message contains all of the items found in the most recent message received from the POIC.
[in] | dest_name_ptr | The name of the destination. This destination must be a POIC type destination. |
[out] | status_ptr | A structure defined in trek_cmd_user_api.h. You must have allocated memory for this variable before calling the function. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION GetStringFieldValue | ( | int | field_type, |
const char * | dest_name_ptr, | ||
const char * | mnemonic_ptr, | ||
const char * | field_name_ptr, | ||
long * | size_of_data_ptr, | ||
char * | value_ptr | ||
) |
This function gets the current value of a local command or header field.
The command or header must be defined in the database associated with the destination. This function is used to get all string values.
[in] | field_type | Either COMMAND_FIELD or HEADER_FIELD. |
[in] | dest_name_ptr | The name of the destination to get the command or header. |
[in] | mnemonic_ptr | The name of the command or header. |
[in] | field_name_ptr | The name of the field to retrieve the current value for. |
[in] | size_of_data_ptr | The size of data allocated by the calling program in bytes. You must specify enough space for the data to be copied. |
[out] | value_ptr | The returned value for the command or header field. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION SetNumberOfRetries | ( | const char * | dest_name_ptr, |
long | num_retries | ||
) |
This function sets the number of retries for the POIC system to attempt when sending a command uplink to the MCC-H.
This value will be checked whenever a new Command System Configuration message is received for the destination. If the current value set with this function exceeds the maximum number of retries specified in the Command System Configuration message, it will be reset to the value in the Command System Configuration message.
[in] | dest_name_ptr | The name of the destination to change the number of retries. |
[in] | num_retries | New number of retries. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UnblockDestination | ( | const char * | dest_name_ptr | ) |
This function bypasses the built in blocking (i.e., waiting for the appropriate "Clear to Send" message to be returned from the POIC) for a destination in TReK.
It can be safely called for any destination type, but is really only applicable to POIC and TReK destinations. Since this function bypasses the blocking in TReK necessary to meet defined interfaces, the POIC destination may not accept further requests (e.g., command uplinks). This function should only be used as a means to resolve potential interface problems between the POIC and TReK when all other options have been exhausted.
[in] | dest_name_ptr | The name of the destination to unblock. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UpdateBinaryFieldValue | ( | int | field_type, |
const char * | dest_name_ptr, | ||
const char * | mnemonic_ptr, | ||
const char * | field_name_ptr, | ||
const unsigned char * | new_value_ptr, | ||
unsigned long | length | ||
) |
This function updates a local command or header field value with the specified binary value.
The command or header must be defined in the database associated with the destination. Note: For fixed length fields, if you attempt to store less than the expected number of bytes, the data will be right justified. The remaining bytes of the field will be set to zero.
[in] | field_type | Either COMMAND_FIELD or HEADER_FIELD. |
[in] | dest_name_ptr | The name of the destination to update the command or header. |
[in] | mnemonic_ptr | The name of the command or header. |
[in] | field_name_ptr | The name of the field to update. |
[in] | new_value_ptr | New binary data for field value. |
[in] | length | The number of bytes of data for new_value_ptr. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UpdateBinaryFieldValueVB | ( | int | field_type, |
const char * | dest_name_ptr, | ||
const char * | mnemonic_ptr, | ||
const char * | field_name_ptr, | ||
const char * | new_value_ptr, | ||
long | length | ||
) |
This function updates a local command or header field value with the specified binary value.
The command or header must be defined in the database associated with the destination. This function is specifically written for Visual Basic users. Note: For fixed length fields, if you attempt to store less than the expected number of bytes, the data will be right justified. The remaining bytes of the field will be set to zero.
[in] | field_type | Either COMMAND_FIELD or HEADER_FIELD. |
[in] | dest_name_ptr | The name of the destination to update the command or header. |
[in] | mnemonic_ptr | The name of the command or header. |
[in] | field_name_ptr | The name of the field to update. |
[in] | new_value_ptr | New binary data for field value. |
[in] | length | The number of bytes of data for new_value_ptr. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UpdateNumericFieldValue | ( | int | field_type, |
const char * | dest_name_ptr, | ||
const char * | mnemonic_ptr, | ||
const char * | field_name_ptr, | ||
double | new_value | ||
) |
This function updates a local command or header field value with the specified double precision floating point value.
The command or header must be defined in the database associated with the destination. This function is used to update all numeric data, including integers and unsigned integers. This function allows the numeric fields to be updated as floating point numbers. If the uplink data type for the field is an integer, the value will be truncated when added to the uplink packet.
[in] | field_type | Either COMMAND_FIELD or HEADER_FIELD. |
[in] | dest_name_ptr | The name of the destination to update the command or header. |
[in] | mnemonic_ptr | The name of the command or header. |
[in] | field_name_ptr | The name of the field to update. |
[in] | new_value | The new value for the command or header field. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UpdatePOICDatabase | ( | int | field_type, |
const char * | dest_name_ptr, | ||
const char * | mnemonic_ptr | ||
) |
This function updates the modifiable fields in the POIC database with the contents of the local database for the specified command.
[in] | field_type | Must be COMMAND_FIELD |
[in] | dest_name_ptr | The name of the destination to update the command. |
[in] | mnemonic_ptr | The name of the command. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UpdateStringFieldValue | ( | int | field_type, |
const char * | dest_name_ptr, | ||
const char * | mnemonic_ptr, | ||
const char * | field_name_ptr, | ||
const char * | new_value_ptr | ||
) |
This function updates a local command or header field value with the specified NULL terminated string value.
The command or header must be defined in the database associated with the destination.
[in] | field_type | Either COMMAND_FIELD or HEADER_FIELD. |
[in] | dest_name_ptr | The name of the destination to update the command or header. |
[in] | mnemonic_ptr | The name of the command or header. |
[in] | field_name_ptr | The name of the field to update. |
[in] | new_value_ptr | New NULL terminated string value for the command or header field. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UplinkPOICCommand | ( | const char * | dest_name_ptr, |
const char * | cmd_name_ptr | ||
) |
This function sends a request to the POIC that will build the command uplink pattern from the current values stored in the POIC Operational Command Database (OCDB).
[in] | dest_name_ptr | The name of the destination to send the command. This destination must be a POIC type destination. |
[in] | cmd_name_ptr | The name of the command to request for uplink. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UplinkUserCommand | ( | const char * | dest_name_ptr, |
const char * | cmd_name_ptr, | ||
const unsigned char * | cmd_data_ptr, | ||
unsigned long | len_of_cmd_data | ||
) |
This function sends the user provided command to the specified destination.
[in] | dest_name_ptr | The name of the destination to send the command. |
[in] | cmd_name_ptr | The name of the command to request for uplink. |
[in] | cmd_data_ptr | The entire bit pattern for the command. This includes any headers and checksum. |
[in] | len_of_cmd_data | The length of the bit pattern to uplink in bytes. |
Example:
int EXPORT_THIS_CMD_USER_C_FUNCTION UplinkUserCommandVB | ( | const char * | dest_name_ptr, |
const char * | cmd_name_ptr, | ||
const char * | cmd_data_ptr, | ||
long | len_of_cmd_data | ||
) |
This function sends the user provided command to the specified destination. This function is specifically written for Visual Basic users.
[in] | dest_name_ptr | The name of the destination to send the command. |
[in] | cmd_name_ptr | The name of the command to request for uplink. |
[in] | cmd_data_ptr | The entire bit pattern for the command. This includes any headers and checksum. |
[in] | len_of_cmd_data | The length of the bit pattern to uplink in bytes. |
Example: