TReK ANSI-C
5.3.3
All ANSI-C APIs
|
An ANSI C HPEG API. More...
Typedefs | |
typedef void(* | AosLosCallback) (const char *name, unsigned int fwd, unsigned int ret) |
Callback function for AOS events. More... | |
typedef void(* | DroppedHpegConnectionCallback) () |
Callback function for when the HPEG connection drops. | |
typedef void(* | DroppedSessionCallback) (const char *name) |
Callback function for when a session to a destination is lost. More... | |
typedef void(* | SessionStartedCallback) (const char *name) |
Callback function for when a session to a destination is started. More... | |
typedef void(* | HpegActivationCallback) (int code) |
Callback function for when the HPEG is activated. | |
typedef void(* | HpegDeactivationCallback) (int code) |
Callback function for when the HPEG is deactivated. | |
Functions | |
int EXPORT_THIS_HPEG_C_FUNCTION | RegisterAosLosCallback (AosLosCallback function_ptr) |
Registers a function that will be called whenever a location's AOS/LOS status changes for the foward, return, or both links. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | RegisterDroppedHpegConnectionCallback (DroppedHpegConnectionCallback function_ptr) |
Registers a function that will be called whenever the HPEG connection is dropped. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | RegisterSessionStoppedCallback (DroppedSessionCallback function_ptr) |
Registers a function that will be called whenever a session to a destination is lost. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | RegisterSessionStartedCallback (SessionStartedCallback function_ptr) |
Registers a function that will be called whenever a session to a destination is started. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | RegisterHpegActivationCallback (HpegActivationCallback function_ptr) |
Registers a function that will be called whenever HPEG reports a status associated with activation. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | RegisterHpegDeactivationCallback (HpegDeactivationCallback function_ptr) |
Registers a function that will be called whenever HPEG reports a status associated with deactivation. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | CleanseHpegApi () |
Removes resources no longer needed by the API. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | GetHpegStatusValue (const char *requested_value, char *value, unsigned int available_space) |
Get a value for one of the HPEG status items. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | GetHpegDestinationList (char ***dest_list, unsigned int *num_returned) |
Gets a list of all of the destinations available for HPEG. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | GetHpegDestinationStatusValue (const char *dest_name, const char *requested_value, char *value, unsigned int available_space) |
Get a value for one of the HPEG destination status items. More... | |
void EXPORT_THIS_HPEG_C_FUNCTION | FreeHpegDestinationList (char **dest_list, unsigned int num_items) |
Frees the memory created in GetHpegDestinationList. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | GetHpegDtnGatewayList (char ***gw_list, unsigned int *num_returned) |
Gets a list of all of the DTN gateways available for HPEG. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | GetHpegDtnGatewayStatusValue (const char *gw_name, const char *requested_value, char *value, unsigned int available_space) |
Get a value for one of the HPEG DTN gateway status items. More... | |
void EXPORT_THIS_HPEG_C_FUNCTION | FreeHpegDtnGatewayList (char **gw_list, unsigned int num_items) |
Frees the memory created in GetHpegDtnGatewayList. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | HpegStartSession (const char *destination) |
Starts an HPEG session. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | HpegStopSession (const char *destination) |
Stops an HPEG session. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | HpegActivate () |
Activates HPEG. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | HpegDeactivate () |
Deactivates HPEG. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | HpegTurnOnAutoActivate () |
Turns on auto activation. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | HpegTurnOffAutoActivate () |
Turns off auto activation. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | HpegTurnOnAutoStartSession () |
Turns on auto start session. More... | |
int EXPORT_THIS_HPEG_C_FUNCTION | HpegTurnOffAutoStartSession () |
Turns off auto start session. More... | |
An ANSI C HPEG API.
typedef void(* AosLosCallback) (const char *name, unsigned int fwd, unsigned int ret) |
Callback function for AOS events.
[in] | name | The name for the location where AOS occurs. |
[in] | fwd | The forward link status (AOS=1, LOS=0). |
[in] | ret | The return link status (AOS=1, LOS=0). |
typedef void(* DroppedSessionCallback) (const char *name) |
Callback function for when a session to a destination is lost.
[in] | name | The name for the destination. |
typedef void(* SessionStartedCallback) (const char *name) |
Callback function for when a session to a destination is started.
[in] | name | The name for the destination. |
int EXPORT_THIS_HPEG_C_FUNCTION CleanseHpegApi | ( | ) |
Removes resources no longer needed by the API.
If a program incorporating this API does not exit normally, it is possible for unneeded memory and threads to exist within the TReK HPEG process. Calling this function will search for any unused resources and free them. It is suggested that users of the HPEG API call this function as part of the initialization of the applications incorporating the API.
Example:
void EXPORT_THIS_HPEG_C_FUNCTION FreeHpegDestinationList | ( | char ** | dest_list, |
unsigned int | num_items | ||
) |
Frees the memory created in GetHpegDestinationList.
[in] | dest_list | A list destinations returned from GetHpegDestinationList(). |
[in] | num_items | The number of destinations returned by GetHpegDestinationList(). |
Example:
void EXPORT_THIS_HPEG_C_FUNCTION FreeHpegDtnGatewayList | ( | char ** | gw_list, |
unsigned int | num_items | ||
) |
Frees the memory created in GetHpegDtnGatewayList.
[in] | gw_list | A list of gateways returned from GetHpegDtnGatewayList(). |
[in] | num_items | The number of gateways returned by GetHpegDtnGatewayList(). |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION GetHpegDestinationList | ( | char *** | dest_list, |
unsigned int * | num_returned | ||
) |
Gets a list of all of the destinations available for HPEG.
[out] | dest_list | A list of all destinations available in HPEG. This function will allocate memory and the user of the function is responsible for deleting the memory when no longer needed by calling FreeHpegDestinationList(). |
[out] | num_returned | The number of destinations returned in dest_list. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION GetHpegDestinationStatusValue | ( | const char * | dest_name, |
const char * | requested_value, | ||
char * | value, | ||
unsigned int | available_space | ||
) |
Get a value for one of the HPEG destination status items.
[in] | dest_name | The name of the destination for which the information is requested. |
[in] | requested_value | One of the values in the table below. |
[out] | value | A valid character array to hold the returned value. The user of this function is responsible for memory allocation. |
[in] | available_space | The number of valid bytes associated with the value parameter. |
Request String | Description |
DestProxyIpAddress | The proxy IP address used to communicate with this destination. Value will either be a valid IP address or blank. A blank value indicates that the session has not been started. |
DestSpaceNodeId | Indicates the space node identifier for this destination. If no space node identifier is associated with the destination, the value will be blank. |
DestStatus | The status for the destination (Active or Inactive). |
DestEnablement | Indicates if communication for the destination is enabled or disabled. |
DestForwardLink | Indicates if the forward link is AOS or LOS. For destinations that don't provide the status it will be listed as N/A (not available). |
DestReturnLink | Indicates if the return link is AOS or LOS. For destinations that don't provide the status it will be listed as N/A (not available). |
DestLocation | String that lists the current location of the payload. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION GetHpegDtnGatewayList | ( | char *** | gw_list, |
unsigned int * | num_returned | ||
) |
Gets a list of all of the DTN gateways available for HPEG.
[out] | gw_list | A list of all DTN gateways available in HPEG. This function will allocate memory and the user of the function is responsible for deleting the memory when no longer needed by calling FreeHpegDtnGatewayList(). |
[out] | num_returned | The number of DTN gateways returned in gw_list. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION GetHpegDtnGatewayStatusValue | ( | const char * | gw_name, |
const char * | requested_value, | ||
char * | value, | ||
unsigned int | available_space | ||
) |
Get a value for one of the HPEG DTN gateway status items.
[in] | gw_name | The name of the gateway for which the information is requested. |
[in] | requested_value | One of the values in the table below. |
[out] | value | A valid character array to hold the returned value. The user of this function is responsible for memory allocation. |
[in] | available_space | The number of valid bytes associated with the value parameter. |
HoscDtnNodeNumber | The node number for the HOSC DTN server. If your login does not use DTN this value will be blank. |
HoscDtnNodeIpAddress | The IP address for the HOSC DTN server. If your login does not use DTN this value will be blank. |
HoscDtnNodePort | The port number for HOSC DTN connections. If your login does not use DTN this value will be blank. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION GetHpegStatusValue | ( | const char * | requested_value, |
char * | value, | ||
unsigned int | available_space | ||
) |
Get a value for one of the HPEG status items.
[in] | requested_value | One of the values in the table below. |
[out] | value | A valid character array to hold the returned value. The user of this function is responsible for memory allocation. |
[in] | available_space | The number of valid bytes associated with the value parameter. |
Request String | Description |
HpegUser | Indicates if the user is enabled for HPEG. Returned value will be either Enabled or Disabled. |
HpegCommanding | Indicates if the POIC is enabled for HPEG. Returned value will be either Enabled or Disabled. |
KuForward | Indicates if the forward link is available for Ku-Band. Returned value will be either AOS or LOS. |
KuReturn | Indicates if the return link is available for Ku-Band. Returned value will be either AOS or LOS. |
Increment | The increment for your current login. |
OperationalMode | The operational support mode for your current login. |
IdleCheck | Indicates if the POIC is checking for inactivity on sessions to your payloads. Returned value will be either Enabled or Disabled. |
GroundNodeId | The ground node identfier associated with your login. If no ground node identifier is associated with the login the value will be blank. |
OnboardProxyIpAddress | The onboard proxy IP address assocatied with your login. |
HoscDtnNodeNumber | Deprecated. Use GetHpegDtnGatewayStatusValue to retrieve this value. |
HoscDtnNodeIpAddress | Deprecated. Use GetHpegDtnGatewayStatusValue to retrieve this value. |
HoscDtnNodePort | Deprecated. Use GetHpegDtnGatewayStatusValue to retrieve this value. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION HpegActivate | ( | ) |
Activates HPEG.
Activates the HPEG console. A successful return code indicates that the HPEG console application has been notified to attempt HPEG activation. Use the RegisterHpegActivationCallback to know if activation was successful. The HPEG console must have auto activation turned off for this function to work.
Example:
int EXPORT_THIS_HPEG_C_FUNCTION HpegDeactivate | ( | ) |
Deactivates HPEG.
Deactivates the HPEG console. A successful return code indicates that the HPEG console application has been notified to attempt HPEG deactivation. Use the RegisterHpegDeactivationCallback to know if deactivation was successful. The HPEG console must have auto activation turned off for this function to work.
Example:
int EXPORT_THIS_HPEG_C_FUNCTION HpegStartSession | ( | const char * | destination | ) |
Starts an HPEG session.
Starts an HPEG sesion to the specified payload. A successful return code indicates that the HPEG console application has been notified to start the HPEG session. Use the RegisterSessionStartedCallback to know when the session is ready.
[in] | destination | The name of the destination for which to start the session. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION HpegStopSession | ( | const char * | destination | ) |
Stops an HPEG session.
Stops an HPEG sesion to the specified payload. A successful return code indicates that the HPEG console application has been notified to stop the HPEG session. Use the RegisterSessionStoppedCallback to know when the session is ready.
[in] | destination | The name of the destination for which to stop the session. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOffAutoActivate | ( | ) |
Turns off auto activation.
Example:
int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOffAutoStartSession | ( | ) |
Turns off auto start session.
Example:
int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOnAutoActivate | ( | ) |
Turns on auto activation.
Example:
int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOnAutoStartSession | ( | ) |
Turns on auto start session.
Example:
int EXPORT_THIS_HPEG_C_FUNCTION RegisterAosLosCallback | ( | AosLosCallback | function_ptr | ) |
Registers a function that will be called whenever a location's AOS/LOS status changes for the foward, return, or both links.
Registers a function that will be called whenever a location's AOS/LOS status changes for the foward, return, or both links. The callback will continue to be triggered until you unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
[in] | function_ptr | The function to handle the callback. The function will contain the name of the location and whether the forward and return links are AOS (value=1) or LOS (value=0). |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION RegisterDroppedHpegConnectionCallback | ( | DroppedHpegConnectionCallback | function_ptr | ) |
Registers a function that will be called whenever the HPEG connection is dropped.
Registers the specified function which will be called whenever the HPEG connection is dropped. The callback will continue to be triggered any time the HPEG connection is lost until you unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
[in] | function_ptr | The function to handle the callback. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION RegisterHpegActivationCallback | ( | HpegActivationCallback | function_ptr | ) |
Registers a function that will be called whenever HPEG reports a status associated with activation.
Registers the specified function which will be called whenever HPEG connection reports a status during activation. A status of 0 indicates that HPEG is active. The callback will continue to be triggered until you unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
[in] | function_ptr | The function to handle the callback. The function will contain a code on the status of the activation (0 = success or an error number). |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION RegisterHpegDeactivationCallback | ( | HpegDeactivationCallback | function_ptr | ) |
Registers a function that will be called whenever HPEG reports a status associated with deactivation.
Registers the specified function which will be called whenever HPEG connection reports a status during deactivation. A status of 0 indicates that HPEG is not active. The callback will continue to be triggered until you unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
[in] | function_ptr | The function to handle the callback. The function will contain a code on the status of the deactivation (0 = success or an error number). |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION RegisterSessionStartedCallback | ( | SessionStartedCallback | function_ptr | ) |
Registers a function that will be called whenever a session to a destination is started.
Registers the specified function which will be called whenever a session to a destination is started. The callback will continue to be triggered until you unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
You can call GetHpegDestinationStatusValue() to get information about the destination including the proxy IP address.
[in] | function_ptr | The function to handle the callback. The function will contain the name of the destination for which a session was started. |
Example:
int EXPORT_THIS_HPEG_C_FUNCTION RegisterSessionStoppedCallback | ( | DroppedSessionCallback | function_ptr | ) |
Registers a function that will be called whenever a session to a destination is lost.
Registers the specified function which will be called whenever a session to a destination is lost. The callback will continue to be triggered until you unregister for the callback. You can unregister for this callback by passing a NULL pointer to the function.
If HPEG is configured for full automation this callback can be considered informational. If HPEG is not configured for full automation, you can use the StartSession() function to restart the session as shown in the example.
[in] | function_ptr | The function to handle the callback. The function will contain the name of the destination which lost the session. |
Example: