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

# SUID Look Up

**Header:** `utils/inc/suidLookUp.h`

## Structures

### `suidLookUp`

Utility class for discovering available sensors using dataytpe.

#### Functions

##### `suidLookUp`

creates a new connection to qsh for suid lookup

```cpp theme={null}
 suidLookUp(suidEventCb cb, int hubId=-1)
```

**Parameters**

<ParamField path="cb" type="suidEventCb">
  callback function for suids
</ParamField>

##### `~suidLookUp`

```cpp theme={null}
 ~suidLookUp()
```

##### `requestSuid`

look up the suid for a given datatype, registered callback will be called when suid is available for this datatype

```cpp theme={null}
void requestSuid(std::string datatype, bool defaultOnly=false)
```

**Parameters**

<ParamField path="datatype" type="std::string">
  data type for which suid is requested
</ParamField>

<ParamField path="default_only" type="">
  option to ask for publishing only default suid for the given data type. default value is false
</ParamField>

### `locate`

Utility class for synchronous sensor UID lookup operations.

#### Functions

##### `locate`

Default constructor for the locate class.

Initializes a new instance of the locate class for performing SUID lookup operations. The instance is prepared for a single lookup operation.

```cpp theme={null}
 locate()
```

##### `lookUp`

Performs synchronous lookup of sensor UIDs for a given datatype.

This method initiates a SUID lookup request for the specified datatype and blocks until either the lookup completes or the timeout expires. It returns a reference to a vector containing all discovered sensor UIDs for the datatype.

```cpp theme={null}
std::shared_ptr< std::vector< suid > > lookUp(const std::string &dataYype, int hubId=-1, std::chrono::milliseconds timeoutMs=DEFAULT_SUID_LOOKUP_TIMEOUT)
```

**Parameters**

<ParamField path="datatype" type="">
  The sensor datatype to lookup (e.g., "accel", "gyro", "mag")
</ParamField>

<ParamField path="hub_id" type="">
  The sensor hub ID to query. Use -1 for default hub (default: -1)
</ParamField>

<ParamField path="timeout_ms" type="">
  Maximum time to wait for lookup completion (default: 5000ms)
</ParamField>

**Returns**

Shared pointer to vector of sensor UIDs found for the specified datatype. Returns empty vector if no sensors found or timeout occurred.

## Type Definitions

### `suid`

```cpp theme={null}
typedef com::quic::sensinghub::suid suid
```

### `suidEventCb`

type alias for an suid event function

```cpp theme={null}
typedef std::function< void(const std::string &datatype, const std::vector< suid > &suids)> suidEventCb
```
