# Qualcomm sensing hub architecture If you’re familiar with the Qualcomm sensing hub (QSH) terminology, architecture, and components, and intend to work with QSH APIs or set up sensor information, then see [Qualcomm sensing hub APIs](https://docs.qualcomm.com/doc/80-70030-7/topic/qsh_api_reference.html#qsh-api-reference). Note Source code of the low-power application digital signal processor (aDSP), including the QSH framework, is available only to licensed users with authorized access. To upgrade your access, see [Working with Qualcomm](https://www.qualcomm.com/support/working-with-qualcomm). QSH is also known as Qualcomm® Snapdragon™ sensor core (SSC) that offers a unified event-driven framework for drivers and algorithms. QSH supports the same set of APIs for both the hardware-based and software-based sensors. Additionally, QSH supports asynchronous bus transfer and is extendable for new or custom driver features. QSH consists of the following components: > > > - QSH client APIs > - Sensor APIs > - Core framework > - Pre-implemented platform sensors > - Vendor-implemented sensors > - Test modules QSH serves external client applications and provides an interface to access sensor data. The following table describes the terms used in the QSH framework: Table : QSH terminology | **Term** | **Description** | | --- | --- | | Sensor | | | Sensor instance | | | Sensor unique identifier (SUID) | A unique 128‑bit ID for each sensor. | | Service | A module that provides a synchronous interface for common utilities. | | Data stream | A unique connection between a client and data source. | | Request | A configuration message that a client sends to a sensor (see `sns_request.h` file). | | Event | Asynchronous output data message that a sensor instance generates (see `sns_sensor_event.h` file). | | Nanopb | A small code-size protocol buffer implemented in ANSI C. | The following figure shows the QSH architecture: **Figure: QSH architecture** The QSH framework includes the following components: - Application processor software modules - Client application: It has the *application main()* or *entry function* that interacts with the QSH client APIs on the application processor side. - QSH client APIs: It offers high-level APIs to access services offered by QSH. It simplifies application development by abstracting system complexities and focusing on the application logic. For more information, see [Qualcomm sensing hub APIs](https://docs.qualcomm.com/doc/80-70030-7/topic/qsh_api_reference.html#qsh-api-reference). - Low-power processor software modules - Client manager: The client manager is in charge of all communications of the low-power processor with the application processor. The following table describes key functionality of the client manager: Table : Client manager functions | Function | Description | | --- | --- | | Translate incoming requests | The client manager takes incoming requests and translates them into the nanopb protocol buffer format that the QSH can understand. For more information, see [Nanopb protocol buffer in QSH](https://docs.qualcomm.com/doc/80-70030-7/topic/architecture.html#nanopb-protocol-buffer-in-qsh). | | Translate outgoing indications | The client manager receives event messages from the QSH and translates these event messages into outgoing indications in the nanopb protocol format that’s understandable outside the QSH. For more information, see [Nanopb protocol buffer in QSH](https://docs.qualcomm.com/doc/80-70030-7/topic/architecture.html#nanopb-protocol-buffer-in-qsh). | | Guarantees batching options | If a client specifies certain batching (store/accumulate locally) options, the client manager ensures that they meet the batching options. The client manager checks that the data is grouped and sent in the same way that the client has specified, ensuring compliance with the criteria. | - Service manager: QSH offers synchronous services through service manager. The sensor and sensor instance use a callback to connect to the service manager. The `adsp_proc/qsh_platform/inc/sns_service.h` file lists the QSH services. The `adsp_proc` repository is downloaded as a part of the build process. For more information, see [Software build documentation](https://docs.qualcomm.com/bundle/publicresource/topics/80-70030-254). The following table describes the key QSH services that are essential for device drivers: Table : QSH services | QSH service | Description | | --- | --- | | Stream service | | | Attribute service | | | Diagnostic service | | | Event service | | | Power rail service | | | Synchronous COM port (SCP) service | | | General purpose IO (GPIO) service | | | Island service | | | File system service | | - Platform sensor: QSH provides certain built-in sensors for platform or hardware-specific abstraction that other sensors and sensor instances can use. The following table describes the platform sensors: Table : Platform sensors | Platform sensor | Description | | --- | --- | | Registry sensor | | | Timer sensor | | | Interrupt sensor | | | Asynchronous COM port (ASCP) sensor |

Note


