TReK C++  5.3.3
Telemetry/Command API
trek::TrackItem Class Reference

This class holds all of the responses associated with a single command uplink. Only methods that are expected to be used by user applications are documented. More...

#include <track_item.h>

Public Member Functions

uint32_t GetToken ()
 Returns the token associated with the command uplink. More...
 
const char * GetCommandName ()
 Returns the command name associated with the uplink. More...
 
TrekTimeGetUplinkTime ()
 Returns the time associated with the command uplink. More...
 
uint32_t GetNumberOfResponses ()
 Returns the number of responses available. More...
 
int32_t GetResponse (uint32_t index, struct response_item &item)
 Gets the information about the specified response as a structure. More...
 
int32_t GetResponse (uint32_t index, char *name, uint32_t &value, uint32_t &seconds, uint32_t &subsecs, uint32_t &subsecsper)
 Gets the information about the specified response as individual parameters. More...
 
Constructors, Destructor, and Other Basic Methods
 TrackItem ()
 Default constructor of the class.
 
virtual ~TrackItem ()
 Class destructor. More...
 

Detailed Description

This class holds all of the responses associated with a single command uplink. Only methods that are expected to be used by user applications are documented.

Examples
cmd_api_cpp/cmd_api_cpp_main.cpp.

Constructor & Destructor Documentation

◆ ~TrackItem()

trek::TrackItem::~TrackItem ( )
virtual

Class destructor.

Removes all resources created with this instance of the class.

Member Function Documentation

◆ GetCommandName()

const char * trek::TrackItem::GetCommandName ( )

Returns the command name associated with the uplink.

Example:

TrackItem item;
printf( "Command is %s\n", item.GetCommandName() );
This class holds all of the responses associated with a single command uplink. Only methods that are ...
Definition: track_item.h:30
const char * GetCommandName()
Returns the command name associated with the uplink.
Definition: track_item.cpp:86

◆ GetNumberOfResponses()

uint32_t trek::TrackItem::GetNumberOfResponses ( )

Returns the number of responses available.

Example:

TrackItem item;
struct response_item resp_item;
for( uint32_t ii = 0; ii < item.GetNumberOfResponses(); ii++ )
{
item.GetResponse( ii, resp_item );
printf( "Response Name: %s\n, resp_item.name );
}
uint32_t GetNumberOfResponses()
Returns the number of responses available.
Definition: track_item.cpp:118
int32_t GetResponse(uint32_t index, struct response_item &item)
Gets the information about the specified response as a structure.
Definition: track_item.cpp:140
Examples
cmd_api_cpp/cmd_api_cpp_main.cpp.

◆ GetResponse() [1/2]

int32_t trek::TrackItem::GetResponse ( uint32_t  index,
char *  name,
uint32_t &  value,
uint32_t &  seconds,
uint32_t &  subsecs,
uint32_t &  subsecsper 
)

Gets the information about the specified response as individual parameters.

param[in] index - location of response to retrieve param[out] name - the response name (up to 32 characters) param[out] value - the value of the response param[out] seconds - seconds of time param[out] subsecs - sub-seconds of time param[out] subsecsper - number of sub-seconds per second of time

Example:

TrackItem item;
char name[32];
uint32_t value, seconds, subsecs, subsecsper;
for( uint32_t ii = 0; ii < item.GetNumberOfResponses(); ii++ )
{
item.GetResponse( ii, name, value, seconds, subsecs, subsecsper );
printf( "Response Name: %s\n, name );
}

◆ GetResponse() [2/2]

int32_t trek::TrackItem::GetResponse ( uint32_t  index,
struct response_item &  item 
)

Gets the information about the specified response as a structure.

param[in] index - location of response to retrieve param[out] item - populated with the details for the item

Example:

TrackItem item;
struct response_item resp_item;
for( uint32_t ii = 0; ii < item.GetNumberOfResponses(); ii++ )
{
item.GetResponse( ii, resp_item );
printf( "Response Name: %s\n, resp_item.name );
}
Examples
cmd_api_cpp/cmd_api_cpp_main.cpp.

◆ GetToken()

uint32_t trek::TrackItem::GetToken ( )

Returns the token associated with the command uplink.

Example:

TrackItem item;
uint32_t token = item.GetToken();
uint32_t GetToken()
Returns the token associated with the command uplink.
Definition: track_item.cpp:76

◆ GetUplinkTime()

TrekTime & trek::TrackItem::GetUplinkTime ( )

Returns the time associated with the command uplink.

Example:

TrackItem item;
TrekTime uplink_itme = item.GetUplinkTime();
char time_as_str[50];
uint32_t size_of_output = 50;
if( my_time.GetTime( time_as_str, &size_of_output, true, false ) == SUCCESS )
printf( "Time command was uplinked: %s\n", time_as_str );
TrekTime & GetUplinkTime()
Returns the time associated with the command uplink.
Definition: track_item.cpp:101
This class holds a time value represented as seconds from the system epoch.
Definition: trek_time.h:25
#define SUCCESS
The function completed successfully.
Definition: trek_error.h:8