RDK Documentation (Open Sourced RDK Components)
Common

Description

Data Structures

class  ReservationCustomAttributes
 
class  Tuner
 
class  SpecVersion
 

Macros

#define LOCAL_BEGIN_NAMESPACE   namespace {
 
#define LOCAL_END_NAMESPACE   }
 
#define TRM_BEGIN_NAMESPACE   namespace TRM {
 
#define TRM_END_NAMESPACE   }
 
#define UNUSED_VARIABLE(x)   (void(x))
 
#define DEVICEID_SCRIPT_PATH   "/lib/rdk/getDeviceId.sh"
 
#define SCRIPT_OUTPUT_BUFFER_SIZE   512
 

Enumerations

enum  
 
enum  
 
enum  
 
enum  
 

Functions

static TRM_BEGIN_NAMESPACE void json_dump_error (const std::string &title, const json_error_t &error)
 
static int vector_dump_callback (const char *buffer, size_t size, void *data)
 
static int vector_load_callback (const char *buffer, size_t size, void *data)
 
static void JsonEncode (const Activity &r, json_t *parent)
 
static void JsonDecode (json_t *parent, Activity &r)
 
static void JsonEncode (const TunerReservation &r, json_t *parent)
 
static void JsonDecode (json_t *parent, TunerReservation &reservation)
 
static void JsonEncode (const DetailedTunerState &r, json_t *parent)
 
static void JsonDecode (json_t *parent, DetailedTunerState &reservation)
 
static void JsonEncode (const NotifyClientConnectionEvent &r, json_t *parent)
 
static void JsonDecode (json_t *parent, NotifyClientConnectionEvent &notification)
 
static void JsonEncode (const SimpleTRMRequest &r, std::vector< uint8_t > &out, int)
 
static void JsonEncode (const SimpleTRMRequest &r, json_t *parent)
 
static void JsonDecode (int handle, SimpleTRMRequest &message, int)
 
static void JsonDecode (json_t *parent, SimpleTRMRequest &message)
 
static void JsonEncode (const SimpleTRMResponse &r, json_t *parent)
 
static void JsonDecode (json_t *parent, SimpleTRMResponse &message)
 
int JsonDecode (const std::vector< uint8_t > &in, Enum< Klass > &klass)
 
void JsonEncode (const ReserveTuner &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, ReserveTuner &message)
 
void JsonEncode (const ReserveTunerResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, ReserveTunerResponse &message)
 
void JsonEncode (const ReleaseTunerReservation &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, ReleaseTunerReservation &message)
 
void JsonEncode (const ValidateTunerReservation &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, ValidateTunerReservation &message)
 
void JsonEncode (const CancelRecording &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, CancelRecording &message)
 
void JsonEncode (const ReleaseTunerReservationResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, ReleaseTunerReservationResponse &message)
 
void JsonEncode (const ValidateTunerReservationResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, ValidateTunerReservationResponse &message)
 
void JsonEncode (const CancelRecordingResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, CancelRecordingResponse &message)
 
void JsonEncode (const GetAllTunerIds &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetAllTunerIds &message)
 
void JsonEncode (const GetAllTunerIdsResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetAllTunerIdsResponse &message)
 
void JsonEncode (const GetAllTunerStates &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetAllTunerStates &message)
 
void JsonEncode (const GetAllTunerStatesResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetAllTunerStatesResponse &message)
 
void JsonEncode (const GetAllReservations &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetAllReservations &message)
 
void JsonEncode (const GetAllReservationsResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetAllReservationsResponse &message)
 
void JsonEncode (const GetVersion &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetVersion &message)
 
void JsonEncode (const GetVersionResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetVersionResponse &message)
 
void JsonEncode (const UpdateTunerActivityStatusResponse &r, std::vector< uint8_t > &out)
 
void JsonEncode (const UpdateTunerActivityStatus &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, UpdateTunerActivityStatus &message)
 
