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

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

Detailed Description

An ANSI C HPEG API.

Typedef Documentation

◆ AosLosCallback

typedef void(* AosLosCallback) (const char *name, unsigned int fwd, unsigned int ret)

Callback function for AOS events.

Parameters
[in]nameThe name for the location where AOS occurs.
[in]fwdThe forward link status (AOS=1, LOS=0).
[in]retThe return link status (AOS=1, LOS=0).

◆ DroppedSessionCallback

typedef void(* DroppedSessionCallback) (const char *name)

Callback function for when a session to a destination is lost.

Parameters
[in]nameThe name for the destination.

◆ SessionStartedCallback

typedef void(* SessionStartedCallback) (const char *name)

Callback function for when a session to a destination is started.

Parameters
[in]nameThe name for the destination.

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:701
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:1001
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:866
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:1042
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:1152
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:956
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 *  gw_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:1107
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:812
Examples
hpeg_api_all_functions/all_functions_main.c.

◆ HpegActivate()

int EXPORT_THIS_HPEG_C_FUNCTION HpegActivate ( )

Activates HPEG.

Note
This function is only available when using the HPEG console.

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.

Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MyHpegActivationCallback( int code )
{
if( code )
printf( "Error %d when activating HPEG.", code );
else
printf( "HPEC is active!\n" );
}
main()
{
// register the function
int ret_value = RegisterHpegActivationCallback( MyHpegActivationCallback );
ret_value = HpegActivate();
}
int EXPORT_THIS_HPEG_C_FUNCTION HpegActivate()
Activates HPEG.
Definition: trek_hpeg_api_ansi_c.cpp:454
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.
Definition: trek_hpeg_api_ansi_c.cpp:253

◆ HpegDeactivate()

int EXPORT_THIS_HPEG_C_FUNCTION HpegDeactivate ( )

Deactivates HPEG.

Note
This function is only available when using the HPEG console.

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.

Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MyHpegDeactivationCallback( int code )
{
if( code )
printf( "Error %d when deactivating HPEG.", code );
else
printf( "HPEC is no longer active\n" );
}
main()
{
// register the function
int ret_value = RegisterHpegDeactivationCallback( MyHpegDeactivationCallback );
ret_value = HpegDeactivate();
}
int EXPORT_THIS_HPEG_C_FUNCTION HpegDeactivate()
Deactivates HPEG.
Definition: trek_hpeg_api_ansi_c.cpp:507
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.
Definition: trek_hpeg_api_ansi_c.cpp:298

◆ HpegStartSession()

int EXPORT_THIS_HPEG_C_FUNCTION HpegStartSession ( const char *  destination)

Starts an HPEG session.

Note
This function is only available when using the HPEG console.

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.

Parameters
[in]destinationThe name of the destination for which to start the session.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MySessionStartedCallbackFunction( const char *name )
{
int return_value;
char value[100];
printf( "A session to destination %s was started.\n", name );
ret_value = GetHpegDestinationStatusValue( name, "DestProxyIpAddress", value, 100 );
if( ret_value == 0 )
printf( "Use IP address %s to connect to my payload.\n", value );
}
main()
{
// register the function
int ret_value = RegisterSessionStartedCallback( MySessionStartedCallbackFunction );
ret_value = HpegStartSession( "MyDestination" );
}
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.
Definition: trek_hpeg_api_ansi_c.cpp:208
int EXPORT_THIS_HPEG_C_FUNCTION HpegStartSession(const char *destination)
Starts an HPEG session.
Definition: trek_hpeg_api_ansi_c.cpp:346

◆ HpegStopSession()

int EXPORT_THIS_HPEG_C_FUNCTION HpegStopSession ( const char *  destination)

Stops an HPEG session.

Note
This function is only available when using the HPEG console.

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.

Parameters
[in]destinationThe name of the destination for which to stop the session.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MySessionStoppedCallbackFunction( const char *name )
{
int return_value;
char value[100];
printf( "A session to destination %s was stopped.\n", name );
}
main()
{
// register the function
int ret_value = RegisterSessionStoppedCallback( MySessionStoppedCallbackFunction );
ret_value = HpegStopSession( "MyDestination" );
}
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.
Definition: trek_hpeg_api_ansi_c.cpp:158
int EXPORT_THIS_HPEG_C_FUNCTION HpegStopSession(const char *destination)
Stops an HPEG session.
Definition: trek_hpeg_api_ansi_c.cpp:401

◆ HpegTurnOffAutoActivate()

int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOffAutoActivate ( )

Turns off auto activation.

Note
This function is only available when using the HPEG console.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

main()
{
int ret_value = HpegTurnOffAutoActivate();
}
int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOffAutoActivate()
Turns off auto activation.
Definition: trek_hpeg_api_ansi_c.cpp:585

