Resource Tuner
Loading...
Searching...
No Matches
Client APIs

Functions

int64_t tuneResources (int64_t duration, int32_t prop, int32_t numRes, SysResource *resourceList)
 Tune Resource Values for finite or finite duration.
 
int8_t retuneResources (int64_t handle, int64_t duration)
 Modify the duration of a previously issued Tune Request.
 
int8_t untuneResources (int64_t handle)
 Release (or free) the Request with the given handle.
 
int8_t getProp (const char *prop, char *buffer, size_t bufferSize, const char *defValue)
 Gets a property from the Config Store.
 
int64_t tuneSignal (uint32_t signalCode, int64_t duration, int32_t properties, const char *appName, const char *scenario, int32_t numArgs, uint32_t *list)
 Tune the signal with the given ID.
 
int8_t relaySignal (uint32_t signalCode, int64_t duration, int32_t properties, const char *appName, const char *scenario, int32_t numArgs, uint32_t *list)
 Relay the signal to all the features subscribed to the signal with the given ID.
 
int8_t untuneSignal (int64_t handle)
 Release (or free) the signal with the given handle.
 

Detailed Description

Resource Tuner's Client-Facing APIs.

Function Documentation

◆ getProp()

int8_t getProp ( const char *  prop,
char *  buffer,
size_t  bufferSize,
const char *  defValue 
)

Gets a property from the Config Store.

Use this API to fetch a Property by it's name, all the properties are Parsed during Resource Tuner Server initialization.

Parameters
propName of the Property to be fetched.
bufferA buffer to hold the result, i.e. the property value corresponding to the specified name.
bufferSizeSize of the buffer
defValueValue to return in case a property with the specified Name is not found in the Config Store
Returns
int8_t:
  • 0: If the Request was successfully Submitted to the Server.
  • -1: Otherwise

Note
The result of the Query itself is stored in the buffer (IN / OUT arg).

◆ relaySignal()

int8_t relaySignal ( uint32_t  signalCode,
int64_t  duration,
int32_t  properties,
const char *  appName,
const char *  scenario,
int32_t  numArgs,
uint32_t *  list 
)

Relay the signal to all the features subscribed to the signal with the given ID.

Use this API to issue Signal Relay Requests.

Parameters
signalCodeA uniqued 32-bit (unsigned) identifier for the Signal
durationDuration (in milliseconds)
propertiesA 32 bit signed Integer storing the Properties of the Request.
  • The last 8 bits [25 - 32] store the Request Priority (HIGH / LOW). Defaults to HIGH (0)
  • The Next 8 bits [17 - 24] represent a Bitmask, which indicates The Device modes in which the Request should be processed (Modes: display on / dispaly off / doze), If the device is currently in one of the modes specified via the mask, only then will the request be processed. Defaults to DISPLAY_ON (0)
appNameName of the Application that is issuing the Request
scenarioName of the Scenario that is issuing the Request
numArgsNumber of Additional Arguments to be passed as part of the Request
listList of Additional Arguments to be passed as part of the Request
Returns
int8_t:
  • 0: If the Request was successfully sent to the server.
  • -1: Otherwise

◆ retuneResources()

int8_t retuneResources ( int64_t  handle,
int64_t  duration 
)

Modify the duration of a previously issued Tune Request.

Use this API to increase the duration (in milliseconds) of an existing Request issued via.

Parameters
handleRequest Handle, returned by tuneResources.
durationThe new duration for the previously issued Tune request. A value of -1 denotes infinite duration.
Returns
int8_t:
  • 0: If the Request was successfully submitted to the server.
  • -1: Otherwise.
Examples
CoreAPIsExamples.cpp.

◆ tuneResources()

int64_t tuneResources ( int64_t  duration,
int32_t  prop,
int32_t  numRes,
SysResource resourceList 
)

Tune Resource Values for finite or finite duration.

Use this API to issue Resource Provisioning / Tuning Requests.

Parameters
durationDuration (in milliseconds) to provision the Resources for. A value of -1 denotes infinite duration.
propertiesA 32 bit signed Integer storing the Properties of the Request.
  • The last 8 bits [25 - 32] store the Request Priority (HIGH / LOW)
  • The Next 8 bits [17 - 24] represent a Boolean Flag, which indicates if the Request should be processed in the background (in case of Display Off or Doze Mode).
numResNumber of Resources to be tuned as part of the Request
resourceListList of Resources to be provisioned as part of the Request
Returns
int64_t:
  • A Positive Integer Handle which uniquely identifies the issued Request. The handle is used for future retune / untune APIs.
  • -1: If the Request could not be sent to the server.
Examples
CoreAPIsExamples.c, and CoreAPIsExamples.cpp.

◆ tuneSignal()

int64_t tuneSignal ( uint32_t  signalCode,
int64_t  duration,
int32_t  properties,
const char *  appName,
const char *  scenario,
int32_t  numArgs,
uint32_t *  list 
)

Tune the signal with the given ID.

Use this API to issue Signal Provisioning Requests, for a certain duration of time.

Parameters
signalCodeA uniqued 32-bit (unsigned) identifier for the Signal
durationDuration (in milliseconds) to provision the Resources for. A value of -1 denotes infinite duration.
propertiesA 32 bit signed Integer storing the Properties of the Request.
  • The last 8 bits [25 - 32] store the Request Priority (HIGH / LOW). Defaults to HIGH (0)
  • The Next 8 bits [17 - 24] represent a Bitmask, which indicates The Device modes in which the Request should be processed (Modes: display on / dispaly off / doze), If the device is currently in one of the modes specified via the mask, only then will the request be processed. Defaults to DISPLAY_ON (0)
appNameName of the Application that is issuing the Request
scenarioName of the Scenario that is issuing the Request
numArgsNumber of Additional Arguments to be passed as part of the Request
listList of Additional Arguments to be passed as part of the Request
Returns
int64_t:
  • A Positive Unique Handle to identify the issued Request. The handle is used for freeing the Provisioned signal later.
  • -1: If the Request could not be sent to the server.
Examples
SignalAPIsExamples.cpp.

◆ untuneResources()

int8_t untuneResources ( int64_t  handle)

Release (or free) the Request with the given handle.

Use this API to issue Signal De-Provisioning Requests.

Parameters
handleRequest Handle, returned by the tuneResources API call.
Returns
int8_t:
  • 0: If the Request was successfully submitted to the server.
  • -1: Otherwise
Examples
CoreAPIsExamples.cpp.

◆ untuneSignal()

int8_t untuneSignal ( int64_t  handle)

Release (or free) the signal with the given handle.

Use this API to issue Signal De-Provisioning Requests

Parameters
handleRequest Handle, returned by the tuneSignal API call.
Returns
int8_t:
  • 0: If the Request was successfully sent to the server.
  • -1: Otherwise