void JsonEncode (const NotifyTunerReservationRelease &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, NotifyTunerReservationRelease &message)
 
void JsonEncode (const NotifyTunerReservationUpdate &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, NotifyTunerReservationUpdate &message)
 
void JsonEncode (const NotifyTunerReservationConflicts &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, NotifyTunerReservationConflicts &message)
 
void JsonEncode (const NotifyTunerStatesUpdate &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, NotifyTunerStatesUpdate &message)
 
void JsonEncode (const NotifyTunerPretune &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, NotifyTunerPretune &message)
 
void JsonEncode (const CancelLiveResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, CancelLiveResponse &message)
 
void JsonEncode (const CancelLive &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, CancelLive &message)
 
int JsonDecode (const std::vector< uint8_t > &in, GenerateAuthTokenResponse &response)
 
int JsonDecode (const std::vector< uint8_t > &in, GenerateAuthTokenResponseFromAuthService &response)
 
std::string GetDeviceId ()
 
void JsonEncode (const NotifyClientConnectionEvent &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, NotifyClientConnectionEvent &message)
 
void JsonEncode (const GetTRMConnectionEvents &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetTRMConnectionEvents &message)
 
void JsonEncode (const GetAllConnectedDeviceIdsResponse &r, std::vector< uint8_t > &out)
 
void JsonDecode (int handle, GetAllConnectedDeviceIdsResponse &message)
 
void delete_ReservationCustomAttributes (void *p)
 
static TRM_BEGIN_NAMESPACE bool isOverlap (uint64_t start1, uint64_t dur1, uint64_t start2, uint64_t dur2)
 
static TRM_BEGIN_NAMESPACE int connect_to_authServer (const char *ip, int port, int *auth_fd)
 
const std::string IntToString (int i)
 
const std::string IntToString (int i, int j)
 
const std::string GenerateUUID (void)
 
void HexDump (const std::vector< uint8_t > &in)
 
uint64_t GetCurrentEpoch (void)
 
std::ostream & Timestamp (std::ostream &os)
 
std::ostream & Log (void)
 
std::string GetAuthToken (const char *generateTokenRequest)
 
const SpecVersionGetSpecVersion (void)
 
static const std::vector< const Enum< Activity > * > & TRM::Activity::getEnums (void)
 
const Enum< Activity > & TRM::Activity::getActivity (void) const
 This function is used to return the request or granted usage of tuner. The Activity field represents the intended use of the tuner. More...
 
bool TRM::Activity::hasDetails (void) const
 This function is used to return true if the activity has the detailed field describing the activity, otherwise the function will return false. More...
 
const std::string & TRM::Activity::getDetail (const std::string &key) const
 This function will get the details of the recording. Each activity may be associated with a set of details describing the tuner activity. More...
 
const std::map< KeyT, ValT > & TRM::Activity::getDetails (void) const
 
void TRM::Activity::addDetail (const std::string &key, const std::string &value)
 This API is used to add the details describing the activity in to a list. More...
 
bool TRM::Activity::operator== (const Activity &that) const
 
void TRM::Activity::print (void) const
 Print the list of recording(s) details which are being scheduled. The defined fields are,. More...
 
void TRM::Header::serialize (std::vector< uint8_t > &out) const
 
void TRM::Header::deserialize (const std::vector< uint8_t > &in)
 
void TRM::Header::setPayloadLength (size_t payloadLength)
 
size_t TRM::Header::getPayloadLength (void) const
 
void TRM::Header::setClientId (uint32_t connectionId)
 
uint32_t TRM::Header::getClientId (void) const
 
void TRM::JsonDecoder::decode (std::vector< uint8_t > &in)
 
static const std::vector< const Enum< Klass > * > & TRM::Klass::getEnums (void)
 
static const std::vector< const Enum< ResponseStatus > * > & TRM::ResponseStatus::getEnums (void)
 
