TReK ANSI-C  5.3.3
All ANSI-C APIs
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
trek_cmd_user_api.h File Reference

Defines the Release 3 Compatible Command API. More...

#include "trek.h"
#include "trek_error.h"

Macros

#define CMD_API_INVALID_LENGTH   14001
 This message indicates that the user specified command length is greater than what is allowed.
 
#define CMD_API_USER_DISABLED   14002
 This error can occur for POIC destinations that are of the blocking type if destination checking is being performed on the User Enabled parameter that is included in the POIC Command System Status Message. This message indicates that TReK has determined that the POIC status indicates that the user is disabled from commanding. The request for uplink was never sent to the POIC from TReK.
 
#define CMD_API_MCCH_DISABLED   14003
 This error can occur for POIC destinations that are of the blocking type if destination checking is being performed on the User Enabled parameter that is included in the POIC Command System Status Message. This message indicates that TReK has determined that the POIC status indicates that the Mission Control Center Houston (MCCH) is disabled for commanding. The request for uplink was never sent to the POIC from TReK.
 
#define CMD_API_POIC_DISABLED   14004
 This error can occur for POIC destinations that are of the blocking type if destination checking is being performed on the User Enabled parameter that is included in the POIC Command System Status Message. This message indicates that TReK has determined that the POIC status indicates that the POIC is disabled for commanding. The request for uplink was never sent to the POIC from TReK.
 
#define CMD_API_REMOTE_USERS_DISABLED   14005
 This error can occur for POIC destinations that are of the blocking type if destination checking is being performed on the User Enabled parameter that is included in the POIC Command System Status Message. This message indicates that TReK has determined that the POIC status indicates that all remote users are disabled from commanding. The request for uplink was never sent to the POIC from TReK.
 
#define CMD_API_MCCH_HAS_LOS   14006
 This error can occur for POIC destinations that are of the blocking type if destination checking is being performed on the User Enabled parameter that is included in the POIC Command System Status Message. This message indicates that TReK has determined that the POIC status indicates that the Mission Control Center Houston (MCCH) is in LOS. The request for uplink was never sent to the POIC from TReK.
 
#define CMD_API_INVALID_COMMAND_MNEMONIC   14007
 This error can occur for POIC destinations that are of the blocking type if destination checking is being performed on the User Enabled parameter that is included in the POIC Command System Status Message. This message indicates that TReK has determined that the command mnemonic supplied does not exist. The request was never sent from TReK.
 
#define CMD_API_DESTINATION_NOT_FOUND   14008
 This message indicates that the specified destination does not exist. The destination may have been added to Command Processing, but not activated.
 
#define CMD_API_COMMAND_NOT_FOUND   14009
 This message indicates that the specified command mnemonic does not exist for the destination.
 
#define CMD_API_HEADER_NOT_FOUND   14010
 This message indicates that the specified header mnemonic does not exist for the destination.
 
#define CMD_API_FIELD_NOT_FOUND   14011
 This message indicates that the specified field is not part of the header or command for this destination.
 
#define CMD_API_FIELD_NOT_MODIFIABLE   14012
 This message indicates that the specified field exists, but is not modifiable.
 
#define CMD_API_ILLEGAL_FIELD_TYPE   14013
 You have specified an illegal field type. The two valid field types are COMMAND_FIELD and HEADER_FIELD.
 
#define CMD_API_NOT_ENOUGH_SPACE   14014
 The space you have allocated is insufficient to hold the returned data.
 
#define CMD_API_INCORRECT_DATATYPE   14015
 The data type you have chosen does not match the field�s data type.
 
#define CMD_API_NO_INITIAL_DATA   14016
 The modifiable field has no initial value.
 
#define CMD_API_INVALID_API_RETURN_CODE   14017
 The error_code is not a known return value for the Command API library. String value still set.
 
#define CMD_API_VALUE_LESS_THAN_LOW_RANGE   14018
 New value for update is too small.
 
#define CMD_API_VALUE_GREATER_THAN_HIGH_RANGE   14019
 New value for update is too large.
 
#define CMD_API_USER_CLEARED_BLOCK   14020
 Function returned due to user forcing the destination to unblock. This error only occurs for blocking destinations. The user is advised to proceed with caution, as the interface may not behave properly.
 
#define CMD_API_INCOMPLETE_COMMAND   14021
 One or more fields for the command do not have a value.
 
#define CMD_API_INCOMPLETE_HEADER   14022
 One or more fields for the header do not have a value.
 
#define CMD_API_NO_DATA_IN_FIELD   14023
 Returned from the Get�Field functions when no data is stored in the field. Use an Update�Field function.
 
#define CMD_API_WAIT_TIMEOUT   14024
 A timeout occurred while waiting for the data. If subsequent calls to API functions return this value, the problem should be reported to the help desk. It may be necessary to delete the destination and add it back.
 
#define CMD_API_EXPECTED_STRING_DATA_TYPE   14025
 Returned when the incorrect function is used to update a field value. Return code indicates you should use UpdateStringFieldValue.
 
#define CMD_API_EXPECTED_NUMERIC_DATA_TYPE   14026
 Returned when the incorrect function is used to update a field value. Return code indicates you should use UpdateNumericFieldValue.
 
#define CMD_API_EXPECTED_BINARY_DATA_TYPE   14027
 Returned when the incorrect function is used to update a field value. Return code indicates you should use UpdateBinaryFieldValue.
 
#define CMD_API_ILLEGAL_DESTINATION_TYPE   14028
 Returned when a function is not allowed for the destination type. For example, you cannot call UplinkPOICCommand for a Suitcase Simulator destination.
 
#define CMD_API_PREDEFINED_COMMAND   14029
 Returned from UpdateDestinationDatabase when the specified command has no modifiable fields.
 
#define CMD_API_MNEMONIC_LENGTH_ERROR   14030
 The mnemonic must be less than or equal to twenty characters.
 
#define CMD_API_DATA_TYPE_IS_STRING   14031
 Returned when the incorrect function is used to get a field�s value. Return code indicates you should use GetStringFieldValue.
 
#define CMD_API_DATA_TYPE_IS_BINARY   14032
 Returned when the incorrect function is used to get a field�s value. Return code indicates you should use GetBinaryFieldValue.
 
#define CMD_API_DATA_TYPE_IS_NUMERIC   14033
 Returned when the incorrect function is used to get a field�s value. Return code indicates you should use GetNumericFieldValue.
 
#define CMD_API_COMMAND_FIELD_TOO_LONG   14034
 The option to always add a NULL terminating character is turned on and the length of one or more string fields in the command do not have room for the NULL character. See the message area in Command Processing for the field name.
 
#define CMD_API_HEADER_FIELD_TOO_LONG   14035
 The option to always add a NULL terminating character is turned on and the length of one or more string fields in the header do not have room for the NULL character. See the message area in Command Processing for the field name.
 
#define CMD_API_CALIBRATION_ERROR   14036
 A calibration error occurred while building the command. For example, the value set for a field does not match a valid state code. See the message area in Command Processing for the field name.
 
#define CMD_API_CALIBRATED_VALUE_ERROR   14037
 The calibrated value will not fit in the required field. For example, the calibrated value is �1 and the uplink data type is IUNS (unsigned integer). See the message area in Command Processing for the field name.
 
#define CMD_API_VALUE_ERROR   14038
 The value will not fit in the required field. See the message area in Command Processing for the field name.
 
#define CMD_API_NUMBER_RETRIES_TOO_LARGE   14039
 The number of retries is larger than what is allowed by the Command System Configuration Message.
 
#define CMD_API_NUMBER_RETRIES_TOO_SMALL   14040
 The number of retries must be greater than or equal to zero.
 
#define CMD_API_INVALID_DESTINATION_NAME   14041
 Returned if the destination name specified exceeds the maximum length for a destination name (24 characters).
 
#define CMD_API_THREAD_LOCAL_STORAGE_ERROR   14042
 The API could not create the necessary memory for thread storage. If you see this error, please contact the TReK help desk.
 
#define CMD_API_INITIALIZATION_ERROR   14043
 The API could not initialize the needed resources. If you see this error, please contact the TReK help desk.
 
#define CMD_API_WAIT_FAILED   14044
 The API failed while waiting for TReK to return data. If you see this error, please contact the TReK help desk.
 
#define CMD_API_WAIT_ABANDONED   14045
 The API abandoned waiting for TReK to return data. If you see this error, please contact the TReK help desk.
 
#define CMD_API_ERROR_ATTACHING_THREAD   14046
 The API could not attach the thread resources. If you see this error, please contact the TReK help desk.
 
#define CMD_API_FSV1_SEQ_ERROR   14201
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CHECKSUM_FAIL   14202
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_INVALID_APID   14203
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.

 
#define CMD_API_FSV1_TIME_AUTHENTICATION_FAILURE   14205
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_TIME_TAG_ERROR_FUTURE   14206
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_TIME_TAG_ERROR_PAST   14207
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_TIME_TAG_ERROR_QUEUE_FULL   14208
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_TIME_TAG_ERROR_DUPLICATE_CMD   14209
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_INVALID_STATION_MODE   14210
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CMD_ROUTING_QUEUE_FULL   14211
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_APPLICATION_QUEUE_FULL   14213
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_INVALID_DUMP_ADDRESS   14214
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CMD_ROUTING_ERROR   14215
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CMD_INHIBITED   14251
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_ILLEGAL_CMD_CODE   14252
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CMD_PARAMETER_ERROR   14253
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_IMPROPER_CMD_SEQ   14254
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CMD_FUNCTION_NOT_AVAILABLE   14261
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_INCOMPATIBLE_OPERATION_STATE   14262
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CMD_DEVICE_OR_PROCESS_BUSY   14263
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CMD_ORU_UNAVAILABLE   14264
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_CMD_ORU_FAILED   14265
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_DETAIL_UNKNOWN_ERROR   14299
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV1_INVALID_COMPONENT   14302
 Return Code defined in SSP 41154 Appendix E.
 
#define CMD_API_FSV1_INVALID_IN_CURRENT_STATE   14303
 Return Code defined in SSP 41154 Appendix E.
 
#define CMD_API_FAILED_TO_SEND_PACKET   14401
 This message indicates that TReK was unable to send the command to the destination. TReK may no longer be connected to the destination.
 
#define CMD_API_INTERNAL_FILE_ERROR   14402
 This message indicates that TReK is unable to interpret the data values for the command fields in the TReK command database.
 
#define CMD_API_UNKNOWN_REQUEST   14403
 This message indicates that TReK is unable to determine how to build the command (e.g., pass thru the command, build only the header or build the entire command).
 
#define CMD_API_DATA_DOES_NOT_EXIST   14404
 This message indicates that TReK is not configured to send commands to this destination.
 
#define CMD_API_FAILED_TO_BUILD_HEADER   14405
 This message indicates that TReK was unable to build the command packet�s header as defined in the database. Possible explanations are a command field length mismatch between the database field definition and the database field value or no database field definition or data value.
 
#define CMD_API_FAILED_TO_BUILD_COMMAND   14406
 This message indicates that TReK was unable to build the command packet as defined in the database. Possible explanations are a command field length mismatch between the database field definition and the database field value or no database field definition or data value.
 
#define CMD_API_BUILD_INFO_DOES_NOT_EXIST   14407
 This message indicates that TReK is not configured to send commands to this destination.
 
#define CMD_API_NETWORK_TIMEOUT   14408
 This message indicates that TReK is not able to communicate with the socket that sends the command. The most likely explanation is the socket is busy receiving command responses from the command destination.
 
#define CMD_API_DATA_UNINITIALIZED   14409
 This message indicates that TReK is not configured to send commands to this destination.
 
#define CMD_API_ERROR_BUILDING_PROTOCOL   14410
 This message indicates that TReK was not able to properly build the EHS primary header or secondary header or checksum for the command packet.
 
#define CMD_API_UNDEFINED_NETWORK_PROTOCOL   14411
 This message indicates that TReK is not configured to send commands to this destination.
 
#define CMD_API_HEADER_NOT_ON_WORD_BOUNDARY   14412
 This message indicates that TReK did not properly build the command packet�s header. Possible explanations are an incorrect database field definition or incorrect database field value.
 
