|
Telescience Resource Kit
TReK Python
5.4.0 ART
|
Provides common functionality between the Telemetry and Commanding APIs. More...
Inherited by CommandApi, and TelemetryApi.
Public Member Functions | |
Initialize / Finalize | |
Functions handling class initialization and destruction. | |
def | ApiClient ( -> None ) -> def |
Class initializer. More... | |
Connection Handling | |
Connect to or disconnect from destination or data store. | |
def | cleanse ( -> None ) -> def |
Cleans up any resources from crashed TReK user programs. More... | |
def | connect ( str destination="DefaultDataStore" -> None ) -> def |
Connects this instance of the API to TReK for the specified destination. More... | |
def | is_connected ( -> bool ) -> def |
Indicates if the API is connected. More... | |
def | disconnect ( -> None ) -> def |
Disconnects from the destination. More... | |
Timeout | |
These functions set/get connection timeout behavior. | |
def | get_wait_timeout ( -> int ) -> def |
Returns the current timeout value for API calls. More... | |
def | set_wait_timeout (timeout: int -> None ) -> def |
Sets the timeout value for API calls that require communicating with TReK. More... | |
Provides common functionality between the Telemetry and Commanding APIs.
Use the subclassed TelemetryApi and CommandApi instead.
( | ) | -> None |
Class initializer.
Reimplemented in CommandApi, and TelemetryApi.
( | ) | -> None |
Cleans up any resources from crashed TReK user programs.
This method can be called at any time. A good practice is to call this method after a successful connect(). This will allow TReK to remove any resources no longer in use.
TrekError | 31123 - TCA_API_NOT_CONNECTED, 31122 - TCA_WORKER_WAIT_ERR |
( | destination | : str | ) | -> None |
Connects this instance of the API to TReK for the specified destination.
This method will allocate the resources necessary to communicate with TReK. When the API connection is no longer needed, disconnect() should be called.
[in] | destination | The name of the destination to connect. |
TrekError | 31111 - TCA_ALREADY_CONNECTED, 31112 - TCA_NAME_LEN_ERROR, 31113 - TCA_LOCAL_MUTEX_CREATE_ERR, 31114 - TCA_OPEN_SERVER_SHM_ERR, 31115 - TCA_OPEN_SERVER_MUTEX_ERR, 31116 - TCA_OPEN_SERVER_SEM_ERR, 31117 - TCA_SERVER_WAIT_ERR, 31118 - TCA_SERVER_SIGNAL_ERR, 31119 - TCA_SESSION_WAIT_ERR, 31120 - TCA_SESSION_REQUEST_FAIL, 31121 - TCA_OPEN_WORKER_SHM_ERR |
( | ) | -> None |
Disconnects from the destination.
Disconnects this instance of the API from TReK. This method will deallocate any resources used for communication.
TrekError | 31122 - TCA_WORKER_WAIT_ERR |
( | ) | -> int |
Returns the current timeout value for API calls.
( | ) | -> bool |
Indicates if the API is connected.
( | timeout | : int | ) | -> None |
Sets the timeout value for API calls that require communicating with TReK.
Any method call in this class that requires communication with TReK has a timeout value. This method will set the timeout for all other calls. The timeout should rarely occur and if it does would indicate that another process or thread has locked the command destination in TReK.
[in] | timeout | Timeout value in milliseconds. |