const Enum< ResponseStatus > & TRM::ResponseStatus::getStatusCode (void) const
 
bool TRM::ResponseStatus::operator== (const ResponseStatus &that) const
 
ResponseStatusTRM::ResponseStatus::operator+= (const char *message)
 
ResponseStatusTRM::ResponseStatus::operator= (const Enum< ResponseStatus > &status)
 
void TRM::ResponseStatus::print (void) const
 
const std::string & TRM::ResponseStatus::getDetails (void) const
 
std::string & TRM::ResponseStatus::getDetails (void)
 
 Tuner::Tuner (const std::string &internalId)
 
TunerReservation::TokenList & Tuner::getReservationTokens (TunerReservation::TokenList &tokens) const
 
const TunerReservation & Tuner::getReservation (const std::string &reservationToken) const
 
TunerReservation & Tuner::getReservation (const std::string &reservationToken)
 
const TunerReservation & Tuner::getReservation (const Activity &activity, int reservationState, const std::string &serviceLocator="") const
 
const TunerState Tuner::getState (void) const
 
void Tuner::setState (const TunerState &state)
 
const std::string Tuner::getServiceLocator (bool considerFutureToken=true) const
 
uint64_t Tuner::getEndTime (const Activity &activity) const
 
const std::string & Tuner::getId (void) const
 
void Tuner::addReservation (const TunerReservation &reservation)
 
void Tuner::releaseReservation (const std::string &reservationToken)
 
bool Tuner::assertTunerState (int state, int lowMark, int highMark)
 
 TRM::TunerReservationBase::TunerReservationBase (const std::string &device, const std::string &serviceLocator, const uint64_t startTime, const uint64_t duration, const Activity &activity, const std::string &reservationToken="", ReservationCustomAttributes *customAttributes=0)
 
void TRM::TunerReservationBase::setReservationToken (const std::string &token)
 This function is used to set a unique token generated when a reservation is created. After a reservation is created, this token is used in all messages to uniquely identify an existing reservation within TRM. More...
 
const std::string & TRM::TunerReservationBase::getReservationToken (void) const
 This function is used to return the unique token generated when a reservation is created. More...
 
const std::string & TRM::TunerReservationBase::getServiceLocator (void) const
 This function is used to return the locator of the service that the tuner is tuned to. More...
 
uint64_t TRM::TunerReservationBase::getStartTime (void) const
 This function is used to get the start time of the reservation in milliseconds from the epoch. More...
 
uint64_t TRM::TunerReservationBase::getDuration (void) const
 This function is used to get the reservation period measured from the start in milliseconds. More...
 
const std::string & TRM::TunerReservationBase::getDevice (void) const
 This function is used to get the remote device id requesting for tuner reservation. More...
 
const ActivityTRM::TunerReservationBase::getActivity (void) const
 This function is used to return the granted activity. Granted activity may or may not be the same as the requested. In the later case the owner of the reservation will need to comply with the returned activity, or initiate conflict resolution.
For example, a client requests for Live activity when EAS is in progress, the returned reservation will have the EAS activity. More...
 
void TRM::TunerReservationBase::setServiceLocator (const std::string &_serviceLocator)
 This function is used to set the locator of the service that the tuner will tune to. The service locator is a URL containing tune parameters of the remote device. More...
 
void TRM::TunerReservationBase::setStartTime (const uint64_t &_startTime)
 This function is used to set the start time of the reservation in milliseconds from the epoch. If the startTime not present a requested message, this is set to when the reservation is granted or renewed. More...
 
void TRM::TunerReservationBase::setDuration (const uint64_t &_duratioin)
 This function is used to set the reservation duration measured from the start in milliseconds. If the duration field not present in a request message, the token is valid for a default duration. More...
 
uint64_t TRM::TunerReservationBase::getExpirationTime (void) const
 This function is used to return remaining tuner reservation time. More...
 