#define CMD_API_COMMAND_NOT_ON_WORD_BOUNDARY   14413
 This message indicates that TReK did not properly build the command packet. Possible explanations are an incorrect database field definition or incorrect database field value.
 
#define CMD_API_UNKNOWN_INTERNAL_ERROR   14414
 This message indicates that TReK did not send the command for an unknown reason. Please contact the TReK Help Desk for further assistance.
 
#define CMD_API_TRR_MSG_TYPE_NOT_ALLOWED   14102
 Unknown message type received. Contact TReK help desk.
 
#define CMD_API_TRR_MSG_SUB_TYPE_NOT_ALLOWED   14103
 Unknown message subtype received. Contact TReK help desk.
 
#define CMD_API_TRR_ERROR_SENDING_TO_DECOM   14104
 Message could not be built. Contact TReK help desk.
 
#define CMD_API_TRR_USER_VALIDATION_ERROR_FOUND   14105
 User provided validation software found error in the uplink pattern. A detailed error code can be seen in the real time command data viewer.
 
#define CMD_API_TRR_USER_VALIDATION_TIMEOUT   14106
 The user provided validation software did not return a status in the allotted time.
 
#define CMD_API_TRR_REQUEST_QUEUED   14107
 The command request has been queued on the command node. An additional TRR message will be sent when the command is being processed.
 
#define CMD_API_TRR_REQUEST_TIMEOUT   14108
 Command request timed out. Command was rejected.
 
#define CMD_API_TRR_UPLINK_USER_NOT_ALLOWED   14109
 The UplinkUserCommand, UplinkUserCommandVB, AddHeaderAndUplink, and AddHeaderAndUplinkVB functions are not allowed by the command node.
 
#define CMD_API_TRR_UPLINK_TREK_NOT_ALLOWED   14110
 The UplinkTReKCommand function is not allowed by the command node.
 
#define CMD_API_TRR_UPLINK_POIC_NOT_ALLOWED   14111
 The UplinkPOICCommand function is not allowed by the command node.
 
#define CMD_API_TRR_UPDATE_POIC_NOT_ALLOWED   14112
 The UpdatePOICCommand function is not allowed by the command node.
 
#define CMD_API_TRR_UPDATE_CMD_NODE_NOT_ALLOWED   14113
 The UpdateCommandNode function is not allowed by the command node.
 
#define CMD_API_TRR_CHECKSUM_ERROR   14114
 A checksum error was found in the request. Try resending the command.
 
#define CMD_API_TRR_INTERNAL_TREK_ERROR   14115
 Internal TReK error when trying to send request. See real time command data viewer for a detailed error code.
 
#define CMD_API_TRR_REMOTE_COMMANDING_DISABLED   14116
 Remote commanding is disabled at the command node.
 
#define CMD_API_TRR_EXTRACTION_FAILURE   14117
 Internal TReK error extracting information from the request. Contact TReK help desk.
 
#define CMD_API_TRR_CRITICAL_CMD_ACK_FAILURE   14118
 Failure to acknowledge critical command.
 
#define CMD_API_TRR_USER_NOT_AUTH_FOR_CMD   14131
 This command is not allowed to be updated or uplinked by the user.
 
#define CMD_API_TRR_USER_DISABLED   14135
 The user is disabled by the command node.
 
#define CMD_API_TRR_INCOMPLETE_COMMAND   14145
 The command could not be built because one or more of the fields do not have a value.
 
#define CMD_API_TRR_INVALID_COMMAND_MNEMONIC   14160
 The command was not found at the command node.
 
#define CMD_API_TRR_INVALID_COMMAND_FIELD_LENGTH   14162
 A value will not fit into a command field. Most likely occurs when a NULL termination character could not be set for a string value.
 
#define CMD_API_TRR_CALIBRATED_VALUE_ERROR   14163
 Calibrated value will not fit into the command field.
 
#define CMD_API_TRR_CONVERTED_VALUE_ERROR   14164
 Converted value will not fit into the command field.
 
#define CMD_API_TRR_CALIBRATION_ERROR   14165
 Error calibrating a field value.
 
#define CMD_API_TRR_UNKNOWN_ERROR_BUILDING_COMMAND   14166
 Unable to build a command field.
 
#define CMD_API_TRR_INVALID_HEADER_MNEMONIC   14170
 Header identified by command node could not be found.
 
#define CMD_API_TRR_INCOMPLETE_HEADER   14171
 The header for the command could not be built because one or more of the fields do not have a value.
 
#define CMD_API_TRR_INVALID_HEADER_FIELD_LENGTH   14172
 A value will not fit into a header field. Most likely occurs when a NULL termination character could not be set for a string value.
 
#define CMD_API_TRR_UNKNOWN_ERROR_BUILDING_HEADER   14176
 Unable to build the header for the command.
 
#define CMD_API_TRR_UNKNOWN_ERROR   14199
 Unknown TRR error returned.
 
#define CMD_API_UPD_ERROR_ILLEGAL_SRC_MSG_KEY   14502
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_ILLEGAL_ACTIVITY   14504
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_INVALID_MSG_LENGTH   14508
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_INVALID_MSG_SUBTYPE   14510
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_MSG_TYPE_USER_DATA_MISMATCH   14511
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_INVALID_TIME   14513
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_MSG_CHECKSUM_ERROR   14514
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_USER_NOT_AUTH_FOR_CMD   14531
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_MSG_SEQ_CNT_ERROR   14539
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_CMD_DB_ACCESS_ERROR   14544
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_INTERNAL_EHS_ERROR   14547
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_PARSE_ERROR   14564
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_UPDATE_FIELD_FAILURE   14566
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_EXTRACTING_UPDATE_INFO   14581
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_UPDATE_POIC_NOT_ALLOWED   14582
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_UPDATE_TREK_NOT_ALLOWED   14583
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_REMOTE_COMMANDING_DISABLED   14584
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_USER_DISABLED   14585
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_SENDING_REQUEST   14586
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_MISSING_FIELD   14587
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_NON_MODIFIABLE_FIELD   14588
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_CMD_NOT_FOUND   14589
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_BAD_FORMAT   14590
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_PARTIAL_UPDATE   14591
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_UPD_ERROR_UNKNOWN_ERROR   14599
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_ILLEGAL_SRC_MSG_KEY   14602
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_ILLEGAL_ACTIVITY   14604
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_INVALID_MSG_LENGTH   14608
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_INVALID_MSG_TYPE   14609
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_INVALID_MSG_SUBTYPE   14610
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_MSG_TYPE_USER_DATA_MISMATCH   14611
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_INVALID_TIME   14613
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_MSG_CHECKSUM_ERROR   14614
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_CCSDS_CMD_CHECKSUM_ERROR   14618
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_USER_NOT_AUTH_FOR_CMD   14631
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_CMD_DOES_NOT_MATCH_MNEMONIC   14632
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_INVALID_PKT_SIZE   14633
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_EHS_DISABLED   14634
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_USER_DISABLED   14635
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_CMD_DISABLED   14636
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_ILLEGAL_STATION_MODE   14637
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_UNSUPPORTED_CMD_PATH   14638
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_MSG_SEQ_CNT_ERROR   14639
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_EHS_UPLINK_QUEUE_FULL   14641
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_ERROR_ADDING_TO_EHS_QUEUE   14642
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_NOT_CLEAR_TO_SEND   14643
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_CMD_DB_ACCESS_ERROR   14644
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_CMD_INCOMPLETE   14645
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_CMD_ABORTED_BY_USER   14646
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_INTERNAL_EHS_ERROR   14647
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_ERR_UNKNOWN_ERROR   14699
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_ILLEGAL_SRC_MSG_KEY   14702
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_ILLEGAL_APID   14703
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_ILLEGAL_ACTIVITY   14704
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_SOURCE   14705
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_DESTINATION   14706
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_PKT_SEQ_CNT_ERROR   14707
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_MSG_LENGTH   14708
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_MSG_TYPE   14709
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_MSG_SUBTYPE   14710
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_MSG_TYPE_USER_DATA_MISMATCH   14711
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_USER_DATA_FORMAT   14712
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_TIME   14713
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_MSG_CHECKSUM_ERROR   14714
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_SRC_CMD_SYSTEM_DISABLED   14715
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_MCCH_DISABLED   14716
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_MCCH_UPLINK_QUEUE_FULL   14717
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_CCSDS_CMD_CHECKSUM_ERROR   14718
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_CCSDS_SBAND_PKT_SIZE   14719
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_CCSDS_ECOMM_PKT_SIZE   14720
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_ILLEGAL_CODE_IN_TIME_ID_FIELD   14721
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_ILLEGAL_CCSDS_PKT_TYPE   14722
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_SEC_HDR_FLAG   14723
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_CCSDS_PKT_LENGTH   14724
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_ILLEGAL_ELEMENT_ID   14725
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_ELEMENT_ID   14726
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_FILE_TRANSFER_ABORTED   14727
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_INVALID_FILE_TRANSFER_PATH   14728
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_CAR1_UNKNOWN_ERROR   14799
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_SEQ_ERROR   14801
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CHECKSUM_FAIL   14802
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_INVALID_APID   14803
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_TIME_AUTHENTICATION_FAILURE   14805
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_TIME_TAG_ERROR_FUTURE   14806
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_TIME_TAG_ERROR_PAST   14807
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_TIME_TAG_ERROR_QUEUE_FULL   14808
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_TIME_TAG_ERROR_DUPLICATE_CMD   14809
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_INVALID_STATION_MODE   14810
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CMD_ROUTING_QUEUE_FULL   14811
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_APPLICATION_QUEUE_FULL   14813
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_INVALID_DUMP_ADDRESS   14814
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CMD_ROUTING_ERROR   14815
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CMD_INHIBITED   14851
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_ILLEGAL_CMD_CODE   14852
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CMD_PARAMETER_ERROR   14853
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_IMPROPER_CMD_SEQ   14854
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CMD_FUNCTION_NOT_AVAILABLE   14861
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_INCOMPATIBLE_OPERATION_STATE   14862
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CMD_DEVICE_OR_PROCESS_BUSY   14863
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CMD_ORU_UNAVAILABLE   14864
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_CMD_ORU_FAILED   14865
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_UNKNOWN_ERROR   14899
 Return Code defined in command section of PGUIDD (Volume 2). Last two digits of error code correspond to PGUIDD error code number.
 
#define CMD_API_FSV2_INVALID_COMPONENT   14902
 Return Code defined in SSP 41154 Appendix E.
 
#define CMD_API_FSV2_INVALID_IN_CURRENT_STATE   14903
 Return Code defined in SSP 41154 Appendix E.
 
#define CMD_API_CAR2_UPLINK_ERROR   14952
 Return Code defined in command section of PGUIDD (Volume 2). Last digit of error code corresponds to PGUIDD error code number.
 
#define CMD_API_CAR2_UNKNOWN_ERROR   14959
 Return Code defined in command section of PGUIDD (Volume 2). Last digit of error code corresponds to PGUIDD error code number.
 
#define CMD_API_FSV1_US_SEGMENT_ERROR   14962
 Return Code defined in command section of PGUIDD (Volume 2). Last digit of error code corresponds to PGUIDD error code number.
 
#define CMD_API_FSV1_US_SEGMENT_CMD_NOT_RECEIVED   14963
 Return Code defined in command section of PGUIDD (Volume 2). Last digit of error code corresponds to PGUIDD error code number.
 
#define CMD_API_FSV1_MCCH_UNABLE_TO_TRACK_CMD   14964
 Return Code defined in command section of PGUIDD (Volume 2). Last digit of error code corresponds to PGUIDD error code number.
 
#define CMD_API_FSV1_UNKNOWN_ERROR   14969
 Return Code defined in command section of PGUIDD (Volume 2). Last digit of error code corresponds to PGUIDD error code number.
 
#define CMD_API_CRR_UNSUCCESSFUL   14972
 Return Code defined in command section of PGUIDD (Volume 2). Last digit of error code corresponds to PGUIDD error code number.
 
#define CMD_API_CRR_UNKNOWN_ERROR   14979
 Return Code defined in command section of PGUIDD (Volume 2). Last digit of error code corresponds to PGUIDD error code number.
 

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...
 

Detailed Description

Defines the Release 3 Compatible Command API.

Function Documentation

◆ AddHeaderAndUplinkCommand()

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.

