Functions | |
| char* | api_strerror (int api_errnum) |
| Get application error message string. | |
| void | api_perror (const char *s) |
| Print application error messages. | |
| void | ApiTermHandler (int signo) |
| Default termination handler for libapi. | |
| int | BuildAndSendLinkedDataPacket (const char *fd, void *raw_value, const char *channel) |
| Build and ship a linked data packet for a FD. | |
| char* | GetCmdMeas (const char *fd, int cmd_meas_num, char *cmd_meas_fd) |
| Extract a command's measurement parameter FD from the system during run-time. | |
| int | GetDesType (const char *fd) |
| Get the type of a specified descriptor. | |
| int | GetMeasData (const char *fd, meas_data_t *data) |
| Get a measurement's FD characteristics. | |
| int | GetMeasType (const char *fd) |
| Get the type of a specified measurement descriptor. | |
| char* | GetMeasUnit (const char *fd, char *unit) |
| Extract a measurement's engineering unit from the system during run-time. | |
| int | GetMeasValue (const char *fd, int format_type, void *value, int *status) |
| Get a measurement's current value and status from the system during run-time. | |
| int | GetNumCmdMeas (const char *fd) |
| Get the number of parameters associated with a command from the system during run-time. | |
| char* | GetProjectName (char *name) |
| Get the current project's ASCII name. | |
| int | IssueCmd (const char *fd, void *command_response_data,...) |
| Issue a parameterized command. | |
| int | IssueValue (const char *fd, int format_type, void *value, void *command_response_data) |
| Issue a command with value. | |
| int | SetMeasValue (const char *fd, int format_type, void *value) |
| Set a measurement's processed or raw value during run-time. | |
| int | SysInit (const char *prog_name, void(*fp)()) |
| User process initialization. | |
| void | SysQuit (void) |
| Clean up all system internals for the application. SysQuit() is an internal function used to detach the process from all system services. | |
Variables | |
| int | g_api_errno = 0 |
| Error number of the last application error message. | |
The C language User Application Programming Interface (API) for the Command and Control Toolkit (CCTK).
|
|
Default termination handler for libapi.
ApiTermHandler is the default termination handler for any process calling SysInit() with a NULL argument for the termination handler. It will call SysQuit() to clean up the system and then exit with the standard exit() command. As is standard with shells, the exit code will be the signal received plus 128.
|
|
|
Build and ship a linked data packet for a FD.
|
|
|
Extract a command's measurement parameter FD from the system during run-time.
|
|
|
Get the type of a specified descriptor.
The value is returned can be equated to one of the following defines declared in KTables.h:
Measurement Descriptors:
ANALOG_MEAS_DES_TYPE
BYTEARRAY_MEAS_DES_TYPE
DISCRETE_MEAS_DES_TYPE
SIGNED_INT_MEAS_DES_TYPE
UNSIGNED_INT_MEAS_DES_TYPE
Exception Descriptors:
ANA_EXCPT_DES_TYPE
BA_EXCPT_DES_TYPE
DIS_EXCPT_DES_TYPE
SIGNED_INT_EXCPT_DES_TYPE
UNSIGNED_INT_EXCPT_DES_TYPE
Conversion Descriptors:
POLY_CONV_DES_TYPE
PIECEWISE_CONV_DES_TYPE
SEG_LIST_INFO_TYPE
STATE_CONV_DES_TYPE
Linker Descriptors:
LDT1553_DES_TYPE
LDT_AIC_DES_TYPE
Commanding Descriptors:
EI_CMD_DES_TYPE (*NOTE: This is a derived type id)
CMD_DES_TYPE_S
SYS_CMD_DES_TYPE
Bus Descriptors:
BUS_GENERIC_DES_TYPE
BUS1553_DES_TYPE
BUS_AIC_DES_TYPE
Port Descriptors:
PORT_GENERIC_DES_TYPE
PORT1553_DES_TYPE
PORT_AIC_DES_TYPE
PORT_ARS_DES_TYPE
Polling Descriptors:
POLL1553_DES_TYPE
Notice Descriptors:
NOTICE_DES_TYPE
Update Descriptors:
UPDATE_DES_TYPE
In addition, the following macros have been defined in KTables.h:
IS_MEASUREMENT_DES(des_type)
IS_EXCEPTION_DES(des_type)
IS_CONVERSION_DES(des_type)
IS_LINK_DES(des_type)
IS_COMMAND_DES(des_type) (*NOTE: This is a derived macro definition)
IS_SYSTEM_COMMAND_DES(des_type)
IS_BUS_DES(des_type)
IS_PORT_DES(des_type)
IS_POLL_DES(des_type)
IS_NOTICE_DES(des_type)
IS_UPDATE_DES(des_type)
Each macro evaluates to true or false (1 or 0)
|
|
|
Get a measurement's FD characteristics.
|
|
|
Get the type of a specified measurement descriptor.
The value is returned can be equated to one of the following defines declared in KConstants.h:
ANALOG_TYPE
BYTE_ARRAY_TYPE
DISCRETE_TYPE
SIGNED_INT_TYPE
UNSIGNED_INT_TYPE
ANALOG_PREDEF_TYPE
BYTE_ARRAY_PREDEF_TYPE
DISCRETE_PREDEF_TYPE
SIGNED_INT_PREDEF_TYPE
UNSIGNED_INT_PREDEF_TYPE
In addition, the following macro has been defined in KConstants.h:
IS_PREDEFINED_MEAS(meas_type)
The macro evaluates to true or false (1 or 0)
|
|
|
Extract a measurement's engineering unit from the system during run-time.
|
|
|
Get a measurement's current value and status from the system during run-time.
GetMeasValue() is a user API call which returns the measurement's current value and status from the real-time tables for the specified fd.
For processed data values:
CHAR_FORMAT Value size = sizeof(char)
INT_FORMAT Value size = sizeof(int)
LONG_FORMAT Value size = sizeof(int64_t) // 64-bit Integer
FLOAT_FORMAT Value size = sizeof(float)
DOUBLE_FORMAT Value size = sizeof(double)
STRING_FORMAT Value size = sizeof(char) * MAX_BYTE_ARRAY_DATA_SIZE
For raw data values:
RAW_CHAR_FORMAT Value size = sizeof(char)
RAW_INT_FORMAT Value size = sizeof(int)
RAW_LONG_FORMAT Value size = sizeof(int64_t) // 64-bit Integer
RAW_FLOAT_FORMAT Value size = sizeof(float)
RAW_DOUBLE_FORMAT Value size = sizeof(double)
RAW_STRING_FORMAT Value size = 2 * sizeof(char) * MAX_BYTE_ARRAY_DATA_SIZE
(as null terminated HEX string)
RAW_BYTE_ARRAY_FORMAT Value size = sizeof(char) * MAX_BYTE_ARRAY_DATA_SIZE
|
|
|
Get the number of parameters associated with a command from the system during run-time.
|
|
|
Get the current project's ASCII name.
|
|
|
Issue a parameterized command.
|
|
|
Issue a command with value.
Unlike the IssueCmd() API, IssueValue() expects a format_type similar to the SetMeasValue() API function. This format specification identifies the data type of the command value to issue. This allows the flexibility to issue commands with a parameter value that doesn't necessarily correspond to the format expected by the command fd. With the exception that commands issued through this API call can only have one parameter. Refer to both IssueCmd() and SetMeasValue() for information regarding the command_response_data and format_type arguments respectively.
|
|
|
Set a measurement's processed or raw value during run-time.
The value passed in is specified by the format_type using the following set of defines declared in ApiTypes.h for each valid format specification:
For processed input values:</EM><BR>
CHAR_FORMAT Value size = sizeof(char)
INT_FORMAT Value size = sizeof(int)
LONG_FORMAT Value size = sizeof(int64_t) // 64-bit Integer
FLOAT_FORMAT Value size = sizeof(float)
DOUBLE_FORMAT Value size = sizeof(double)
STRING_FORMAT Value size = strlen(string)
(as null terminated string)
BYTE_ARRAY_FORMAT Value size = sizeof(int) size field
(self contained first integer field of byte array)
For raw input values:
RAW_CHAR_FORMAT Value size = sizeof(char)
RAW_INT_FORMAT Value size = sizeof(int)
RAW_LONG_FORMAT Value size = sizeof(int64_t) // 64-bit Integer
RAW_FLOAT_FORMAT Value size = sizeof(float)
RAW_DOUBLE_FORMAT Value size = sizeof(double)
RAW_STRING_FORMAT Value size = strlen(string)
(as null terminated string)
RAW_BYTE_ARRAY_FORMAT Value size = sizeof(int) size field
(self contained first integer field of byte array)
|
|
|
User process initialization.
|
|
|
Clean up all system internals for the application. SysQuit() is an internal function used to detach the process from all system services.
This function is used by the API function SysInit(). The function does not exit the system, instead only detaches the application from all of the system services to assure proper shutdown from the CCTK environment.
|
|
|
Print application error messages.
api_perror() produces a message on the standard error output, describing the last error encountered during a call to a application library function. The argument string s is printed first, then a color and a blank, then the message and a newline. (However, if s is a null pointer or points to a null string, the colon is not printed.) The error number is take from the external variable g_api_errno, which is set when errors occur but not cleared when non-erroneous calls are made. |
|
|
Get application error message string.
api_strerror() maps the api error number in api_errnum to an error message string, and returns a pointer to that string. api_strerror uses the same set of error messages as api_perror.
|
|
|
Error number of the last application error message.
The integer g_api_errno is set by the API library functions when errors occur. The value is significant only when a call returns an error but not cleared when non-erroneous calls are made. |