TReK ANSI-C  5.3.2
All ANSI-C APIs
trek_hpeg_api_ansi_c.h File Reference

An ANSI C HPEG API. More...

Functions

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

Detailed Description

An ANSI C HPEG API.

Function Documentation

◆ CleanseHpegApi()

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.

Returns
SUCCESS
TCA_WAIT_TIMEOUT

Example:

int return_value;
ret_value = CleanseHpegApi();
printf("CleanseHpegApi returned %d\n", ret_value );
int EXPORT_THIS_HPEG_C_FUNCTION CleanseHpegApi()
Removes resources no longer needed by the API.
Definition: trek_hpeg_api_ansi_c.cpp:46
Examples
hpeg_api_all_functions/all_functions_main.c.

◆ FreeHpegDestinationList()

void EXPORT_THIS_HPEG_C_FUNCTION FreeHpegDestinationList ( char **  dest_list,
unsigned int  num_items 
)

Frees the memory created in GetHpegDestinationList.

Parameters
[in]dest_listA list destinations returned from GetHpegDestinationList().
[in]num_itemsThe number of destinations returned by GetHpegDestinationList().

Example:

int return_value;
char **dest_list;
unsigned int ii;
unsigned int num_returned;
ret_value = GetHpegDestinationList( &dest_list, &num_returned );
if( ret_value == 0 )
{
for( ii = 0; ii < num_returned; ii++ )
printf( "Destination %u: %s\n", ii+1, dest_list[ii] );
FreeHpegDestinationList( dest_list, num_returned );
}
void EXPORT_THIS_HPEG_C_FUNCTION FreeHpegDestinationList(char **dest_list, unsigned int num_items)
Frees the memory created in GetHpegDestinationList.
Definition: trek_hpeg_api_ansi_c.cpp:346
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.
Definition: trek_hpeg_api_ansi_c.cpp:211
Examples
hpeg_api_all_functions/all_functions_main.c.

◆ FreeHpegDtnGatewayList()

void EXPORT_THIS_HPEG_C_FUNCTION FreeHpegDtnGatewayList ( char **  gw_list,
unsigned int  num_items 
)

Frees the memory created in GetHpegDtnGatewayList.

Parameters
[in]gw_listA list of gateways returned from GetHpegDtnGatewayList().
[in]num_itemsThe number of gateways returned by GetHpegDtnGatewayList().

Example:

int return_value;
char **gw_list;
unsigned int ii;
unsigned int num_returned;
ret_value = GetHpegDtnGatewayList( &gw_list, &num_returned );
if( ret_value == 0 )
{
for( ii = 0; ii < num_returned; ii++ )
printf( "Gateway %u: %s\n", ii+1, gw_list[ii] );
FreeHpegDtnGatewayList( dest_list, num_returned );
}
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.
Definition: trek_hpeg_api_ansi_c.cpp:387
void EXPORT_THIS_HPEG_C_FUNCTION FreeHpegDtnGatewayList(char **gw_list, unsigned int num_items)
Frees the memory created in GetHpegDtnGatewayList.
Definition: trek_hpeg_api_ansi_c.cpp:497
Examples
hpeg_api_all_functions/all_functions_main.c.

◆ GetHpegDestinationList()

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.

Parameters
[out]dest_listA 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_returnedThe number of destinations returned in dest_list.
Returns
SUCCESS
TCA_WAIT_TIMEOUT
TREK_HPEG_API_TOO_MANY_DESTINATIONS
TREK_HPEG_API_INTERNAL_CODING_ERROR
TREK_HPEG_API_DESTINATION_NOT_FOUND
TREK_HPEG_API_STRING_TOO_LONG

Example:

int return_value;
char **dest_list;
unsigned int ii;
unsigned int num_returned;
ret_value = GetHpegDestinationList( &dest_list, &num_returned );
if( ret_value == 0 )
{
for( ii = 0; ii < num_returned; ii++ )
printf( "Destination %u: %s\n", ii+1, dest_list[ii] );
FreeHpegDestinationList( dest_list, num_returned );
}
Examples
hpeg_api_all_functions/all_functions_main.c.

◆ GetHpegDestinationStatusValue()

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.