The ASCP sensor is typically used by physical sensor drivers to read large first-in-first-out (FIFO). | | SUID lookup sensor | | | Test sensor | | - QSH utilities: QSH provides several helper utilities for sensors and sensor instances. All the utilities are available in the `adsp_proc/qsh_platform/inc/utils` directory. The following table describes the key QSH utilities: Table : QSH utilities | QSH utility | Description | | --- | --- | | Nanopb encode/decode | | | Sensor utils | | | Attribute utils | | | Memory utils | | | Math utils | | | Printf utils | | ## Sensor and sensor instances QSH divides the sensor implementation in two logical units: sensor and sensor instance. - Sensors are producers, consumers, or a combination of producers and consumers of asynchronous data. - Each sensor can have one or more sensor instances. - Any request to a sensor for data results in the creation of a sensor instance or sharing of an existing sensor instance. - The sensor creates sensor instances on demand. - Sensors manage the lifecycle and configuration of their corresponding instances, and sends configuration updates and initial state events to their clients. - Each sensor instance operates with a specific client configuration. - The sensor instance of a physical sensor programs the sensor hardware to operate at required configuration. - Vendors must serve all client requests with a minimal number of sensor instances. - The sensor instance generates and sends a stream of data to all the active clients. - Many sensors can share and configure a single sensor instance. This mode of operation is typical to a combo driver for hardware sensors, such as the following: - Accelerometer and gyroscope - Proximity and ambient light ### Communication among sensors Every algorithm and sensor driver within the QSH framework is called a sensor. Information exchanged across these sensors is necessary for use cases, such as pedometer and tilt-to-wake. All communication to, from, and among the sensors is performed through the request and event messages over data streams. The message payloads are defined in the protocol buffer format, using the nanopb generator, encoder, and decoder. The message payload length, message ID, and timestamp (for events) are communicated within the metadata managed by the QSH framework. The following figure shows the communication between the data client and the data source, using the data stream: PB Encode/Decode Data client Request E vent Data stream PB Encode/Decode Data source Third-party **Figure: Sensor communication between data client and data source** - The client sends request messages to enable, disable, and reconfigure a sensor. Request messages are always addressed to a specific SUID. After the target sensor receives the request message, it sends the request to the sensor instance for proper handling. - Sensor instances send event messages asynchronously to their registered clients, which can be other sensors or sensor instances. ### Nanopb protocol buffer in QSH The QSH uses nanopb protocol buffer for the following scenarios: - To exchange request and event messages between sensors using the nanopb protocol format: - A sensor or sensor instance must encode the payload (if present) for all requests it sends to its dependents. - A sensor or sensor instance must decode the payload (if present) for all requests it receives. - A sensor or sensor instance must encode the payload (if present) for all events it publishes. - A sensor or sensor instance must decode the payload (if present) for all events it receives from its dependents. > > > Note > > > Certain requests or events don’t have a message body. In this case, decoding or encoding the payload isn’t expected, and the sensor processes these messages based on their message ID. - To represent the attribute data: - All attribute values are in the nanopb-encoded format. - To transmit the diagnostic log packet payloads: - All payloads in the diagnostic log packets are in the nanopb-encoded format. Note For more information about protocol buffers, see [Protocol-buffers](https://developers.google.com/protocol-buffers/) and [nanopb](https://jpa.kapsi.fi/nanopb/). ### Sensor API messages The `.proto` files specifies the API messages, which contain the protocol buffer message definitions, and documentation that allow communication between sensors. The following table lists the API standard messages defined in the `/build-qcom-wayland/workspace/sources/sensinghub/sensing-hub/apis/proto/sns_std_*.proto` files. Here, `` specifies your working directory. > > > Table : Standard proto files > > > | File | Description | > | --- | --- | > | `sns_std.proto` | This file includes the following standard definitions:



>
>
> | > | `sns_std_sensor.proto` | This file includes the following definitions:



>
>
> | > | `sns_std_type.proto` | This file includes the following common API-type definitions:



>
>
> | > | `sns_std_event_gated_sensor.proto` | This file includes the API for event gated sensors, encompassing the configuration message ID and API documentation. | - Physical sensor-specific API definitions and documentation are in the sensor-specific `.proto` files, such as `sns_accel.proto`, `sns_proximity.proto`, and `sns_motion_detect.proto`. - The QSH platform sensor API definitions and documentation are in the files, such as `sns_timer.proto`, `sns_interrupt.proto`, and `sns_async_com_port.proto` in the `adsp_proc/qsh_platform/api/` directory. - The framework-related APIs for SUID, registry, and diagnostics are in the `sns_suid.proto`, `sns_registry.proto`, and `sns_diag.proto` files, respectively. **Next steps** > > > [Qualcomm sensing hub APIs](https://docs.qualcomm.com/doc/80-70030-7/topic/qsh_api_reference.html#qsh-api-reference) Last Published: Jun 15, 2026 [Previous Topic Sensors overview](https://docs.qualcomm.com/bundle/publicresource/80-70030-7/topics/overview.md) [Next Topic Qualcomm sensing hub APIs](https://docs.qualcomm.com/bundle/publicresource/80-70030-7/topics/qsh_api_reference.md)