Note
This is a TReK Release 3 ANSI-C compatible function. The Command GUI can be used to set a flag to allow TReK to behave the same as TReK 3.x with respect to the AddHeaderAndUplinkCommand() function. In TReK 3.x this function required two extra bytes for the checksum. TReK 5.x no longer requires those bytes. The new flag (available on the Preferences dialog in the Command GUI) when turned on will remove those two extra bytes to mimic the TReK 3.x behavior. This will also change the TReK 5.x behavior for the InsertDataAndUplinkCommand() method of the CommandApi class. It should only be used if you are exclusively using the Release 3 compatible API.
Parameters
[in]dest_name_ptrThe name of the destination to send the command.
[in]cmd_name_ptrThe name of the command to request for uplink.
[in]header_name_ptrThe name of the header to build. This input is not used, but still must be supplied (an empty string is ok).
[in]cmd_data_ptrThe bit pattern for the command data.
[in]len_of_cmd_dataThe length of the command data bit pattern in bytes.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_INVALID_LENGTH
CMD_API_USER_DISABLED
CMD_API_MCCH_DISABLED
CMD_API_POIC_DISABLED
CMD_API_REMOTE_USERS_DISABLED
CMD_API_MCCH_HAS_LOS
CMD_API_INVALID_COMMAND_MNEMONIC
CMD_API_INCOMPLETE_HEADER
CMD_API_HEADER_FIELD_TOO_LONG
CMD_API_MNEMONIC_LENGTH_ERROR
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
unsigned char cmd_data[30]; // 30 bytes of command data
// For this example set all data to 0 except first 4 bytes.
memset( cmd_data, 0, 30 );
cmd_data[0] = 0x4A;
cmd_data[1] = 0x65;
cmd_data[2] = 0x66;
cmd_data[3] = 0x66;
return_value = AddHeaderAndUplinkCommand( "my_poic",
"user_command",
"the_header",
cmd_data,
30 );
if( return_value == SUCCESS )
printf( "Command uplinked\n" );
else
printf( "Command uplink error %d\n", return_value );
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 associa...
Definition: trek_cmd_user_api.cpp:320
Command codes for TReK.
#define SUCCESS
The function completed successfully.
Definition: trek_error.h:8

◆ AddHeaderAndUplinkCommandVB()

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.

Note
This is a TReK Release 3 ANSI-C compatible function. The Command GUI can be used to set a flag to allow TReK to behave the same as TReK 3.x with respect to the AddHeaderAndUplinkCommandVB() function. In TReK 3.x this function required two extra bytes for the checksum. TReK 5.x no longer requires those bytes. The new flag (available on the Preferences dialog in the Command GUI) when turned on will remove those two extra bytes to mimic the TReK 3.x behavior. This will also change the TReK 5.x behavior for the InsertDataAndUplinkCommand() method of the CommandApi class. It should only be used if you are exclusively using the Release 3 compatible API.
Parameters
[in]dest_name_ptrThe name of the destination to send the command.
[in]cmd_name_ptrThe name of the command to request for uplink.
[in]header_name_ptrThe name of the header to build. This input is not used, but still must be supplied (an empty string is ok).
[in]cmd_data_ptrThe bit pattern for the command data.
[in]len_of_cmd_dataThe length of the command data bit pattern in bytes.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_INVALID_LENGTH
CMD_API_USER_DISABLED
CMD_API_MCCH_DISABLED
CMD_API_POIC_DISABLED
CMD_API_REMOTE_USERS_DISABLED
CMD_API_MCCH_HAS_LOS
CMD_API_INVALID_COMMAND_MNEMONIC
CMD_API_INCOMPLETE_HEADER
CMD_API_HEADER_FIELD_TOO_LONG
CMD_API_MNEMONIC_LENGTH_ERROR
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

Dim lCode As Long
Dim lReturnValue As Long
Dim sAPIReturnString As String
Dim bCommandData(27) As Byte
Dim iCounter As Integer
'***** Allocate memory for the return string.
sAPIReturnString = String$(70, 0)
'***** Set values for the command data.
bCommandData(0) = 2
bCommandData(1) = 2
For iCounter = 2 To 27
bCommandData(iCounter) = 0
Next iCounter
'***** Use the function.
lReturnValue = AddHeaderAndUplinkCommandVB("POIC", _
"BIG_MOD_CMD", _
"HEADER01", _
bCommandData(0), _
28)
'***** Use the function to get the return code.
lCode = GetCommandAPIReturnCodeAsString(lReturnValue, _
70, _
sAPIReturnString)
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 associa...
Definition: trek_cmd_user_api.cpp:552
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 val...
Definition: trek_cmd_user_api.cpp:2279

◆ BuildAndUplinkCommand()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]dest_name_ptrThe name of the destination to send the command. This destination must be a POIC type destination.
[in]cmd_name_ptrThe name of the command to build for uplink.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_USER_DISABLED
CMD_API_MCCH_DISABLED
CMD_API_POIC_DISABLED
CMD_API_REMOTE_USERS_DISABLED
CMD_API_MCCH_HAS_LOS
CMD_API_INVALID_COMMAND_MNEMONIC
CMD_API_INCOMPLETE_COMMAND
CMD_API_INCOMPLETE_HEADER
CMD_API_MNEMONIC_LENGTH_ERROR
CMD_API_COMMAND_FIELD_TOO_LONG
CMD_API_HEADER_FIELD_TOO_LONG
CMD_API_CALIBRATION_ERROR
CMD_API_CALIBRATED_VALUE_ERROR
CMD_API_VALUE_ERROR
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
return_value = BuildAndUplinkCommand( "my_poic", "my_command" );
if( return_value == SUCCESS )
printf( "Command built and uplinked\n" );
else
printf( "Command uplink error %d\n", return_value );
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 ...
Definition: trek_cmd_user_api.cpp:393
Examples
cmd_api_r3/cmd_api_r3_main.c.