void TRM::TunerReservationBase::addDetail (const std::string &key, const std::string &value)
 This function is used to add the details describing the tuner reservation activity in to the activity list. More...
 
const ReservationCustomAttributesTRM::TunerReservationBase::getCustomAttributes (void) const
 This function is used to return the custom attributes assigned by the application. These attributes are associated with the reservation token for the lifetime of the reservation. More...
 
void TRM::TunerReservationBase::setCustomAttributes (ReservationCustomAttributes *)
 This function is used to set the attributes assigned by the application. These attributes are associated with the reservation token for the lifetime of the reservation. More...
 
virtual void TRM::TunerReservationBase::print (void) const
 This function is used to print the following attributes of tunerReservation token. More...
 
static const std::vector< const Enum< TunerState > * > & TRM::TunerState::getEnums (void)
 
 TRM::TunerState::TunerState (const Enum< TunerState > &state)
 
const Enum< TunerState > & TRM::TunerState::getState (void) const
 
virtual TunerState TRM::TunerState::operator+ (const Enum< Activity > &activity)
 
bool TRM::TunerState::operator== (const TunerState &that) const
 
bool TRM::TunerState::operator!= (const TunerState &that) const
 
void TRM::TunerState::print (void) const
 

Variables

static const Enum< ActivityTRM::Activity::kNone
 
static const Enum< ActivityTRM::Activity::kLive
 
static const Enum< ActivityTRM::Activity::kRecord
 
static const Enum< ActivityTRM::Activity::kEAS
 
static const char TRM::Header::kProtocol [4] = {'T','R', 'M', 'S'}
 
static const Enum< KlassTRM::Klass::kUnknown
 
static const Enum< KlassTRM::Klass::kDetails
 
static const Enum< KlassTRM::Klass::kActivity
 
static const Enum< KlassTRM::Klass::kTunerReservation
 
static const Enum< KlassTRM::Klass::kTunerState
 
static const Enum< KlassTRM::Klass::kResponseStatus
 
static const Enum< KlassTRM::Klass::kMessageBase
 
static const Enum< KlassTRM::Klass::kNoResponse
 
static const Enum< KlassTRM::Klass::kRequestBase
 
static const Enum< KlassTRM::Klass::kResponseBase
 
static const Enum< KlassTRM::Klass::kNotificationBase
 
static const Enum< KlassTRM::Klass::kSimpleTRMRequest
 
static const Enum< KlassTRM::Klass::kSimpleTRMResponse
 
static const Enum< KlassTRM::Klass::kReserveTuner
 
static const Enum< KlassTRM::Klass::kReserveTunerResponse
 
static const Enum< KlassTRM::Klass::kReleaseTunerReservation
 
static const Enum< KlassTRM::Klass::kReleaseTunerReservationResponse
 
static const Enum< KlassTRM::Klass::kValidateTunerReservation
 
static const Enum< KlassTRM::Klass::kValidateTunerReservationResponse
 
static const Enum< KlassTRM::Klass::kCancelRecording
 
static const Enum< KlassTRM::Klass::kCancelRecordingResponse
 
static const Enum< KlassTRM::Klass::kCancelLive
 
static const Enum< KlassTRM::Klass::kCancelLiveResponse
 
static const Enum< KlassTRM::Klass::kGetAllTunerIds
 
static const Enum< KlassTRM::Klass::kGetAllTunerIdsResponse
 
static const Enum< KlassTRM::Klass::kGetAllTunerStates
 
static const Enum< KlassTRM::Klass::kGetAllTunerStatesResponse
 
static const Enum< KlassTRM::Klass::kGetAllReservations
 
static const Enum< KlassTRM::Klass::kGetAllReservationsResponse
 
static const Enum< KlassTRM::Klass::kGetVersion
 
static const Enum< KlassTRM::Klass::kGetVersionResponse
 
static const Enum< KlassTRM::Klass::kGetAllConnectedDeviceIdsResponse
 