Parameters
[in]dest_nameThe name of the destination for which the information is requested.
[in]requested_valueOne of the values in the table below.
[out]valueA valid character array to hold the returned value. The user of this function is responsible for memory allocation.
[in]available_spaceThe 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.

Returns
SUCCESS
TCA_WAIT_TIMEOUT
TREK_HPEG_API_INVALID_REQUEST
TREK_HPEG_API_NOT_ENOUGH_SPACE
TREK_HPEG_API_INTERNAL_CODING_ERROR
TREK_HPEG_API_DESTINATION_NOT_FOUND
TREK_HPEG_API_STRING_TOO_LONG

Example:

int return_value;
char value[100];
ret_value = GetHpegDestinationStatusValue( "MyIssPayload", "DestProxyIpAddress", value, 100 );
if( ret_value == 0 )
printf( "Use IP address %s to connect to my payload.\n", value );
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.
Definition: trek_hpeg_api_ansi_c.cpp:301
Examples
hpeg_api_all_functions/all_functions_main.c.

◆ GetHpegDtnGatewayList()

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.

Parameters
[out]gw_listA 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_returnedThe number of DTN gateways returned in gw_list.
Returns
SUCCESS
TCA_WAIT_TIMEOUT
TREK_HPEG_API_TOO_MANY_GATEWAYS
TREK_HPEG_API_INTERNAL_CODING_ERROR
TREK_HPEG_API_GATEWAY_NOT_FOUND
TREK_HPEG_API_STRING_TOO_LONG

Example:

int return_value;
char **gw_list;
unsigned int ii;
unsigned int num_returned;
ret_value = GetHpegDtnGatewayList( &gw_list, &num_returned );
if( ret_value == 0 )
{
for( ii = 0; ii < num_returned; ii++ )
printf( "DTN Gateway %u: %s\n", ii+1, gw_list[ii] );
FreeHpegDtnGatewayList( gw_list, num_returned );
}
Examples
hpeg_api_all_functions/all_functions_main.c.

◆ GetHpegDtnGatewayStatusValue()

int EXPORT_THIS_HPEG_C_FUNCTION GetHpegDtnGatewayStatusValue ( const char *  dest_name,
const char *  requested_value,
char *  value,
unsigned int  available_space 
)

Get a value for one of the HPEG DTN gateway status items.

Parameters
[in]gw_nameThe name of the gateway for which the information is requested.
[in]requested_valueOne of the values in the table below.
[out]valueA valid character array to hold the returned value. The user of this function is responsible for memory allocation.
[in]available_spaceThe 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.
Returns
SUCCESS
TCA_WAIT_TIMEOUT
TREK_HPEG_API_INVALID_REQUEST
TREK_HPEG_API_NOT_ENOUGH_SPACE
TREK_HPEG_API_INTERNAL_CODING_ERROR
TREK_HPEG_API_GATEWAY_NOT_FOUND
TREK_HPEG_API_STRING_TOO_LONG

Example:

int return_value;
char value[100];
ret_value = GetHpegDtnGatewayStatusValue( "GatewayOne", "HoscDtnNodeIpAddress", value, 100 );
if( ret_value == 0 )
printf( "HOSC Gateway IP address is %s.\n", value );
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.
Definition: trek_hpeg_api_ansi_c.cpp:452
Examples
hpeg_api_all_functions/all_functions_main.c.

◆ GetHpegStatusValue()

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.

Parameters
[in]requested_valueOne of the values in the table below.
[out]valueA valid character array to hold the returned value. The user of this function is responsible for memory allocation.
[in]available_spaceThe 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.
Returns
SUCCESS
TCA_WAIT_TIMEOUT
TREK_HPEG_API_INVALID_REQUEST
TREK_HPEG_API_NOT_ENOUGH_SPACE
TREK_HPEG_API_INTERNAL_CODING_ERROR

Example:

int return_value;
char value[100];
ret_value = GetHpegStatusValue( "HpegUser", value, 100 );
if( ret_value == 0 )
printf( "I am %s for HPEG.\n", value );
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.
Definition: trek_hpeg_api_ansi_c.cpp:157
Examples
hpeg_api_all_functions/all_functions_main.c.