> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# URM Client APIs

## Functions

### `tuneResources`

Tune Resource Values for finite or finite duration.

```cpp theme={null}
int64_t tuneResources(int64_t duration, int32_t prop, int32_t numRes, SysResource *resourceList)
```

**Parameters**

<ParamField path="duration" type="int64_t">
  Duration (in milliseconds) to provision the Resources for. A value of -1 denotes infinite duration.
</ParamField>

<ParamField path="properties" type="">
  A 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).
</ParamField>

<ParamField path="numRes" type="int32_t">
  Number of Resources to be tuned as part of the Request
</ParamField>

<ParamField path="resourceList" type="SysResource *">
  List of Resources to be provisioned as part of the Request
</ParamField>

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

### `retuneResources`

Modify the duration of a previously issued Tune Request.

```cpp theme={null}
int8_t retuneResources(int64_t handle, int64_t duration)
```

**Parameters**

<ParamField path="handle" type="int64_t">
  Request Handle, returned by tuneResources.
</ParamField>

<ParamField path="duration" type="int64_t">
  The new duration for the previously issued Tune request. A value of -1 denotes infinite duration.
</ParamField>

**Returns**

int8\_t:

0: If the Request was successfully submitted to the server.

-1: Otherwise.

### `untuneResources`

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

```cpp theme={null}
int8_t untuneResources(int64_t handle)
```

**Parameters**

<ParamField path="handle" type="int64_t">
  Request Handle, returned by the tuneResources API call.
</ParamField>

**Returns**

int8\_t:

0: If the Request was successfully submitted to the server.

-1: Otherwise

### `getProp`

Gets a property from the Config Store.

```cpp theme={null}
int8_t getProp(const char *prop, char *buffer, size_t bufferSize, const char *defValue)
```

**Parameters**

<ParamField path="prop" type="const char *">
  Name of the Property to be fetched.
</ParamField>

<ParamField path="buffer" type="char *">
  A buffer to hold the result, i.e. the property value corresponding to the specified name.
</ParamField>

<ParamField path="bufferSize" type="size_t">
  Size of the buffer
</ParamField>

<ParamField path="defValue" type="const char *">
  Value to return in case a property with the specified Name is not found in the Config Store
</ParamField>

**Returns**

int8\_t:

0: If the Request was successfully Submitted to the Server.

-1: Otherwise

### `tuneSignal`

Tune the signal with the given ID.

```cpp theme={null}
int64_t tuneSignal(uint32_t sigId, uint32_t sigType, int64_t duration, int32_t properties, const char *appName, const char *scenario, int32_t numArgs, uint32_t *list)
```

**Parameters**

<ParamField path="sigId" type="uint32_t">
  A uniqued 32-bit (unsigned) identifier for the Signal
  The last 16 bits (17-32) are used to specify the SigID
  The next 8 bits (9-16) are used to specify the Signal Category
  In addition for Custom Signals, the MSB must be set to 1 as well
</ParamField>

<ParamField path="sigType" type="uint32_t">
  Type of the signal, useful for use-case based signal filtering and selection, i.e. in situations where multiple variants of the same core signal (with minor changes) need to exist to support different use-case scenarios. If no such filtering is needed, pass this field as 0.
  In addition for Custom Signals, the MSB must be set to 1 as well
</ParamField>

<ParamField path="duration" type="int64_t">
  Duration (in milliseconds) to provision the Resources for. A value of -1 denotes infinite duration.
</ParamField>

<ParamField path="properties" type="int32_t">
  A 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)
</ParamField>

<ParamField path="appName" type="const char *">
  Name of the Application that is issuing the Request
</ParamField>

<ParamField path="scenario" type="const char *">
  Name of the Scenario that is issuing the Request
</ParamField>

<ParamField path="numArgs" type="int32_t">
  Number of Additional Arguments to be passed as part of the Request
</ParamField>

<ParamField path="list" type="uint32_t *">
  List of Additional Arguments to be passed as part of the Request
</ParamField>

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

### `relaySignal`

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

```cpp theme={null}
int8_t relaySignal(uint32_t sigId, uint32_t sigType, int64_t duration, int32_t properties, const char *appName, const char *scenario, int32_t numArgs, uint32_t *list)
```

**Parameters**

<ParamField path="sigId" type="uint32_t">
  A uniqued 32-bit (unsigned) identifier for the Signal
  The last 16 bits (17-32) are used to specify the SigID
  The next 8 bits (9-16) are used to specify the Signal Category
  In addition for Custom Signals, the MSB must be set to 1 as well
</ParamField>

<ParamField path="sigType" type="uint32_t">
  Type of the signal, useful for use-case based signal filtering and selection, i.e. in situations where multiple variants of the same core signal (with minor changes) need to exist to support different use-case scenarios. If no such filtering is needed pass this field as 0.
</ParamField>

<ParamField path="duration" type="int64_t">
  Duration (in milliseconds)
</ParamField>

<ParamField path="properties" type="int32_t">
  A 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)
</ParamField>

<ParamField path="appName" type="const char *">
  Name of the Application that is issuing the Request
</ParamField>

<ParamField path="scenario" type="const char *">
  Name of the Scenario that is issuing the Request
</ParamField>

<ParamField path="numArgs" type="int32_t">
  Number of Additional Arguments to be passed as part of the Request
</ParamField>

<ParamField path="list" type="uint32_t *">
  List of Additional Arguments to be passed as part of the Request
</ParamField>

**Returns**

int8\_t:

0: If the Request was successfully sent to the server.

-1: Otherwise

### `untuneSignal`

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

```cpp theme={null}
int8_t untuneSignal(int64_t handle)
```

**Parameters**

<ParamField path="handle" type="int64_t">
  Request Handle, returned by the tuneSignal API call.
</ParamField>

**Returns**

int8\_t:

0: If the Request was successfully sent to the server.

-1: Otherwise

### `retuneSignal`

Modify the duration of a previously issued Tune Signal (tuneSignal).

```cpp theme={null}
int8_t retuneSignal(int64_t handle, int64_t duration)
```

**Parameters**

<ParamField path="handle" type="int64_t">
  Request Handle, returned by tuneSignal API call.
</ParamField>

<ParamField path="duration" type="int64_t">
  The new duration for the previously issued Tune request. A value of -1 denotes infinite duration.
</ParamField>

**Returns**

int8\_t:

0: If the Request was successfully submitted to the server.

-1: Otherwise.