static const Enum< KlassTRM::Klass::kNotifyTunerReservationUpdate
 
static const Enum< KlassTRM::Klass::kNotifyTunerReservationRelease
 
static const Enum< KlassTRM::Klass::kNotifyTunerReservationConflicts
 
static const Enum< KlassTRM::Klass::kNotifyTunerStatesUpdate
 
static const Enum< KlassTRM::Klass::kNotifyTunerPretune
 
static const Enum< KlassTRM::Klass::kNotifyClientConnectionEvent
 
static const Enum< KlassTRM::Klass::kGetTRMConnectionEvents
 
static const Enum< KlassTRM::Klass::kUpdateTunerActivityStatus
 
static const Enum< KlassTRM::Klass::kUpdateTunerActivityStatusResponse
 
static const Enum< ResponseStatusTRM::ResponseStatus::kOk
 
static const Enum< ResponseStatusTRM::ResponseStatus::kGeneralError
 
static const Enum< ResponseStatusTRM::ResponseStatus::kMalFormedRequest
 
static const Enum< ResponseStatusTRM::ResponseStatus::kUnRecognizedRequest
 
static const Enum< ResponseStatusTRM::ResponseStatus::kInvalidToken
 
static const Enum< ResponseStatusTRM::ResponseStatus::kInvalidState
 
static const Enum< ResponseStatusTRM::ResponseStatus::kUserCancellation
 
static const Enum< ResponseStatusTRM::ResponseStatus::kInsufficientResource
 
static const Enum< TunerStateTRM::TunerState::kFree
 
static const Enum< TunerStateTRM::TunerState::kLive
 
static const Enum< TunerStateTRM::TunerState::kRecord
 
static const Enum< TunerStateTRM::TunerState::kHybrid
 
static const Enum< TunerStateTRM::TunerState::kEAS
 

Data Structure Documentation

◆ ReservationCustomAttributes

class ReservationCustomAttributes

Definition at line 38 of file ReservationCustomAttributes.h.

Collaboration diagram for ReservationCustomAttributes:
Collaboration graph

Public Member Functions

 ReservationCustomAttributes (json_t *jsonObject)
 
json_t * getObject (void) const
 

Private Attributes

json_t * jsonObject
 

◆ Tuner

class Tuner

Definition at line 43 of file Tuner.h.

Collaboration diagram for Tuner:
Collaboration graph

Public Types

typedef std::list< std::string > IdList
 
typedef std::map< std::string, TunerReservation > ReservationCT
 

Public Member Functions

 Tuner (const std::string &internalId)
 
const std::string & getId (void) const
 
uint64_t getEndTime (const Activity &activity) const
 
TunerReservation::TokenList & getReservationTokens (TunerReservation::TokenList &tokens) const
 
const TunerReservation & getReservation (const std::string &reservationToken) const
 
TunerReservation & getReservation (const std::string &reservationToken)
 
const TunerReservation & getReservation (const Activity &activity, int reservationState, const std::string &serviceLocator="") const
 
const TunerState getState (void) const
 
void setState (const TunerState &state)
 
const std::string getServiceLocator (bool considerFutureToken=true) const
 
void addReservation (const TunerReservation &reservation)
 
void releaseReservation (const std::string &reservationToken)
 

Private Member Functions

bool assertTunerState (int state, int lowMark, int highMark)
 

Private Attributes

std::string internalId
 
ReservationCT reservations
 

◆ SpecVersion

class SpecVersion

Definition at line 41 of file Util.h.

Collaboration diagram for SpecVersion:
Collaboration graph

Public Member Functions

 SpecVersion (int major_, int minor_)
 
const std::string toString () const
 
bool operator> (const SpecVersion &that) const
 

Private Member Functions

int toInt (void) const
 

Private Attributes

int major_
 
int minor_
 

Function Documentation

◆ getActivity() [1/2]

const Enum< Activity > & Activity::getActivity ( void  ) const