◆ HpegTurnOffAutoStartSession()

int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOffAutoStartSession ( )

Turns off auto start session.

Note
This function is only available when using the HPEG console.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

main()
{
int ret_value = HpegTurnOffAutoStartSession();
}
int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOffAutoStartSession()
Turns off auto start session.
Definition: trek_hpeg_api_ansi_c.cpp:663

◆ HpegTurnOnAutoActivate()

int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOnAutoActivate ( )

Turns on auto activation.

Note
This function is only available when using the HPEG console.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

main()
{
int ret_value = HpegTurnOnAutoActivate();
}
int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOnAutoActivate()
Turns on auto activation.
Definition: trek_hpeg_api_ansi_c.cpp:546

◆ HpegTurnOnAutoStartSession()

int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOnAutoStartSession ( )

Turns on auto start session.

Note
This function is only available when using the HPEG console.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

main()
{
int ret_value = HpegTurnOnAutoStartSession();
}
int EXPORT_THIS_HPEG_C_FUNCTION HpegTurnOnAutoStartSession()
Turns on auto start session.
Definition: trek_hpeg_api_ansi_c.cpp:624

◆ RegisterAosLosCallback()

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.

Parameters
[in]function_ptrThe 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).
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MyAosLosCallbackFunction( const char *name, unsigned int fwd, unsigned int ret )
{
printf( "%s AOS/LOS status change.\n", name );
}
main()
{
// register the function
int ret_value = RegisterAosLosCallback( MyAosLosCallbackFunction );
// ...
// unregister the function
ret_value = RegisterAosLosCallback( 0 );
}
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,...
Definition: trek_hpeg_api_ansi_c.cpp:68

◆ RegisterDroppedHpegConnectionCallback()

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.

Parameters
[in]function_ptrThe function to handle the callback.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MyHpegDroppedCallbackFunction()
{
printf( "Lost HPEG connection.\n", name );
}
main()
{
// register the function
int ret_value = RegisterDroppedHpegConnectionCallback( MyHpegDroppedCallbackFunction );
// ...
// unregister the function
}
int EXPORT_THIS_HPEG_C_FUNCTION RegisterDroppedHpegConnectionCallback(DroppedHpegConnectionCallback function_ptr)
Registers a function that will be called whenever the HPEG connection is dropped.
Definition: trek_hpeg_api_ansi_c.cpp:110

◆ RegisterHpegActivationCallback()

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.

Parameters
[in]function_ptrThe function to handle the callback. The function will contain a code on the status of the activation (0 = success or an error number).
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MyHpegActivationCallbackFunction( int code )
{
if( code == 0 )
printf( "HPEG is active.\n", name );
else
printf( "Activation code %d\n", code );
}
main()
{
// register the function
int ret_value = RegisterHpegActivationCallback( MyHpegActivationCallbackFunction );
// ...
// unregister the function
}

◆ RegisterHpegDeactivationCallback()

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.

Parameters
[in]function_ptrThe function to handle the callback. The function will contain a code on the status of the deactivation (0 = success or an error number).
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MyHpegDeactivationCallbackFunction( int code )
{
if( code == 0 )
printf( "HPEG is not active.\n", name );
else
printf( "Deactivation code %d\n", code );
}
main()
{
// register the function
int ret_value = RegisterHpegDeactivationCallback( MyHpegDeactivationCallbackFunction );
// ...
// unregister the function
}

◆ RegisterSessionStartedCallback()

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.

Parameters
[in]function_ptrThe function to handle the callback. The function will contain the name of the destination for which a session was started.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MySessionStartedCallbackFunction( const char *name )
{
int return_value;
char value[100];
printf( "A session to destination %s was started.\n", name );
ret_value = GetHpegDestinationStatusValue( name, "DestProxyIpAddress", value, 100 );
if( ret_value == 0 )
printf( "Use IP address %s to connect to my payload.\n", value );
}
main()
{
// register the function
int ret_value = RegisterSessionStartedCallback( MySessionStartedCallbackFunction );
// ...
// unregister the function
}

◆ RegisterSessionStoppedCallback()

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.

Parameters
[in]function_ptrThe function to handle the callback. The function will contain the name of the destination which lost the session.
Returns
SUCCESS
TREK_HPEG_API_INIT_FAILED

Example:

void MyDroppedSessionCallbackFunction( const char *name )
{
int ret_value;
printf( "The session to destination %s was dropped. Try restarting\n", name );
ret_value = StartSession( name );
}
main()
{
// register the function
int ret_value = RegisterSessionStoppedCallback( MyDroppedSessionCallbackFunction );
// ...
// unregister the function
}