◆ GetBinaryFieldValue()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]field_typeEither COMMAND_FIELD or HEADER_FIELD.
[in]dest_name_ptrThe name of the destination to get the command or header.
[in]mnemonic_ptrThe name of the command or header.
[in]field_name_ptrThe name of the field to retrieve the current value for.
[in]size_of_data_ptrThe size of data allocated by the calling program in bytes. You must specify enough space for the data to be copied.
[out]value_ptrThe returned value for the command or header field.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_ILLEGAL_FIELD_TYPE
CMD_API_DESTINATION_NOT_FOUND
CMD_API_COMMAND_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_FIELD_NOT_FOUND
CMD_API_DATA_TYPE_IS_STRING
CMD_API_DATA_TYPE_IS_NUMERIC
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
unsigned char value[10];
long size_of_data;
// get a command field value
size_of_data = 10;
return_value = GetBinaryFieldValue(
COMMAND_FIELD,
"my_poic",
"my_command",
"field1",
&size_of_data,
value );
if( return_value != SUCCESS )
printf( "Error retrieving value: %d\n", return_value );
// now get a header field value
size_of_data = 10;
return_value = GetBinaryFieldValue(
HEADER_FIELD,
"my_poic",
"my_header",
"field4",
&size_of_data,
value );
if( return_value != SUCCESS )
printf( "Error retrieving value: %d\n", return_value );
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.
Definition: trek_cmd_user_api.cpp:1699

◆ GetCommandAPIReturnCodeAsString()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]error_codeReturned from a call to another TReK Command API function.
[in]size_of_dataThe size of data allocated. Should be at least 70 bytes.
[out]message_ptrThe returned message string.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_NOT_ENOUGH_SPACE
CMD_API_INVALID_API_RETURN_CODE
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int update_return;
int return_code;
unsigned char value1[2];
unsigned char value2[4];
char message[70];
// update a command field
value1[0] = 0x02;
value1[1] = 0x3f;
update_return = UpdateBinaryFieldValue(
COMMAND_FIELD,
"my_poic",
"my_command",
"field1",
value1,
2 );
if( update_return == SUCCESS )
printf( "Command field updated\n" );
else
printf( "Update return error %d\n", update_return );
// now print the return code
update_return,
70,
message );
if( return_code == SUCCESS )
printf( "Message is: %s\n", message );
else
printf( "Error %d\n", return_code );
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.
Definition: trek_cmd_user_api.cpp:1026

◆ GetNumericFieldValue()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]field_typeEither COMMAND_FIELD or HEADER_FIELD.
[in]dest_name_ptrThe name of the destination to get the command or header.
[in]mnemonic_ptrThe name of the command or header.
[in]field_name_ptrThe name of the field to retrieve the current value for.
[out]value_ptrThe returned value for the command or header field.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_ILLEGAL_FIELD_TYPE
CMD_API_DESTINATION_NOT_FOUND
CMD_API_COMMAND_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_FIELD_NOT_FOUND
CMD_API_DATA_TYPE_IS_BINARY
CMD_API_DATA_TYPE_IS_STRING
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
double value;
// get a command field value
return_value = GetNumericFieldValue(
COMMAND_FIELD,
"my_poic",
"my_command",
"field1",
&value );
if( return_value == SUCCESS )
printf( "Command field value is %lf\n", value );
else
printf( "Error retrieving value: %d\n", return_value );
// now get a header field value
return_value = GetNumericFieldValue(
HEADER_FIELD,
"my_poic",
"my_header",
"field4",
&value );
if( return_value == SUCCESS )
printf( "Header field value is %lf\n", value );
else
printf( "Error retrieving value: %d\n", return_value );
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.
Definition: trek_cmd_user_api.cpp:1390
Examples
cmd_api_r3/cmd_api_r3_main.c.

◆ GetPOICCommandSystemConfiguration()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]dest_name_ptrThe name of the destination. This destination must be a POIC type destination.
[out]config_ptrA structure defined in trek_cmd_user_api.h. You must have allocated memory for this variable before calling the function.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_ILLEGAL_DESTINATION_TYPE
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
POIC_Command_System_Configuration config;
"my_poic",
&config );
if( return_value == SUCCESS )
printf( "Got configuration\n" );
else
printf( "Error %d\n", return_value );
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....
Definition: trek_cmd_user_api.cpp:1832

◆ GetPOICCommandSystemStatus()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]dest_name_ptrThe name of the destination. This destination must be a POIC type destination.
[out]status_ptrA structure defined in trek_cmd_user_api.h. You must have allocated memory for this variable before calling the function.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_ILLEGAL_DESTINATION_TYPE
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
POIC_Command_System_Status status;
"my_poic",
&status );
if( return_value == SUCCESS )
printf( "Got status\n" );
else
printf( "Error %d\n", return_value );
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 al...
Definition: trek_cmd_user_api.cpp:2016
Examples
cmd_api_r3/cmd_api_r3_main.c.

◆ GetStringFieldValue()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]field_typeEither COMMAND_FIELD or HEADER_FIELD.
[in]dest_name_ptrThe name of the destination to get the command or header.
[in]mnemonic_ptrThe name of the command or header.
[in]field_name_ptrThe name of the field to retrieve the current value for.
[in]size_of_data_ptrThe size of data allocated by the calling program in bytes. You must specify enough space for the data to be copied.
[out]value_ptrThe returned value for the command or header field.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_ILLEGAL_FIELD_TYPE
CMD_API_DESTINATION_NOT_FOUND
CMD_API_COMMAND_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_FIELD_NOT_FOUND
CMD_API_DATA_TYPE_IS_BINARY
CMD_API_DATA_TYPE_IS_NUMERIC
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
char value[10];
long size_of_data;
// get a command field value
size_of_data = 10;
return_value = GetStringFieldValue(
COMMAND_FIELD,
"my_poic",
"my_command",
"field1",
&size_of_data,
value );
if( return_value == SUCCESS )
printf( "Command field value is %s\n", value );
else
printf( "Error retrieving value: %d\n", return_value );
// now get a header field value
size_of_data = 10;
return_value = GetStringFieldValue(
HEADER_FIELD,
"my_poic",
"my_header",
"field4",
&size_of_data,
value );
if( return_value == SUCCESS )
printf( "Header field value is %s\n", value );
else
printf( "Error retrieving value: %d\n", return_value );
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.
Definition: trek_cmd_user_api.cpp:1546