This function is used to return the request or granted usage of tuner. The Activity field represents the intended use of the tuner.

Returns
Supported tuner activity name are Live, Recording, or EAS.

Definition at line 89 of file Activity.cpp.

◆ hasDetails()

bool Activity::hasDetails ( void  ) const

This function is used to return true if the activity has the detailed field describing the activity, otherwise the function will return false.

Returns
Returns true if the tuner activity has a detailed field else will return false.

Definition at line 101 of file Activity.cpp.

◆ getDetail()

const std::string & Activity::getDetail ( const std::string &  key) const

This function will get the details of the recording. Each activity may be associated with a set of details describing the tuner activity.

Parameters
[in]keyrecording Id for which details to be extracted from the list.
Returns

Definition at line 114 of file Activity.cpp.

◆ addDetail() [1/2]

void Activity::addDetail ( const std::string &  key,
const std::string &  value 
)

This API is used to add the details describing the activity in to a list.

The field specified here are required for the associated activity. The requestor is allowed to insert unspecified fields in the details. These unspecified fields are ignored by TRM, and echoed back in response message that have the activity field.
The defined fields are:

  • recordingId : required when requesting Record activity for a tuner.
  • hot : flag (true or false) indicating of the recording is scheduled or hot.
Parameters
[in]keyit could be "recordingId" or "hot" when requesting Record activity for a tuner.
[in]valuevalue associated for recording.
Returns
None.

Definition at line 147 of file Activity.cpp.

◆ print() [1/2]

void Activity::print ( void  ) const

Print the list of recording(s) details which are being scheduled. The defined fields are,.

  • recordingId : required when requesting Record activity for a tuner.
  • hot : flag (true or false) indicating of the recording is scheduled or hot. This function is used for debugging.
    Returns
    None.

Definition at line 166 of file Activity.cpp.

◆ setReservationToken()

void TunerReservationBase::setReservationToken ( const std::string &  token)

This function is used to set a unique token generated when a reservation is created. After a reservation is created, this token is used in all messages to uniquely identify an existing reservation within TRM.

Parameters
[in]tokenA unique token that the requesting device can use to make the remote tuning request.
Returns
None.

Definition at line 71 of file TunerReservation.cpp.

◆ getReservationToken()

const std::string & TunerReservationBase::getReservationToken ( void  ) const

This function is used to return the unique token generated when a reservation is created.

Returns
Returns a token that the requesting device can use to make the remote tuning request.

Definition at line 83 of file TunerReservation.cpp.

◆ getServiceLocator()

const std::string & TunerReservationBase::getServiceLocator ( void  ) const

This function is used to return the locator of the service that the tuner is tuned to.

Returns
Returns a service locator in string format.

Definition at line 94 of file TunerReservation.cpp.

◆ getStartTime()

uint64_t TunerReservationBase::getStartTime ( void  ) const

This function is used to get the start time of the reservation in milliseconds from the epoch.

Returns
Returns a time in terms of milliseconds.

Definition at line 105 of file TunerReservation.cpp.

◆ getDuration()

uint64_t TunerReservationBase::getDuration ( void  ) const

This function is used to get the reservation period measured from the start in milliseconds.

Returns
Returns a time in terms of millisecond.

Definition at line 116 of file TunerReservation.cpp.

◆ getDevice()

const std::string & TunerReservationBase::getDevice ( void  ) const

This function is used to get the remote device id requesting for tuner reservation.

Returns
Returns the device Id in string format.

Definition at line 127 of file TunerReservation.cpp.

◆ getActivity() [2/2]

const Activity & TunerReservationBase::getActivity ( void  ) const

This function is used to return the granted activity. Granted activity may or may not be the same as the requested. In the later case the owner of the reservation will need to comply with the returned activity, or initiate conflict resolution.
For example, a client requests for Live activity when EAS is in progress, the returned reservation will have the EAS activity.

