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

# GSL Dls Client Interface

> Defines a set of APIs that the realtime tuning client can use to register log codes and recieve log packet data from the gsl dls client.

**Header:** `gsl/dls_client_api/gsl_dls_client_intf.h`

## Structures

### `gsl_dls_ready_buffer_index_list_t`

**Members**

<ParamField path="buffer_count" type="uint16_t" />

<ParamField path="buffer_index_list" type="uint16_t" />

### `gsl_dls_buffer_pool_config_t`

**Members**

<ParamField path="buffer_size" type="uint32_t" />

<ParamField path="buffer_count" type="uint32_t" />

### `gls_dls_buffer_t`

**Members**

<ParamField path="size" type="uint32_t" />

<ParamField path="buffer" type="uint8_t *" />

## Functions

### `gsl_dls_client_is_feature_supported`

Checks if the DLS feature is enabled in GSL \detdesc feature needs to be enabled by defining ATS\_DATA\_LOGGING in your build configuration.

```cpp theme={null}
int32_t gsl_dls_client_is_feature_supported()
```

**Returns**

AR\_EOK on success, AR\_EUNSUPPORTED otherwise

### `gsl_dls_client_init`

Initializes the DLS Client.

```cpp theme={null}
int32_t gsl_dls_client_init(struct gsl_dls_buffer_pool_config_t *buffer_pool_config, GSL_DLS_CLIENT_BUFFER_READY_CALLBACK callback)
```

**Parameters**

<ParamField path="buffer_pool_config" type="struct gsl_dls_buffer_pool_config_t *">
  configuration used to setup the dls buffer pool size.
</ParamField>

<ParamField path="callback" type="GSL_DLS_CLIENT_BUFFER_READY_CALLBACK">
  callback function that is called when SPF notifies the DLS client about buffers that are ready to read.
</ParamField>

**Returns**

AR\_EOK on success, error otherwise

### `gsl_dls_client_deinit`

Cleans up resources aquired during gsl\_dls\_client\_init(...)

```cpp theme={null}
int32_t gsl_dls_client_deinit()
```

**Returns**

AR\_EOK on success, error otherwise

### `gsl_dls_client_create_buffer_pool`

Allocates and configures shared memory for storing log buffers and registers for log buffer commit notifications from DLS on SPF.

```cpp theme={null}
int32_t gsl_dls_client_create_buffer_pool(struct gsl_dls_buffer_pool_config_t *buffer_pool_config)
```

**Parameters**

<ParamField path="buffer_pool_config" type="struct gsl_dls_buffer_pool_config_t *">
  contains the number of DLS Log Buffers and the size of each buffer
</ParamField>

**Returns**

AR\_EOK on success, error otherwise

### `gsl_dls_client_get_ready_dls_buffer_list`

Retrieves a list of buffers index for dls buffers that are ready to read from.

```cpp theme={null}
void gsl_dls_client_get_ready_dls_buffer_list(struct gsl_dls_ready_buffer_index_list_t *buffer_ready_list)
```

**Parameters**

<ParamField path="buffer_ready_list" type="struct gsl_dls_ready_buffer_index_list_t *" />

**Returns**

AR\_EOK on success, error otherwise

### `gsl_dls_client_get_log_buffer`

Gets a log buffer from the dls buffer pool.

```cpp theme={null}
int32_t gsl_dls_client_get_log_buffer(uint32_t log_buffer_index, struct gls_dls_buffer_t *dls_log_buffer)
```

**Parameters**

<ParamField path="buffer_index_read" type="">
  the index of the buffer to read from the dls buffer pool
</ParamField>

<ParamField path="dls_log_buffer" type="struct gls_dls_buffer_t *">
  contains the size of the log buffer and a pointer to the buffer in the shared memory buffer pool
</ParamField>

**Returns**

AR\_EOK on success, error otherwise

### `gsl_dls_client_set_used_buffers`

Stores used log buffers in gsl dsl client context.

```cpp theme={null}
void gsl_dls_client_set_used_buffers(struct gsl_dls_ready_buffer_index_list_t *buffer_index_list)
```

**Parameters**

<ParamField path="buffer_index_list" type="struct gsl_dls_ready_buffer_index_list_t *">
  list of buffers to be stored
</ParamField>

### `gsl_dls_client_return_used_buffers`

Returns used DLS buffers back to SPF.

```cpp theme={null}
int32_t gsl_dls_client_return_used_buffers(struct gsl_dls_ready_buffer_index_list_t *buffer_index_list)
```

**Parameters**

<ParamField path="buffer_index_list" type="struct gsl_dls_ready_buffer_index_list_t *">
  the list of buffers to return to DLS on SPF
</ParamField>

**Returns**

AR\_EOK on success, error otherwise

### `gsl_dls_client_register_deregister_log_code`

Registers or deregisters a log code.

Registered log codes will start to accumulate binary buffers in SPFs DLS

```cpp theme={null}
int32_t gsl_dls_client_register_deregister_log_code(uint32_t log_code, bool_t is_log_code_enabled)
```

**Parameters**

<ParamField path="log_code" type="uint32_t">
  The log code to register/de-register
</ParamField>

<ParamField path="is_log_code_enabled:true" type="">
  for registering a log code and false for de-registering
</ParamField>

**Returns**

AR\_EOK on success, error otherwise

## Type Definitions

### `GSL_DLS_CLIENT_BUFFER_READY_CALLBACK`

callback function that is called when SPF notifies the DLS client about buffers that are ready to read.

```cpp theme={null}
typedef int32_t(* GSL_DLS_CLIENT_BUFFER_READY_CALLBACK
```

## Macros

### `GSL_DLS_CLIENT_MIN_BUFFER_COUNT`

```c theme={null}
#define GSL_DLS_CLIENT_MIN_BUFFER_COUNT 10
```

### `GSL_DLS_CLIENT_MAX_BUFFER_COUNT`

```c theme={null}
#define GSL_DLS_CLIENT_MAX_BUFFER_COUNT 256
```