◆ SetNumberOfRetries()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]dest_name_ptrThe name of the destination to change the number of retries.
[in]num_retriesNew number of retries.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_ILLEGAL_DESTINATION_TYPE
CMD_API_NUMBER_RETRIES_TOO_LARGE
CMD_API_NUMBER_RETRIES_TOO_SMALL
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
return_value = SetNumberOfRetries( "my_poic", 2 );
if( return_value == SUCCESS )
printf( "Number of retries set successfully\n" );
else
printf( "Error %d\n", return_value );
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...
Definition: trek_cmd_user_api.cpp:3126

◆ UnblockDestination()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]dest_name_ptrThe name of the destination to unblock.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
// update command in destination database
return_value = UnblockDestination( "my_poic" );
if( return_value == SUCCESS )
printf( "Command updated in destination database\n" );
else
printf( "Update error %d\n", return_value );
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" messa...
Definition: trek_cmd_user_api.cpp:3068

◆ UpdateBinaryFieldValue()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]field_typeEither COMMAND_FIELD or HEADER_FIELD.
[in]dest_name_ptrThe name of the destination to update the command or header.
[in]mnemonic_ptrThe name of the command or header.
[in]field_name_ptrThe name of the field to update.
[in]new_value_ptrNew binary data for field value.
[in]lengthThe number of bytes of data for new_value_ptr.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_ILLEGAL_FIELD_TYPE
CMD_API_DESTINATION_NOT_FOUND
CMD_API_COMMAND_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_FIELD_NOT_FOUND
CMD_API_FIELD_NOT_MODIFIABLE
CMD_API_EXPECTED_STRING_DATA_TYPE
CMD_API_EXPECTED_NUMERIC_DATA_TYPE
CMD_API_NOT_ENOUGH_SPACE
CMD_API_INVALID_LENGTH
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
unsigned char value1[2];
unsigned char value2[4];
// update a command field
value1[0] = 0x02;
value1[1] = 0x3f;
return_value = UpdateBinaryFieldValue(
COMMAND_FIELD,
"my_poic",
"my_command",
"field1",
value1,
2 );
if( return_value == SUCCESS )
printf( "Command field updated\n" );
else
printf( "Update error %d\n", return_value );
// now update a header field
value2[0] = 0x2d;
value2[1] = 0xff;
value2[2] = 0x9f;
value2[3] = 0x00;
return_value = UpdateBinaryFieldValue(
HEADER_FIELD,
"my_poic",
"my_header",
"field4",
value2,
4 );
if( return_value == SUCCESS )
printf( "Header field updated\n" );
else
printf( "Update error %d\n", return_value );

◆ UpdateBinaryFieldValueVB()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]field_typeEither COMMAND_FIELD or HEADER_FIELD.
[in]dest_name_ptrThe name of the destination to update the command or header.
[in]mnemonic_ptrThe name of the command or header.
[in]field_name_ptrThe name of the field to update.
[in]new_value_ptrNew binary data for field value.
[in]lengthThe number of bytes of data for new_value_ptr.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_ILLEGAL_FIELD_TYPE
CMD_API_DESTINATION_NOT_FOUND
CMD_API_COMMAND_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_FIELD_NOT_FOUND
CMD_API_FIELD_NOT_MODIFIABLE
CMD_API_INVALID_LENGTH
CMD_API_EXPECTED_STRING_DATA_TYPE
CMD_API_EXPECTED_NUMERIC_DATA_TYPE
CMD_API_NOT_ENOUGH_SPACE
CMD_API_INVALID_LENGTH
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

Dim lCode As Long
Dim lReturnValue As Long
Dim sAPIReturnString As String
Dim bByteArray(17) As Byte
Dim iCounter As Integer
'***** Allocate memory for the return string.
sAPIReturnString = String$(70, 0)
'***** Set value of byte array. Used to pass in the field value.
bByteArray(0) = 2
bByteArray(1) = 2
For iCounter = 2 To 17
bByteArray(iCounter) = 0
Next iCounter
'***** Use the function.
lReturnValue = UpdateBinaryFieldValueVB(0, _
"POIC", _
"CAMERA_MODE", _
"MODE", _
bByteArray(0), _
18)
'***** Use the function to get the return code.
lCode = GetCommandAPIReturnCodeAsString(lReturnValue, _
70, _
sAPIReturnString)
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.
Definition: trek_cmd_user_api.cpp:1237

◆ UpdateNumericFieldValue()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]field_typeEither COMMAND_FIELD or HEADER_FIELD.
[in]dest_name_ptrThe name of the destination to update the command or header.
[in]mnemonic_ptrThe name of the command or header.
[in]field_name_ptrThe name of the field to update.
[in]new_valueThe new value for the command or header field.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_ILLEGAL_FIELD_TYPE
CMD_API_DESTINATION_NOT_FOUND
CMD_API_COMMAND_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_FIELD_NOT_FOUND
CMD_API_FIELD_NOT_MODIFIABLE
CMD_API_EXPECTED_BINARY_DATA_TYPE
CMD_API_EXPECTED_STRING_DATA_TYPE
CMD_API_VALUE_LESS_THAN_LOW_RANGE
CMD_API_VALUE_GREATER_THAN_HIGH_RANGE
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
// update a command field
return_value = UpdateNumericFieldValue(
COMMAND_FIELD,
"my_poic",
"my_command",
"field1",
5.32 );
if( return_value == SUCCESS )
printf( "Command field updated\n" );
else
printf( "Update error %d\n", return_value );
// now update a header field
return_value = UpdateNumericFieldValue(
HEADER_FIELD,
"my_poic",
"my_header",
"field4",
6.0 );
if( return_value == SUCCESS )
printf( "Header field updated\n" );
else
printf( "Update error %d\n", return_value );
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 float...
Definition: trek_cmd_user_api.cpp:643
Examples
cmd_api_r3/cmd_api_r3_main.c.