Returns
Returns a pointer to an object of class Activity.

Definition at line 142 of file TunerReservation.cpp.

◆ setServiceLocator()

void TunerReservationBase::setServiceLocator ( const std::string &  _serviceLocator)

This function is used to set the locator of the service that the tuner will tune to. The service locator is a URL containing tune parameters of the remote device.

Parameters
[in]serviceLocatorLocator of the service that the tuner will tune to.
Returns
None.

Definition at line 155 of file TunerReservation.cpp.

◆ setStartTime()

void TunerReservationBase::setStartTime ( const uint64_t &  startTime)

This function is used to set the start time of the reservation in milliseconds from the epoch. If the startTime not present a requested message, this is set to when the reservation is granted or renewed.

Note
The startTime is always included in a reservation response message.
Parameters
[in]startTimeTime in milliseconds from the epoch.
Returns
None.

Definition at line 169 of file TunerReservation.cpp.

◆ setDuration()

void TunerReservationBase::setDuration ( const uint64_t &  duration)

This function is used to set the reservation duration measured from the start in milliseconds. If the duration field not present in a request message, the token is valid for a default duration.

Note
The duration is always included in a reservation response message.
Parameters
[in]durationA time period measured from the start in milliseconds.
Returns
None.

Definition at line 183 of file TunerReservation.cpp.

◆ getExpirationTime()

uint64_t TunerReservationBase::getExpirationTime ( void  ) const

This function is used to return remaining tuner reservation time.

Returns
Returns a positive value means the reservation time is not yet expired. Returns 0 when tuner reservation time has expired.

Definition at line 195 of file TunerReservation.cpp.

◆ addDetail() [2/2]

void TunerReservationBase::addDetail ( const std::string &  key,
const std::string &  value 
)

This function is used to add the details describing the tuner reservation activity in to the activity list.

The field specified here are required for the associated activity. The requestor is allowed to insert unspecified fields in the details. These unspecified fields are ignored by TRM, and echoed back in response message that have the activity field.
The defined fields are:

  • recordingId : required when requesting Record activity for a tuner.
  • hot : flag (true or false) indicating of the recording is scheduled or hot.
Parameters
[in]keyit could be "recordingId" or "hot" when requesting Record activity for a tuner.
[in]valuevalue associated for key.
Returns
None.

Definition at line 222 of file TunerReservation.cpp.

◆ getCustomAttributes()

const ReservationCustomAttributes * TunerReservationBase::getCustomAttributes ( void  ) const

This function is used to return the custom attributes assigned by the application. These attributes are associated with the reservation token for the lifetime of the reservation.

Returns
Returns a pointer to an object of class ReservationCustomAttributes.

Definition at line 234 of file TunerReservation.cpp.

◆ setCustomAttributes()

void TunerReservationBase::setCustomAttributes ( ReservationCustomAttributes customAttributes)

This function is used to set the attributes assigned by the application. These attributes are associated with the reservation token for the lifetime of the reservation.

The customAttributes contains JSON entities defined by the application. It is sent by the application when it requests for a tuner reservation. After the reservation is granted, and as long as the content of the reservation is not modified, the customAttributes will be present in any messages, including the asynchronous notifications, that contains the corresponding TunerReservation.
If a renewd TunerReservation also contains customAttributes, the new attributes object will take the place.

See also
notifyTunerReservationUpdate()
Parameters
[in]customAttributesA set of attributes assigned by the application.
Returns
None.

Definition at line 255 of file TunerReservation.cpp.

◆ print() [2/2]

void TunerReservationBase::print ( void  ) const
virtual

This function is used to print the following attributes of tunerReservation token.

  • reservationToken = A unique token generated when a reservation is created.
  • device = The remote device requesting the reservation.
  • serviceLocator = The service locator that the tuner will tune to.
  • duration = The reservation period measured from the start in milliseconds.
Returns
None.

Definition at line 270 of file TunerReservation.cpp.