◆ UpdatePOICDatabase()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]field_typeMust be COMMAND_FIELD
[in]dest_name_ptrThe name of the destination to update the command.
[in]mnemonic_ptrThe name of the command.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_ILLEGAL_FIELD_TYPE
CMD_API_MNEMONIC_LENGTH_ERROR
CMD_API_DESTINATION_NOT_FOUND
CMD_API_COMMAND_NOT_FOUND
CMD_API_ILLEGAL_DESTINATION_TYPE
CMD_API_INCOMPLETE_COMMAND
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
// update command in destination database
return_value = UpdatePOICDatabase(
COMMAND_FIELD,
"my_poic",
"my_command" );
if( return_value == SUCCESS )
printf( "Command updated in destination database\n" );
else
printf( "Update error %d\n", return_value );
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 datab...
Definition: trek_cmd_user_api.cpp:1294
Examples
cmd_api_r3/cmd_api_r3_main.c.

◆ UpdateStringFieldValue()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]field_typeEither COMMAND_FIELD or HEADER_FIELD.
[in]dest_name_ptrThe name of the destination to update the command or header.
[in]mnemonic_ptrThe name of the command or header.
[in]field_name_ptrThe name of the field to update.
[in]new_value_ptrNew NULL terminated string value for the command or header field.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_ILLEGAL_FIELD_TYPE
CMD_API_DESTINATION_NOT_FOUND
CMD_API_COMMAND_NOT_FOUND
CMD_API_HEADER_NOT_FOUND
CMD_API_FIELD_NOT_FOUND
CMD_API_FIELD_NOT_MODIFIABLE
CMD_API_EXPECTED_BINARY_DATA_TYPE
CMD_API_EXPECTED_NUMERIC_DATA_TYPE
CMD_API_NOT_ENOUGH_SPACE
CMD_API_INVALID_LENGTH
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
// update a command field
return_value = UpdateStringFieldValue(
COMMAND_FIELD,
"my_poic",
"my_command",
"field1",
"" );
if( return_value == SUCCESS )
printf( "Command field updated\n" );
else
printf( "Update error %d\n", return_value );
// now update a header field
return_value = UpdateStringFieldValue(
HEADER_FIELD,
"my_poic",
"my_header",
"field4",
"hello world" );
if( return_value == SUCCESS )
printf( "Header field updated\n" );
else
printf( "Update error %d\n", return_value );
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...
Definition: trek_cmd_user_api.cpp:825

◆ UplinkPOICCommand()

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).

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]dest_name_ptrThe name of the destination to send the command. This destination must be a POIC type destination.
[in]cmd_name_ptrThe name of the command to request for uplink.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_USER_DISABLED
CMD_API_MCCH_DISABLED
CMD_API_POIC_DISABLED
CMD_API_REMOTE_USERS_DISABLED
CMD_API_MCCH_HAS_LOS
CMD_API_INVALID_COMMAND_MNEMONIC
CMD_API_MNEMONIC_LENGTH_ERROR
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
return_value = UplinkPOICCommand( "my_poic", "my_command" );
if( return_value == SUCCESS )
printf( "Command uplinked\n" );
else
printf( "Command uplink error %d\n", return_value );
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...
Definition: trek_cmd_user_api.cpp:159
Examples
cmd_api_r3/cmd_api_r3_main.c.

◆ UplinkUserCommand()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]dest_name_ptrThe name of the destination to send the command.
[in]cmd_name_ptrThe name of the command to request for uplink.
[in]cmd_data_ptrThe entire bit pattern for the command. This includes any headers and checksum.
[in]len_of_cmd_dataThe length of the bit pattern to uplink in bytes.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_INVALID_LENGTH
CMD_API_USER_DISABLED
CMD_API_MCCH_DISABLED
CMD_API_POIC_DISABLED
CMD_API_REMOTE_USERS_DISABLED
CMD_API_MCCH_HAS_LOS
CMD_API_INVALID_COMMAND_MNEMONIC
CMD_API_MNEMONIC_LENGTH_ERROR
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

// Don't forget to include the following header files
#include "trek.h"
#include "trek_error.h"
int return_value;
unsigned char cmd_data[40]; // a 40-byte command
// For this example set all data to 0 except first 4 bytes.
memset( cmd_data, 0, 40 );
cmd_data[0] = 0x4A;
cmd_data[1] = 0x65;
cmd_data[2] = 0x66;
cmd_data[3] = 0x66;
return_value = UplinkUserCommand( "my_poic", "user_command", cmd_data, 40 );
if( return_value == SUCCESS )
printf( "Command uplinked\n" );
else
printf( "Command uplink error %d\n", return_value );
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.
Definition: trek_cmd_user_api.cpp:229

◆ UplinkUserCommandVB()

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.

Note
This is a TReK Release 3 ANSI-C compatible function.
Parameters
[in]dest_name_ptrThe name of the destination to send the command.
[in]cmd_name_ptrThe name of the command to request for uplink.
[in]cmd_data_ptrThe entire bit pattern for the command. This includes any headers and checksum.
[in]len_of_cmd_dataThe length of the bit pattern to uplink in bytes.
Returns
SUCCESS
CMD_API_NULL_POINTER
CMD_API_DESTINATION_NOT_FOUND
CMD_API_INVALID_LENGTH
CMD_API_USER_DISABLED
CMD_API_MCCH_DISABLED
CMD_API_POIC_DISABLED
CMD_API_REMOTE_USERS_DISABLED
CMD_API_MCCH_HAS_LOS
CMD_API_INVALID_COMMAND_MNEMONIC
CMD_API_MNEMONIC_LENGTH_ERROR
CMD_API_THREAD_LOCAL_STORAGE_ERROR
CMD_API_WAIT_FAILED
CMD_API_WAIT_ABANDONED
CMD_API_ERROR_ATTACHING_THREAD

Example:

Dim lCode As Long
Dim lReturnValue As Long
Dim sAPIReturnString As String
Dim bCommandData(47) As Byte
Dim iCounter As Integer
'***** Allocate memory for the return string.
sAPIReturnString = String$(70, 0)
'***** Set values for the command data.
bCommandData(0) = 2
bCommandData(1) = 2
For iCounter = 2 To 47
bCommandData(iCounter) = 0
Next iCounter
'***** Use the function.
lReturnValue = UplinkUserCommandVB("POIC", _
"ACCELERATE", _
bCommandData(0), _
48)
'***** Use the function to get the return code.
lCode = GetCommandAPIReturnCodeAsString(lReturnValue, _
70, _
sAPIReturnString)
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 specific...
Definition: trek_cmd_user_api.cpp:469