# Platform Sensors

## Async Com port

Asynchronous Com Port

The Asynchronous Com Port provides access to buses like I2C, I3C, SPI and others. A complete list of all buses available in the sns\_async\_com\_port\_bus\_type enum.

The Asynchronous Com Port can perform read and write operations on these buses asynchronously. This is the recommended way to perform large bus reads (example: reading a large FIFO buffer). This file describes the use of the async com port (ascp) API.

First, the client must configure the port using the [sns\_async\_com\_port\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__async__com__port__config) message.

To perform one or more read or write operations, the client should send the [sns\_async\_com\_port\_vector\_rw](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__async__com__port__vector__rw) message.

A single [sns\_async\_com\_port\_vector\_rw](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__async__com__port__vector__rw) message can contain multiple [sns\_async\_com\_port\_vector](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__async__com__port__vector) messages, the async com port will efficiently perform all the transactions that are part of the parent [sns\_async\_com\_port\_vector\_rw](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__async__com__port__vector__rw) message. The results of the transaction will be sent as an [sns\_async\_com\_port\_vector\_rw](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__async__com__port__vector__rw) event.

The async com port will internally manage efficiently opening and closing the bus power lines and clock settings. The async com port can safely be used along with the synchronous com port service.

To help with encoding and decoding the [sns\_async\_com\_port\_vector\_rw](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__async__com__port__vector__rw) messages, utility functions are provided in sns\_async\_com\_port\_pb\_utils.h

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “async\_com\_port”
2. SNS\_STD\_SENSOR\_ATTRID\_API “sns\_async\_com\_port.proto”

*Processing Stream Requests:*

1. SNS\_ASYNC\_COM\_PORT\_MSGID\_SNS\_ASYNC\_COM\_PORT\_CONFIG is used to enable the sensor.

Enums

- enum sns\_async\_com\_port\_operation\_type

    - The operation to be performed by the async com port.

*Values:*

- enumerator SNS\_ASYNC\_COM\_PORT\_OPERATION\_TYPE\_READ

    - Perform the read option by the async com port.

- enumerator SNS\_ASYNC\_COM\_PORT\_OPERATION\_TYPE\_WRITE

    - Perform the write option by the async com port.

- enum sns\_async\_com\_port\_bus\_type

    - The bus type to be accessed by the async com port.

*Values:*

- enumerator SNS\_ASYNC\_COM\_PORT\_BUS\_TYPE\_I2C

    - I2C bus:

- enumerator SNS\_ASYNC\_COM\_PORT\_BUS\_TYPE\_SPI

    - SPI bus:

- enumerator SNS\_ASYNC\_COM\_PORT\_BUS\_TYPE\_I3C\_SDR

    - I3C bus, standard data rate:

- enumerator SNS\_ASYNC\_COM\_PORT\_BUS\_TYPE\_I3C\_HDR\_DDR

    - I3C bus, double data rate:

- enumerator SNS\_ASYNC\_COM\_PORT\_BUS\_TYPE\_I3C\_I2C\_LEGACY

    - I3C bus, legacy I2C device attached to I3C bus:

- enum sns\_async\_com\_port\_reg\_addr\_type

    - The registry address type to be used by async com port.

*Values:*

- enumerator SNS\_ASYNC\_COM\_PORT\_REG\_ADDR\_TYPE\_8\_BIT

    - 8 bit registry address type to be used by async com port.

- enumerator SNS\_ASYNC\_COM\_PORT\_REG\_ADDR\_TYPE\_16\_BIT

    - 16 bit registry address type to be used by async com port.

- enumerator SNS\_ASYNC\_COM\_PORT\_REG\_ADDR\_TYPE\_32\_BIT

    - 32 bit registry address type to be used by async com port.

- enum sns\_acp\_qup\_type

    - *Values:*

- enumerator SNS\_ACP\_SSC\_QUP

    - 

- enumerator SNS\_ACP\_TOP\_QUP

    -

- enum sns\_async\_com\_port\_msgid

    - Async com port Message IDs.

*Values:*

- enumerator SNS\_ASYNC\_COM\_PORT\_MSGID\_SNS\_ASYNC\_COM\_PORT\_CONFIG

    - 

- enumerator SNS\_ASYNC\_COM\_PORT\_MSGID\_SNS\_ASYNC\_COM\_PORT\_VECTOR\_RW

    - 

- enumerator SNS\_ASYNC\_COM\_PORT\_MSGID\_SNS\_ASYNC\_COM\_PORT\_ERROR

    - 

- enumerator SNS\_ASYNC\_COM\_PORT\_MSGID\_SNS\_ASYNC\_COM\_PORT\_REG

    -

- struct sns\_async\_com\_port\_config

    - Public Members

- required sns\_async\_com\_port\_bus\_type bus\_type

    - The bus type.

- required fixed32 slave\_control

    - Slave Address for I2C. Dynamic slave address for I3C. Chip Select for SPI.

- required sns\_async\_com\_port\_reg\_addr\_type reg\_addr\_type

    - Register address type for the slave.

- required fixed32 min\_bus\_speed\_kHz

    - Minimum bus clock supported by slave in kHz.

- required fixed32 max\_bus\_speed\_kHz

    - Maximum bus clock supported by slave in kHz.

- required fixed32 bus\_instance

    - Platform bus instance number (BLSP number).

- optional fixed32 qup\_instance

    - QUP instance.

- optional sns\_acp\_qup\_type qup\_type

    - QUP\_type whether SSC or top level.

- optional uint32 manufacturer\_id

    - Manufacturer ID of I3C slave.

- optional uint32 provisional\_id

    - Provisional ID of I3C slave.

- struct sns\_async\_com\_port\_vector

    - Public Members

- required sns\_async\_com\_port\_operation\_type operation

    - Read or write operation.

- required fixed32 reg\_addr

    - Register address.

- optional fixed32 num\_bytes

    - Number of bytes to read or write. The async com port will ignore this field for a write operation and use the size of the buffer present in the message.

For events generated by the async com port, this field will always match the size of the buffer when it is present.

- optional bytes buffer

    - Buffer The async com port will ignore this field in a request for a read operation.

- struct sns\_async\_com\_port\_vector\_rw

    - Public Members

- required fixed32 num\_vectors

    - Number of operations.

- repeated sns\_async\_com\_port\_vector vectors

    - Read/write operations.

- struct sns\_async\_com\_port\_error

    - Public Members

- required fixed32 reg\_addr

    - Register address.

- required fixed32 num\_bytes

    - Number of bytes that was to be read/written.

- required sns\_std\_error error\_code

    - Error code.

## Async Uart

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “async\_uart”
2. SNS\_STD\_SENSOR\_ATTRID\_API: “sns\_async\_uart.proto”
3. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE:

*Processing Stream Requests:*

1. SNS\_ASYNC\_UART\_MSGID\_SNS\_ASYNC\_UART\_CONFIG is used to enable the sensor.

Enums

- enum sns\_async\_uart\_msgid

    - Message IDs.

*Values:*

- enumerator SNS\_ASYNC\_UART\_MSGID\_SNS\_ASYNC\_UART\_CONFIG

    - 

- enumerator SNS\_ASYNC\_UART\_MSGID\_SNS\_ASYNC\_UART\_TX\_RX\_BUFFER

    - 

- enumerator SNS\_ASYNC\_UART\_MSGID\_SNS\_ASYNC\_UART\_ACK\_EVENT

    -

- struct sns\_async\_uart\_config

    - Currently, there can only be one client per async UART instance.

Public Members

- required fixed32 port\_id

    - UART Port Instance.

- optional fixed32 baud\_rate [default=460800]

    - Baud Rate.

- optional fixed32 rx\_buffer\_length [default=128]

    - Receive Buffer Length This should be set to the maximum amount of bytes the client expects to receive in a single transaction. If this field isn’t set correctly, the client risks dropping some of the received data.

- struct sns\_async\_uart\_tx\_rx\_buffer

    - Public Members

- required bytes buffer

    - Buffer.

- optional fixed32 transaction\_id

    - Transaction ID This is an identifier that can be used to track the transaction.

- struct sns\_async\_uart\_ack\_event

    - Public Members

- required sns\_std\_error error\_code

    - Error code.

- optional fixed32 transaction\_id

    - Transaction ID This field is set to the same value as the transaction\_id set in the associated TX/RX buffer message. If the transaction\_id wasn’t set for the associated TX/RX buffer message then this field will not be set either.

## Batch

Batch Sensor will batch events coming from requested sensor in power efficient memory.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “batch”
2. SNS\_STD\_SENSOR\_ATTRID\_API: “sns\_batch.proto”
3. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_ON\_CHANGE

*Processing Stream Requests:*

1. SNS\_BATCH\_MSGID\_SNS\_BATCH\_CONFIG is used to enable the sensor. Batch Sensor will relay all requests besides SNS\_BATCH\_MSGID\_SNS\_BATCH\_CONFIG to the underlying sensor. Any requests received before a valid SNS\_BATCH\_MSGID\_SNS\_BATCH\_CONFIG will be rejected.
2. SNS\_STD\_MSGID\_SNS\_STD\_FLUSH\_REQ supported by the batch sensor as defined in sns\_std.proto. It relays the flush request to the underlying sensor and after flushing is complete reports a SNS\_STD\_MSGID\_SNS\_STD\_FLUSH\_EVENT.
3. The request\_payload is the same as the payload in sns\_std\_request destined for the suid and the msg\_id must correspond to this request. The Batch sensor composes a sns\_std\_request containing all the settings provided to it and places the request\_payload within it to send it to the underlying suid.

*Publishing Stream Events:*

1. Batch Sensor only batches events with message ids specified in batch\_msg\_ids. Upon receiving an event with any other message id, it will flush all batched data to the client.
2. Batch\_period is used to set the minimum time between consecutive events sent to the client, meaning an event shouldn’t be generated until batch\_period usec has elapsed since the last event, even if new data is received from the sensor. Events may be sent faster than specified batch\_period in certain scenarios, for e.g. receiving non batch\_msg\_id events or to avoid dropping messages if data is received at high frequency. The Batch Sensor only supports the required parameters in the batch\_spec. Any batch requests with batch period less than the minimum supported batch period would be converted to streaming requests.
3. Associated message ID : SNS\_BATCH\_MSGID\_SNS\_BATCH\_COMPLETE\_EVENT Batch sensor will append “sns\_batch\_complete” complete event at the end of every batch.

Enums

- enum sns\_batch\_msgid

    - Batch sensor message ID.

*Values:*

- enumerator SNS\_BATCH\_MSGID\_SNS\_BATCH\_CONFIG

    - This field is used to enable the sensor.

- enumerator SNS\_BATCH\_MSGID\_SNS\_BATCH\_COMPLETE\_EVENT

    - Batch sensor will append “sns\_batch\_complete” complete event at the end of every batch.

- struct sns\_batch\_config

    - Public Members

- required sns\_std\_suid suid

    - UID of the Sensor to be batched.

- repeated fixed32 batch\_msg\_ids [10]

    - Msg Ids of the underlying sensor to be batched.

- struct sns\_batch\_complete

    -

## Client Batch

The Client Batch Sensor stores events of the requested Sensor Type in DDR along with UTC Time and Time Zone information. It delivers them to the client on request at a later point.

The first stage of batching is done by Batch Sensor followed by second stage batching in Client Batch Sensor.

The target sensor is identified by the SUID provided as part of the request. Each instance of the Client Batch Sensor shall support one target SUID only. Events will be batched until memory is exhausted, or the client issues a flush request. When either of this happens all batched events will be published and batch memory will be freed for it to continue batching subsequent events.

*Attribute Requirements:*

Client Batch Sensor must support the following attributes

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “client\_batch”
2. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_ON\_CHANGE
3. SNS\_STD\_SENSOR\_ATTRID\_API attribute contains “sns\_client\_batch.proto”

*Processing Stream Requests:*

1. A request message with message id SNS\_CLIENT\_BATCH\_MSGID\_SNS\_CLIENT\_BATCH\_CONFIG and payload [sns\_client\_batch\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__batch__config) is used to start batching by the Client Batch Sensor. If a subsequent request is received with a different SUID, that request will be rejected.
2. SNS\_STD\_MSGID\_SNS\_STD\_FLUSH\_REQ supported by the Client Batch Sensor as defined in sns\_std.proto. It will publish all stored events and after flushing is complete reports a SNS\_STD\_MSGID\_SNS\_STD\_FLUSH\_EVENT.

*Publishing Stream Events:*

Client Batch Sensor generates events with message id SNS\_CLIENT\_BATCH\_MSGID\_SNS\_CLIENT\_BATCH\_EVENT and payload [sns\_client\_batch\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__batch__event).

1. When a flush request is received or when memory is exhausted the Client Batch Sensor publishes [sns\_client\_batch\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__batch__event) messages each containing a stored event.
2. The timestamp of each [sns\_client\_batch\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__batch__event) will correspond to the timestamp of the stored Sensor event.

Enums

- enum sns\_client\_batch\_msgid

    - Message IDs for Client Batch Sensor.

*Values:*

- enumerator SNS\_CLIENT\_BATCH\_MSGID\_SNS\_CLIENT\_BATCH\_CONFIG

    - Message ID for configuring and activating the sensor.

- enumerator SNS\_CLIENT\_BATCH\_MSGID\_SNS\_CLIENT\_BATCH\_EVENT

    - Message ID of events generated by the sensor.

- struct sns\_client\_batch\_config

    - Public Members

- optional sns\_std\_suid suid

    - UID of the Sensor to be logged.

- optional bool low\_power\_mode

    - Use micro batching (default is true). Client batch sensor will try to use batching in low power mode by default before batching in main memory.

- repeated uint32 batch\_msg\_ids [10]

    - Msg Ids of the underlying sensor to be batched. All other events will be dropped.

- struct sns\_client\_batch\_event

    - Public Members

- optional uint64 utc\_time

    - UTC Time in seconds (since 1/1/1970 00:00:00).

- optional sint32 time\_zone

    - Time Zone in seconds.

- optional uint32 msg\_id

    - Message ID of the event.

- repeated bytes event\_payload

    - The event as binary payload. See specific proto file for definition of the event.

## Client sensor

The Client Sensor is used to manage multiple concurrent client requests for a single sensor on a single connection.

*Attributes:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “client\_sensor”
2. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_ON\_CHANGE

*Processing Stream Requests:*

1. The Client Sensor handles the [sns\_client\_sensor\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__sensor__config) as the initial message from all clients. This message associates a single SUID with the Client Sensor. a. Only one SUID may be configured on a connection at one time. This SUID configuration persists with the Client Sensor until the connection with the Client Sensor is removed. Any attempts to reconfigure is rejected with an error event.
2. The Client Sensor handles the [sns\_client\_sensor\_enable](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__sensor__enable) message in one of two ways: a. If this is the first message with the associated client\_id, a new connection is made to the configured sensor and the request\_payload and request\_msg\_id is forwarded to the configured sensor. The Client Sensor maintains an internal association between the provided client\_id and the newly formed connection. b. If an initial message has already been sent and a connection to the configured sensor already established, the client sensor will forward the request\_payload and request\_msg\_id on the existing connection to the configured sensor.
3. The Client Sensor handles the [sns\_client\_sensor\_disable](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__sensor__disable) message by closing the associated connection to the configured sensor, and removing the internal association between the client\_id and the closed connection.

*Publishing Stream Events:*

1. The Client Sensor will encapsulate events received from the configured sensor in a [sns\_client\_sensor\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__sensor__event) message. The client\_id is the same ID as provided to the Client Sensor for this connection, and the event\_msg\_id and event contains the information provided by the configured sensor.

Enums

- enum sns\_client\_sensor\_msgid

    - Client Sensor Message IDs.

*Values:*

- enumerator SNS\_CLIENT\_SENSOR\_MSGID\_SNS\_CLIENT\_SENSOR\_CONFIG

    - Initial configuration message Message: [sns\_client\_sensor\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__sensor__config).

- enumerator SNS\_CLIENT\_SENSOR\_MSGID\_SNS\_CLIENT\_SENSOR\_ENABLE

    - Enable a new client or send a message from an existing client to the configured sensor Message: [sns\_client\_sensor\_enable](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__sensor__enable).

- enumerator SNS\_CLIENT\_SENSOR\_MSGID\_SNS\_CLIENT\_SENSOR\_DISABLE

    - Disable one client. Message: [sns\_client\_sensor\_disable](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__sensor__disable).

- enumerator SNS\_CLIENT\_SENSOR\_MSGID\_SNS\_CLIENT\_SENSOR\_EVENT

    - Event forwarded to one of the clients Message: [sns\_client\_sensor\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__client__sensor__event).

- struct sns\_client\_sensor\_config

    - Public Members

- required sns\_std\_suid suid

    - SUID of the Sensor to connect to.

- struct sns\_client\_sensor\_enable

    - Public Members

- required uint32 client\_id

    - ID provided by the client.

- required uint32 request\_msg\_id

    - Msg ID of the request for the configured sensor.

- optional bytes request\_payload

    - Request message to be relayed to the configured sensor.

- struct sns\_client\_sensor\_disable

    - Public Members

- required uint32 client\_id

    - Client ID.

- struct sns\_client\_sensor\_event

    - Public Members

- required uint32 client\_id

    - Client ID.

- required uint32 event\_msg\_id

    - Msg ID of the event.

- optional bytes event

    - Event Message received from the suid.

## Context Change Detector(CCD)

### Binary Input

This proto is for proxy sensors that want to send binary data events to combined detector block.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “ccd\_binary\_input”
2. SNS\_STD\_SENSOR\_ATTRID\_API: “sns\_ccd\_binary\_input.proto”
3. SNS\_STD\_SENSOR\_ATTRID\_STREAM: SNS\_STD\_SENSOR\_STREAM\_TYPE\_ON\_CHANGE

*Processing Stream Requests:*

1. SNS\_STD\_SENSOR\_MSGID\_SNS\_STD\_ON\_CHANGE\_CONFIG is used to enable the sensor. Only CCD sensor can send requests to CCD Binary input sensor(s).

*Publishing Stream Events:*

A proxy sensor will receive data events from a source sensor and map the data to SNS\_CCD\_BINARY\_DATA\_LOW or SNS\_CCD\_BINARY\_DATA\_HIGH. A sns\_ccd\_binary\_data\_event will be sent to clients.

Enums

- enum sns\_ccd\_binary\_input\_msgid

    - CCD binary input Message IDs.

*Values:*

- enumerator SNS\_CCD\_BINARY\_INPUT\_MSGID\_SNS\_CCD\_BINARY\_INPUT\_DATA\_EVENT

    - Binary output event from proxy sensor to CCD.

- enum sns\_ccd\_binary\_data\_enum

    - *Values:*

- enumerator SNS\_CCD\_BINARY\_DATA\_UNINITIALIZED

    - 

- enumerator SNS\_CCD\_BINARY\_DATA\_LOW

    - 

- enumerator SNS\_CCD\_BINARY\_DATA\_HIGH

    -

- struct sns\_ccd\_binary\_input\_data\_event

    - Public Members

- required sns\_ccd\_binary\_data\_enum state

    -

### Gesture

This API is used by TE & CD sensors for CCD. These sensors are dynamically generated via JSON registry contents.

The timestamp of the event indicates the timestamp of the associated TE/CD block.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: as defined in registry
2. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_ON\_CHANGE or ONE\_SHOT, as defined in registry
3. SNS\_STD\_SENSOR\_ATTRID\_API: “sns\_ccd\_gesture.proto”

*Processing Stream Requests:*

- SNS\_STD\_SENSOR\_MSGID\_SNS\_STD\_ON\_CHANGE\_CONFIG is used to enable the sensor.
- SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_MODEL\_CONFIG\_REQ: If a gesture sensor supports named models, this request loads the model and activates the sensor similar to an ON\_CHANGE\_CONFIG. If this request is made to a sensor that doesn’t support named models, a model config event is sent back with a not supported error status.
- SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_MODEL\_LIST\_REQ: If a gesture supports named models, this request will get the supported models and return them in the corresponding event. See [sns\_ccd\_model\_list\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__ccd__model__list__event). If this request is made to a sensor that doesn’t support named models, then a std error event is sent back with the not supported error status.

*Publishing Stream Events:*

- The SNS\_CCD\_GESTURE\_MSGID\_CCD\_GESTURE\_EVENT will be sent when the hardware indicates an event which matches the gesture configuration
- The SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_MODEL\_CONFIG\_EVENT is sent when CCD has finished handling a MODEL\_CONFIG\_REQ or an ON\_CHANGE request.
- SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_MODEL\_LIST\_EVENT is the event containing the list of supported models. This event will be sent upon receiving a MODEL\_LIST\_REQ.

Enums

- enum sns\_ccd\_gesture\_msgid

    - Message IDs for CCD gesture sensors.

*Values:*

- enumerator SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_GESTURE\_EVENT

    - Gesture event contains state0 & state1 for TE-based sensors, and cd\_state for CD-based sensors.

- enumerator SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_MODEL\_CONFIG\_REQ

    - Request to load a model.

- enumerator SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_MODEL\_LIST\_REQ

    - Request to get a list of supported models.

- enumerator SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_MODEL\_CONFIG\_EVENT

    - Event indicating current loaded model and status.

- enumerator SNS\_CCD\_GESTURE\_MSGID\_SNS\_CCD\_MODEL\_LIST\_EVENT

    - Event containing list of supported models.

- enum sns\_ccd\_cd\_state

    - State for CD-based sensors.

*Values:*

- enumerator SNS\_CCD\_CD\_STATE\_UNKNOWN

    - 

- enumerator SNS\_CCD\_CD\_STATE\_LOW

    - 

- enumerator SNS\_CCD\_CD\_STATE\_HIGH

    -

- struct sns\_ccd\_te\_event

    - Public Members

- required uint32 state0

    - Refer to CECT Tool Documentation for details.

- required uint32 state1

    - Refer to CECT Tool Documentation for details.

- struct sns\_ccd\_cd\_event

    - Public Members

- required sns\_ccd\_cd\_state cd\_state

    -

- struct sns\_ccd\_gesture\_event

    - - union event

    - Public Members

- [sns\_ccd\_te\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv416sns_ccd_te_event) te\_event

    - 

- [sns\_ccd\_cd\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv416sns_ccd_cd_event) cd\_event

    -

- struct sns\_ccd\_model\_config\_req

    - Public Members

- optional string model\_name

    -

- struct sns\_ccd\_model\_list\_event

    - Public Members

- repeated string model\_names

    -

- struct sns\_ccd\_model\_config\_event

    - Public Members

- optional string model\_name

    - 

- optional sns\_std\_error status

    -

### Gyroscope Motion Detect (GMD)

GMD uses the gyro sensor to detect motion/stationary states.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “ccd\_gmd”
2. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_ON\_CHANGE

*Processing Stream Requests:*

1. SNS\_STD\_SENSOR\_MSGID\_SNS\_STD\_ON\_CHANGE\_CONFIG is used to enable the sensor.

*Publishing Stream Events:*

1. SNS\_AMD\_MSGID\_SNS\_AMD\_EVENT is used to send motion/stationary updates.

### Walk

CCD Walk calculates a walk state. When a walk is detected, the sensor will send one WALK event. To send additional walk events, the sensor must be re-armed with the SNS\_STD\_SENSOR\_MSGID\_SNS\_STD\_ON\_CHANGE\_CONFIG event again.

No events are generated when not in the walk state.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “ccd\_walk”
2. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_SINGLE\_OUTPUT
3. SNS\_STD\_SENSOR\_ATTRID\_API: “sns\_ccd\_walk.proto”

*Processing Stream Requests:*

- SNS\_STD\_SENSOR\_MSGID\_SNS\_STD\_ON\_CHANGE\_CONFIG is used to enable the sensor

*Publishing Stream Events:*

- A NULL message with message ID SNS\_CCD\_WALK\_MSGID\_SNS\_CCD\_WALK\_EVENT is used to publish the walk event.
- Walk does not publish configuration events.

Enums

- enum sns\_ccd\_walk\_msgid

    - Message IDs for Walk Sensor.

*Values:*

- enumerator SNS\_CCD\_WALK\_MSGID\_SNS\_CCD\_WALK\_EVENT

    -

## Diagnostic

Use to capture diagnostic data for multiple modules.

Enums

- enum sns\_diag\_batch\_sample\_type

    - Batch Sample Type.

*Values:*

- enumerator SNS\_DIAG\_BATCH\_SAMPLE\_TYPE\_ONLY

    - This is the only sample in the batch.

- enumerator SNS\_DIAG\_BATCH\_SAMPLE\_TYPE\_FIRST

    - This is the first sample of the batch.

- enumerator SNS\_DIAG\_BATCH\_SAMPLE\_TYPE\_INTERMEDIATE

    - This is an intermediate sample of the batch.

- enumerator SNS\_DIAG\_BATCH\_SAMPLE\_TYPE\_LAST

    - This is the last sample of the batch.

- enum sns\_diag\_interrupt

    - Sensor Interrupts.

*Values:*

- enumerator SNS\_DIAG\_INTERRUPT\_THRESHOLD

    - Interrupt caused by detection of a threshold being exceeded.

- enumerator SNS\_DIAG\_INTERRUPT\_MOTION

    - Interrupt caused by detection of movement of the device.

- enumerator SNS\_DIAG\_INTERRUPT\_TILT

    - Interrupt caused by detection of tilting of the device.

- enumerator SNS\_DIAG\_INTERRUPT\_FREE\_FALL

    - Interrupt caused by detection of free fall.

- enumerator SNS\_DIAG\_INTERRUPT\_DOUBLE\_TAP

    - Interrupt caused by detection of double-tap.

- enumerator SNS\_DIAG\_INTERRUPT\_SHOCK

    - Interrupt caused by detection of acceleration shock.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_AMD

    - Interrupt caused by CCD AMD.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_WALK

    - Interrupt caused by CCD WALK.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_TILT

    - Interrupt caused by CCD TILT.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_TE0

    - Interrupt caused by CCD TE0.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_TE1

    - Interrupt caused by CCD TE1.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_TE2

    - Interrupt caused by CCD TE2.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_TE3

    - Interrupt caused by CCD TE3.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_CD0

    - Interrupt caused by CCD CD0.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_CD1

    - Interrupt caused by CCD CD1.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_CD2

    - Interrupt caused by CCD CD2.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_CD3

    - Interrupt caused by CCD CD3.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_GBE1

    - Interrupt caused by CCD GBE.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_GBE2

    - Interrupt caused by CCD GBE.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_OGV0

    - Interrupt caused by CCD OGV0.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_OGV1

    - Interrupt caused by CCD OGV1.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_OGV2

    - Interrupt caused by CCD OGV2.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_OGV3

    - Interrupt caused by CCD OGV3.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_TE4

    - Interrupt caused by CCD TE4.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_PPE

    - Interrupt caused by CCD primary accel ppe.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_PPE1

    - Interrupt caused by CCD gyro ppe.

- enumerator SNS\_DIAG\_INTERRUPT\_CCD\_PPE2

    - Interrupt caused by CCD secondary accel ppe.

- enum sns\_diag\_island\_state

    - Island mode states.

*Values:*

- enumerator SNS\_DIAG\_ISLAND\_STATE\_IN\_ISLAND\_MODE

    - In Island mode.

- enumerator SNS\_DIAG\_ISLAND\_STATE\_NOT\_IN\_ISLAND\_MODE

    - Not in Island Mode.

- enumerator SNS\_DIAG\_ISLAND\_STATE\_ISLAND\_DISABLED

    - Island mode disabled.

- enum sns\_diag\_heap\_id

    - Heap IDs.

*Values:*

- enumerator SNS\_DIAG\_HEAP\_ID\_HEAP\_MAIN

    - Primary Heap.

- enumerator SNS\_DIAG\_HEAP\_ID\_HEAP\_ISLAND

    - Island Heap.

- enumerator SNS\_DIAG\_HEAP\_ID\_HEAP\_PRAM

    - PRAM Heap.

- enumerator SNS\_DIAG\_HEAP\_ID\_HEAP\_EVENT

    - EVENT Heap.

- enumerator SNS\_DIAG\_HEAP\_ID\_HEAP\_BATCH

    - BATCH Heap.

- enumerator SNS\_DIAG\_HEAP\_ID\_EVENT\_BUFFER

    - Event buffer.

- struct sns\_diag\_opaque\_payload

    - Public Members

- required bytes payload

    -

- struct sns\_diag\_batch\_sample

    - Public Members

- required sns\_diag\_batch\_sample\_type sample\_type [default=SNS\_DIAG\_BATCH\_SAMPLE\_TYPE\_ONLY]

    - Indicates if the sample is the first, intermediate, last or only sample of a batch.

- required fixed64 timestamp

    - Timestamp of the sensor state data sample.

- repeated float sample

    - Sensor state data sample.

- required sns\_std\_sensor\_sample\_status status [default=SNS\_STD\_SENSOR\_SAMPLE\_STATUS\_UNRELIABLE]

    - Data status.

- struct sns\_diag\_sensor\_state\_interrupt

    - Public Members

- required sns\_diag\_interrupt interrupt

    - Type of sensor hardware interrupt.

- required fixed64 timestamp

    - Timestamp when the interrupt occurred.

- struct sns\_diag\_sensor\_state\_raw

    - Public Members

- repeated sns\_diag\_batch\_sample sample

    -

- struct sns\_diag\_client\_resp\_msg

    - Public Members

- required sns\_std\_error error

    - The error response sent to the client.

- struct sns\_diag\_client\_api\_log

    - - union client\_api\_log\_payload

    - Public Members

- [sns\_client\_request\_msg](https://docs.qualcomm.com/doc/80-P9361-100/topic/client.html#_CPPv422sns_client_request_msg) request\_payload

    - Client API Request message as defined in sns\_client.proto.

- [sns\_client\_event\_msg](https://docs.qualcomm.com/doc/80-P9361-100/topic/client.html#_CPPv420sns_client_event_msg) event\_payload

    - Client API Event message as defined in sns\_client.proto.

- [sns\_diag\_client\_resp\_msg](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv424sns_diag_client_resp_msg) resp\_payload

    - Client API Response message as defined in sns\_diag.proto.

- [sns\_client\_qsocket\_msg](https://docs.qualcomm.com/doc/80-P9361-100/topic/client.html#_CPPv422sns_client_qsocket_msg) qcm\_payload

    - QCM client API message.

Public Members

- required fixed64 client\_id

    - Client ID identifies the client connection.

- required string src\_sensor\_type

    - Data type of the source sensor.

- struct sns\_diag\_sensor\_api\_log

    - - union sensor\_api\_log\_payload

    - Public Members

- [sns\_diag\_opaque\_payload](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv423sns_diag_opaque_payload) opaque\_payload

    - Sensor API Event message containing sensor specific event message as defined in the sensor’s proto api file.

- sns\_std\_request request\_payload

    - Sensor API Request message as defined in sns\_std.proto.

Public Members

- struct required fixed32 \_id

    - The message id of the message being logged.

- required fixed64 timestamp

    - Timestamp associated with this message.

- optional fixed64 stream\_id

    - Data stream associated with this message.

- struct sns\_diag\_sensor\_log

    - - union sensor\_log\_payload

    - Public Members

- [sns\_diag\_opaque\_payload](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv423sns_diag_opaque_payload) opaque\_payload

    - Sensor specific Sensor State Algo message.

- [sns\_diag\_sensor\_api\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv423sns_diag_sensor_api_log) sensor\_api\_payload

    - Sensor API message.

- [sns\_diag\_client\_api\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv423sns_diag_client_api_log) client\_api\_payload

    - Client API message.

- [sns\_diag\_sensor\_state\_raw](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv425sns_diag_sensor_state_raw) sensor\_state\_raw\_payload

    - Sensor State Raw message.

- [sns\_diag\_sensor\_state\_interrupt](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv431sns_diag_sensor_state_interrupt) sensor\_state\_interrupt\_payload

    - Sensor State Hardware Interrupt message.

Public Members

- required fixed32 log\_id

    - Log ID for the log packet.

- required fixed64 timestamp

    - Timestamp when log packet.was generated.

- required sns\_std\_suid suid

    - Sensor UID for the log packet.

- required string sensor\_type

    - Data type provided by the Sensor UID.

- required fixed64 instance\_id

    - In case of client\_api payload : Instance ID of the Client Manager Sensor to which this message was passed to or obtained from In case of opaque, sensor\_api and sensor\_state payloads: Instance ID of the Sensor to which this message was passed to or obtained from.

- struct sns\_diag\_instance\_map\_log

    - Public Members

- required fixed64 src\_instance\_id

    - The instance id of the source sensor instance.

- repeated fixed64 dest\_instance\_id

    - Array of destination Sensor Instance IDs or Sensor IDs that the source sensor instance is feeding to. If no destination instance ids are specified it signifies deletion of the source instance.

- repeated fixed64 stream\_id

    - Array of data stream ids that the source sensor instance is feeding to.

- struct sns\_diag\_island\_transition\_log

    - This log packet is generated each time the system transitions into or out of island mode or when island mode is disabled or when triggered by a request to the diag sensor.

This message is used as the payload field of [sns\_diag\_fw\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__diag__fw__log) This message is legacy. It is replaced with ‘message [sns\_diag\_island\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__diag__island__log)’

Public Members

- required fixed64 timestamp

    - Timestamp of the transition When log packet is triggered, this timestamp will retain the timestamp when the current state became effective.

- required sns\_diag\_island\_state island\_state

    - Island state after transition is completed.

- optional fixed64 cookie

    - User defined cookie Used by test scripts to identify logs triggered by messages sent to the SSC.

- optional fixed64 total\_island\_time

    - Total time system spent in island since device boot(micro seconds).

- struct sns\_diag\_island\_tx\_log

    - Public Members

- optional sns\_diag\_island\_state island\_state

    - Island state after transition is completed.

- optional fixed64 cookie

    - User defined cookie Used by test scripts to identify logs triggered by messages sent to the SSC

- optional fixed64 total\_island\_time

    - Total time system spent in island since device boot(micro seconds)

- struct sns\_diag\_island\_debug\_log

    - Public Members

- optional fixed32 previous\_island\_state

    - previous state of island transition

- optional fixed32 current\_island\_state

    - current state of island transition

- repeated fixed32 callers

    - caller symbols causing island transition

- struct sns\_diag\_island\_log

    - This message is used as the payload field of [sns\_diag\_fw\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__diag__fw__log)

- union sns\_diag\_island\_log\_payloads

    - Public Members

- [sns\_diag\_island\_tx\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv422sns_diag_island_tx_log) log\_payload

    - 

- [sns\_diag\_island\_debug\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv425sns_diag_island_debug_log) dbg\_log\_payload

    -

Public Members

- optional fixed64 timestamp

    - timestamp of island transition or debug transition

- struct sns\_diag\_island\_exit\_vote\_log

    - This log packet is generated at each call to island\_exit().

Public Members

- required fixed64 timestamp

    - Timestamp.

- optional sns\_std\_suid sensor

    - SUID of the Sensor responsible for the vote.

- struct sns\_diag\_mem\_utilization\_log

    - Public Members

- required fixed64 timestamp

    - Timestamp.

- required sns\_diag\_heap\_id heap\_id

    - Heap ID.

- required fixed32 total\_memory

    - Total Memory.

- required fixed32 used\_memory

    - Used Memory.

- optional fixed64 cookie

    - User defined cookie. Used by test scripts to identify logs triggered by messages sent to the SSC.

- struct sns\_diag\_event\_service\_log

    - - struct heap\_stats

    - Public Types

- enum sns\_event\_service\_heap\_id

    - *Values:*

- enumerator SNS\_EVENT\_SERVICE\_HEAP\_ID\_ISLAND

    - 

- enumerator SNS\_EVENT\_SERVICE\_HEAP\_ID\_MAIN

    -

Public Members

- required sns\_event\_service\_heap\_id heap\_id

    - Heap ID.

- required fixed32 total\_memory

    - Total memory available in heap (in blocks).

- required fixed32 used\_memory

    - Current memory consumption (in blocks).

- required fixed32 max\_memory

    - Maximum memory consumption since last log packet (in blocks).

- required fixed32 total\_clusters

    - Total clusters available.

- required fixed32 used\_clusters

    - Current number of clusters in use.

- required fixed32 max\_clusters

    - Maximum in-use clusters since last log packet.

- required fixed32 alloc\_failures

    - Number of allocation failures since the last DIAG log packet If Island will result in island exit; else causes dropped samples.

- required fixed32 max\_size

    - Largest event allocation since the last DIAG log packet (in bytes).

Public Members

- required fixed64 timestamp

    - Timestamp.

- optional fixed64 cookie

    - User defined cookie. Used by test scripts to identify logs triggered by messages sent to the SSC.

- repeated heap\_stats stats

    -

- struct sns\_diag\_fw\_log

    - - union fw\_log\_payload

    - Public Members

- [sns\_diag\_instance\_map\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv425sns_diag_instance_map_log) instance\_map\_payload

    - Sensor Instance Map message.

- [sns\_diag\_island\_transition\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv430sns_diag_island_transition_log) island\_mode\_payload

    - Sensor Island Mode (Legacy)

- [sns\_diag\_island\_exit\_vote\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv429sns_diag_island_exit_vote_log) island\_exit\_vote\_payload

    - Sensors Island Exit vote. NOT SUPPORTED YET.

- [sns\_diag\_mem\_utilization\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv428sns_diag_mem_utilization_log) memory\_utilization\_payload

    - Sensors Memory Utilization.

- [sns\_diag\_event\_service\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv426sns_diag_event_service_log) event\_service\_payload

    - Event Service status log.

- [sns\_diag\_island\_log](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv419sns_diag_island_log) island\_payload

    - Island related logs.

Public Members

- required fixed32 log\_id

    - Log ID for the log packet.

- required fixed64 timestamp

    - Timestamp when log packet.was generated.

## Interrupt

The Interrupt Sensor is a platform Sensor which is used by physical Sensor drivers that use interrupts like data-ready interrupt (DRI), In Band Interrupt (IBI), FIFO watermark interrupt, etc. These physical Sensors must use the API defined in this file to send requests to and parse events from the Interrupt Sensor.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “interrupt”
2. SNS\_STD\_SENSOR\_ATTRID\_API: “sns\_interrupt.proto”

*Processing Stream Requests:*

1. SNS\_INTERRUPT\_MSGID\_SNS\_INTERRUPT\_REQ to request interrupt sensor the sensor.
2. SNS\_INTERRUPT\_MSGID\_SNS\_INTERRUPT\_IS\_CLEARED: Notification message to the interrupt Sensor that a level triggered interrupt has been serviced and cleared.

    In case of level triggered interrupts, when the interrupt fires, the interrupt sensor disables the interrupt until it is serviced and cleared at its source. This message is used to notify the interrupt sensor that the interrupt has been serviced and cleared so that it can be re-enabled. This message is not applicable to edge triggered interrupts. This message does not have any payload.

*Publishing Stream Events:*

1. SNS\_INTERRUPT\_MSGID\_SNS\_INTERRUPT\_EVENT: This message is generated each time a registered interrupt fires. This message ID corresponds to the message [sns\_interrupt\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__interrupt__event).
2. SNS\_INTERRUPT\_MSGID\_SNS\_INTERRUPT\_REG\_EVENT: This message is generated when an interrupt has been successfully registered. Sensors should not turn on the hardware interrupts until this event has been received from the interrupt sensor. This event has no body and the event length is 0.

Enums

- enum sns\_interrupt\_msgid

    - Interrupt message ids.

*Values:*

- enumerator SNS\_INTERRUPT\_MSGID\_SNS\_INTERRUPT\_REQ

    - This message is used to register for notifications for a physical interrupt pin with the interrupt sensor.

- enumerator SNS\_INTERRUPT\_MSGID\_SNS\_INTERRUPT\_IS\_CLEARED

    - Notification message to the interrupt Sensor that a level triggered interrupt has been serviced and cleared.

- enumerator SNS\_INTERRUPT\_MSGID\_SNS\_IBI\_REQ

    - This message is used to register for notifications for an In Band Interrupt (IBI).

- enumerator SNS\_INTERRUPT\_MSGID\_SNS\_INTERRUPT\_EVENT

    - Data event from interrupt Sensor.

- enumerator SNS\_INTERRUPT\_MSGID\_SNS\_INTERRUPT\_REG\_EVENT

    - Interrupt sensor event marking it as registered.

- enum sns\_interrupt\_trigger\_type

    - Types of interrupt triggers.

*Values:*

- enumerator SNS\_INTERRUPT\_TRIGGER\_TYPE\_RISING

    - Trigger type rising edge.

- enumerator SNS\_INTERRUPT\_TRIGGER\_TYPE\_FALLING

    - Trigger type falling edge.

- enumerator SNS\_INTERRUPT\_TRIGGER\_TYPE\_DUAL\_EDGE

    - Trigger type rising and falling edge.

- enumerator SNS\_INTERRUPT\_TRIGGER\_TYPE\_HIGH

    - Trigger type high level.

- enumerator SNS\_INTERRUPT\_TRIGGER\_TYPE\_LOW

    - Trigger type low level.

- enum sns\_interrupt\_drive\_strength

    - Types of interrupt pin drive strength.

*Values:*

- enumerator SNS\_INTERRUPT\_DRIVE\_STRENGTH\_2\_MILLI\_AMP

    - Specify a 2 mA drive.

- enumerator SNS\_INTERRUPT\_DRIVE\_STRENGTH\_4\_MILLI\_AMP

    - Specify a 4 mA drive.

- enumerator SNS\_INTERRUPT\_DRIVE\_STRENGTH\_6\_MILLI\_AMP

    - Specify a 6 mA drive.

- enumerator SNS\_INTERRUPT\_DRIVE\_STRENGTH\_8\_MILLI\_AMP

    - Specify an 8 mA drive.

- enumerator SNS\_INTERRUPT\_DRIVE\_STRENGTH\_10\_MILLI\_AMP

    - Specify a 10 mA drive.

- enumerator SNS\_INTERRUPT\_DRIVE\_STRENGTH\_12\_MILLI\_AMP

    - Specify a 12 mA drive.

- enumerator SNS\_INTERRUPT\_DRIVE\_STRENGTH\_14\_MILLI\_AMP

    - Specify a 14 mA drive.

- enumerator SNS\_INTERRUPT\_DRIVE\_STRENGTH\_16\_MILLI\_AMP

    - Specify a 16 mA drive.

- enum sns\_interrupt\_pull\_type

    - Types of interrupt pin pull.

*Values:*

- enumerator SNS\_INTERRUPT\_PULL\_TYPE\_NO\_PULL

    - Do not specify a pull.

- enumerator SNS\_INTERRUPT\_PULL\_TYPE\_PULL\_DOWN

    - Pull the GPIO down.

- enumerator SNS\_INTERRUPT\_PULL\_TYPE\_KEEPER

    - Designate as a Keeper.

- enumerator SNS\_INTERRUPT\_PULL\_TYPE\_PULL\_UP

    - Pull the pin up.

- enum sns\_intr\_qup\_type

    - *Values:*

- enumerator SNS\_INTR\_SSC\_QUP

    - 

- enumerator SNS\_INTR\_TOP\_QUP

    -

- struct sns\_interrupt\_req

    - Public Members

- required uint32 interrupt\_num

    - Interrupt pin number.

- required sns\_interrupt\_trigger\_type interrupt\_trigger\_type

    - Interrupt trigger type.

- required sns\_interrupt\_drive\_strength interrupt\_drive\_strength

    - Interrupt pin drive strength configuration.

- required sns\_interrupt\_pull\_type interrupt\_pull\_type

    - Interrupt pin pull configuration.

- required bool is\_chip\_pin

    - Interrupt pin type. True if this is a chip TLMM GPIO. False if this is an SSC TLMM GPIO.

- struct sns\_ibi\_req

    - Public Members

- required uint32 dynamic\_slave\_addr

    - Slave address for I3C.

- required uint32 bus\_instance

    - Platform bus instance number (BLSP number).

- required fixed32 ibi\_data\_bytes

    - Number of optional + mandatory bytes supported by the sensor hardware.

- optional fixed32 qup\_instance

    - QUP instance.

- optional sns\_intr\_qup\_type qup\_type

    - QUP\_type whether SSC or top level.

- optional uint32 manufacturer\_id

    - Manufacturer ID of I3C slave.

- optional uint32 provisional\_id

    - Provisional ID of I3C slave.

- struct sns\_interrupt\_event

    - Public Members

- required fixed32 interrupt\_num

    - Interrupt pin number or dynamic slave address.

- required fixed64 timestamp

    - Timestamp when trigger event on the interrupt was detected.

- optional bytes ibi\_data [32]

    - If an IBI event, the data associated with the event.

## Registry

## Registry Sensor Attribute Requirements:

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “registry”
2. SNS\_STD\_SENSOR\_ATTRID\_API: “sns\_registry.proto”
3. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_SINGLE\_OUTPUT

*Processing Stream Requests:*

1. The Registry Sensor handles the [sns\_registry\_read\_req](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__registry__read__req) request by searching its database for the group or item specified in the request and replying with the associated data. a. The name shall be in form: “group\_name[.sub\_group\_name][.item\_name]” There may be zero or more levels of subgroups specified. Including an item name is optional.
2. The Registry Sensor handles the [sns\_registry\_write\_req](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__registry__write__req) by writing the associated group to its database. a. The name shall be in form: “group\_name[.sub\_group\_name]” There may be zero or more levels of subgroups specified. b. If a (sub)group is not found, the registry will attempt to create the (sub)group. c. If an item’s version number is 0 or higher than an existing item’s version number, it will overwrite the existing data in the database. d. Existing items in a group are not modified if those items are not present in the write request.
3. The Registry Sensor may support a persistent database. In this case, writes to the database are saved across reboots.
4. The Registry Sensor may support a RAM-only database. This database must be initialized with persistent ROM data upon bootup. Writes to this database are stored in a RAM copy which will be lost across reboots.

*Publishing Stream Events:*

1. The Registry Sensor publishes a [sns\_registry\_read\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__registry__read__event) upon completion of a read request. a. The “data” field will be empty if the group or item was not found. b. If an item name was included in the read request, the entire group containing that item may be returned in the read event.
2. A [sns\_registry\_write\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__registry__write__event) is published upon completion of a write request.

Enums

- enum sns\_registry\_msgid

    - Registry Sensor message IDs:

*Values:*

- enumerator SNS\_REGISTRY\_MSGID\_SNS\_REGISTRY\_READ\_REQ

    - A request to read data from the Registry database. Message: [sns\_registry\_read\_req](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__registry__read__req).

- enumerator SNS\_REGISTRY\_MSGID\_SNS\_REGISTRY\_WRITE\_REQ

    - A request to write data to the Registry database. Message: [sns\_registry\_write\_req](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__registry__write__req).

- enumerator SNS\_REGISTRY\_MSGID\_SNS\_REGISTRY\_READ\_EVENT

    - A read event from the Registry Sensor. Message: [sns\_registry\_read\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__registry__read__event).

- enumerator SNS\_REGISTRY\_MSGID\_SNS\_REGISTRY\_WRITE\_EVENT

    - A write event from the Registry Sensor. Message: [sns\_registry\_write\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__registry__write__event).

- enum sns\_registry\_write\_status

    - Registry write status.

*Values:*

- enumerator SNS\_REGISTRY\_WRITE\_STATUS\_SUCCESS

    - The registry write was successful and the data was stored.

- enumerator SNS\_REGISTRY\_WRITE\_STATUS\_ERROR\_OTHER

    - An unspecified error has occurred, data may be lost.

- struct sns\_registry\_data

    - - struct item

    - - union data

    - Public Members

- [sns\_registry\_data](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#_CPPv417sns_registry_data) subgroup

    - 

- string str

    - 

- float flt

    - 

- sfixed64 sint

    -

Public Members

- required string name

    - Item name (i.e. Only item-specific name, sans group name)

- optional fixed32 version

    -

Public Members

- repeated item items

    - List of items contained in this group.

- struct sns\_registry\_read\_req

    - Public Members

- required string name

    - Full name of the item or group to be read.

- struct sns\_registry\_read\_event

    - Public Members

- required string name

    - Full name of the group which was read.

- required sns\_registry\_data data

    - If the requested registry group was not found, data is empty.

- struct sns\_registry\_write\_req

    - Public Members

- required string name

    - Full name of the group to be written.

- required sns\_registry\_data data

    - The registry data.

- optional int64 cookie

    - Cookie for request/event pairing.

- struct sns\_registry\_write\_event

    - Public Members

- required sns\_registry\_write\_status status

    - The Write Status.

- optional int64 cookie

    - Echo cookie for request/event pairing.

## Remote Proc

Notify changes in remote processor states.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “remote\_proc\_state”
2. SNS\_STD\_SENSOR\_ATTRID\_API: “sns\_remote\_proc\_state.proto”
3. SNS\_STD\_SENSOR\_ATTRID\_STREAM: SNS\_STD\_SENSOR\_STREAM\_TYPE\_ON\_CHANGE

*Processing Stream Requests:*

1. SNS\_REMOTE\_PROC\_STATE\_MSGID\_SNS\_REMOTE\_PROC\_STATE\_CONFIG: Config request to receive remote processor state updates.

*Publishing Stream Events:*

SNS\_REMOTE\_PROC\_STATE\_MSGID\_SNS\_REMOTE\_PROC\_STATE\_EVENT:

1. This event is generated when the remote\_proc\_state service sends out the remote processor state change notification.
2. This event is generated when the client processor sends out time offset update notification to remote proc sensor.

Enums

- enum sns\_remote\_proc\_state\_msgid

    - *Values:*

- enumerator SNS\_REMOTE\_PROC\_STATE\_MSGID\_SNS\_REMOTE\_PROC\_STATE\_CONFIG

    - Uses message: [sns\_remote\_proc\_state\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__remote__proc__state__config) Config request to receive remote processor state updates.

- enumerator SNS\_REMOTE\_PROC\_STATE\_MSGID\_SNS\_REMOTE\_PROC\_STATE\_EVENT

    - Uses message: [sns\_remote\_proc\_state\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__remote__proc__state__event)

1. This event is generated when the remote\_proc\_state service sends out the remote processor state change notification.
2. This event is generated when the client processor sends out time offset update notification to remote proc sensor.

- enum sns\_remote\_proc\_state\_event\_type

    - Supported processor state event types.

*Values:*

- enumerator SNS\_REMOTE\_PROC\_STATE\_SUSPEND

    - Processor is suspended.

- enumerator SNS\_REMOTE\_PROC\_STATE\_AWAKE

    - Processor is awake.

- struct sns\_remote\_proc\_state\_config

    - Public Members

- required sns\_std\_client\_processor proc\_type

    - Requested processor type.

- struct sns\_remote\_proc\_state\_event

    - Public Members

- required sns\_std\_client\_processor proc\_type

    - Processor type whose state is updated.

- required sns\_remote\_proc\_state\_event\_type event\_type [default=SNS\_REMOTE\_PROC\_STATE\_AWAKE]

    - Event type with state of the processor.

- optional sfixed64 time\_offset

    - Time offset between client time domain & QSH time domain in nano seconds. This field is updated when the client processor sends out time offset update notification to remote proc sensor.

## Resampler

Generates resampled events by applying the resampler configuration to the input sensor data.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “resampler”
2. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_STREAMING

*Processing Stream Requests:*

1. SNS\_RESAMPLER\_MSGID\_SNS\_RESAMPLER\_CONFIG: Used to either request for a new configuration of the resampler Sensor or alter an already existing configuration. Only requests with SUIDs of Sensors configured through sns\_resampler.xml will be serviced. All other requests will be rejected with an error event (SNS\_STD\_ERROR\_NOT\_SUPPORTED)

*Publishing Stream Events:*

1. Resampler uses sns\_std\_sensor\_event for its output event.
2. Resampler will resample all of the sns\_std\_sensor\_events.
3. Resampler also forwards any other event from underlying sensors (like physical config events, etc).

Enums

- enum sns\_resampler\_msgid

    - *Values:*

- enumerator SNS\_RESAMPLER\_MSGID\_SNS\_RESAMPLER\_CONFIG

    - Configuration message to engage resampler.

- struct sns\_resampler\_config

    - Public Members

- required sns\_std\_suid sensor\_uid

    - UID of the Sensor to be resampled.

- required float resampled\_rate

    - The requested resampled rate in Hz.

- required sns\_resampler\_rate rate\_type

    - The requested rate type as defined in sns\_resampler\_rate.

- required bool filter

    - Set to true to enable filtering, else false.

- optional bool event\_gated

    - Set to true if sensor to be resampled is event gated.

## Sensors unique identifier (SUID)

This file provides definitions for requests and parameters for requesting SUID of a given data type. It also provides the definition of the suid response event.

Enums

- enum sns\_suid\_msgid

    - the Message ID for SUID request

*Values:*

- enumerator SNS\_SUID\_MSGID\_SNS\_SUID\_REQ

    - Request for SUIDs that support the specified Data Type. Message: [sns\_suid\_req](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__suid__req).

- enumerator SNS\_SUID\_MSGID\_SNS\_SUID\_EVENT

    - Event containing SUIDs that support the requested Data Type. Message: [sns\_suid\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__suid__event).

- struct sns\_suid\_sensor

    - Public Members

- required fixed64 suid\_low [default=0xabababababababab]

    - 

- required fixed64 suid\_high [default=0xabababababababab]

    -

- struct sns\_suid\_req

    - Note: Additional requests arriving on the same connection, will not result in a replaced request, but instead the new request will be appended to any active registrations.

Public Members

- required string data\_type

    - Data type as defined by the SNS\_STD\_SENSOR\_ATTRID\_TYPE in the Sensor proto.

- optional bool register\_updates

    - Register for updates to the list of SUIDs advertising data\_type.

- optional bool default\_only [default=true]

    - Weather to request for the default sensor only.

If there are multiple Sensors supporting a data type, one of these may be designated as “default” through registry by defining other attributes such as SNS\_STD\_SENSOR\_ATTRID\_RIGID\_BODY for the Sensor.

If default\_only field is not populated OR a default definition for the data type is not present, the SUID of the first Sensor supporting the data type will be sent when available.

If default\_only field is set to true, only the UID of the Sensor that supports all the attribute requirements for “default” will be sent when available.

If default\_only is set to false, UIDs of all Sensors supporting the data type will be sent, as and when they become available.

- struct sns\_suid\_event

    - Public Members

- required string data\_type

    - Data type as defined by the SNS\_STD\_SENSOR\_ATTRID\_TYPE in the Sensor proto.

- repeated sns\_std\_suid suid

    - UIDs of the Sensors supporting the data type.

## Threshold

Threshold sensor is use to generate output only after threshold is met.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE: “threshold”
2. SNS\_STD\_SENSOR\_ATTRID\_STREAM\_TYPE: SNS\_STD\_SENSOR\_STREAM\_TYPE\_STREAMING

*Processing Stream Requests:*

1. SNS\_THRESHOLD\_MSGID\_SNS\_THRESHOLD\_CONFIG is to enable the sensor. This request is used to either request for a new configuration of the threshold Sensor or alter an already existing configuration or query the current configuration. Only requests with SUIDs of Sensors configured through sns\_threshold.xml will be serviced. All other requests will be rejected with an error event (SNS\_STD\_ERROR\_NOT\_SUPPORTED).

*Publishing Stream Events:*

Threshold uses sns\_std\_sensor\_event for it’s output event. An event is generated by the threshold algorithm only if the threshold is met on any of the axis for the sensor. Thresholding can be done as value based delta between current value and the last generated output. Or thresholding can be done as the delta between current value and the last output, as a percentage of the last output. Thresholding can also be done based on the current value going beyond a particular absolute threshold value. When thresholding criteria is met , an event is generated by the algorithm.

All data events are generated as sns\_std\_sensor\_event.

Enums

- enum sns\_threshold\_msgid

    - *Values:*

- enumerator SNS\_THRESHOLD\_MSGID\_SNS\_THRESHOLD\_CONFIG

    -

- struct sns\_threshold\_config

    - Public Members

- required sns\_std\_suid sensor\_uid

    - UID of the sensor from which data is being requested from.

- repeated float threshold\_val

    - The threshold value per data field. The number of threshold values need to be less than or equal to the number of sensor data fields. For SNS\_THRESHOLD\_TYPE\_ANGLE, a single threshold\_val value representing the angle between current and last reported quaternions. FLT\_MAX if thresholding is not required for corresponding data field.

- required sns\_threshold\_type threshold\_type

    - Tells us how to use the thresholding value provided.

- required uint32 payload\_cfg\_msg\_id

    - The message id to be used to configure the underlying sensor. This is used together with the below payload field.

- required bytes payload

    - Dynamic length payload, containing the actual data/configuration request. This payload will need to be decoded separately, using the Sensor-specific header file.

## Timer

Generates timer event after the specified timeout.

*Attribute Requirements:*

1. SNS\_STD\_SENSOR\_ATTRID\_TYPE as “timer”
2. SNS\_STD\_SENSOR\_ATTRID\_API attribute contains “sns\_timer.proto”

*Processing Stream Requests:*

1. SNS\_TIMER\_MSGID\_SNS\_TIMER\_SENSOR\_CONFIG: This message is used to start, reconfigure or stop the timer sensor.

*Publishing Stream Events:*

1. SNS\_TIMER\_MSGID\_SNS\_TIMER\_SENSOR\_EVENT: This event is generated when a timer’s timeout occurs.
2. SNS\_TIMER\_MSGID\_SNS\_TIMER\_SENSOR\_REG\_EVENT: This message is used to acknowledge that a timer was successfully registered. This event contains the sns\_timer\_reg\_event with the options selected by the timer sensor. The event will be re-sent each time the timer sensor automatically adjusts the period of a periodic timer.

Enums

- enum sns\_timer\_sensor\_timeout

    - *Values:*

- enumerator SNS\_TIMER\_SENSOR\_TIMEOUT\_MIN\_TIMEOUT\_NANOSEC

    -

- enum sns\_timer\_msgid

    - Message IDs for Timer Sensor.

*Values:*

- enumerator SNS\_TIMER\_MSGID\_SNS\_TIMER\_SENSOR\_CONFIG

    - Timer config message.

Corresponds to the message [sns\_timer\_sensor\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__timer__sensor__config). This message is used to start, reconfigure or stop the timer sensor.

- enumerator SNS\_TIMER\_MSGID\_SNS\_TIMER\_SENSOR\_EVENT

    - Timer event message.

Corresponds to the message [sns\_timer\_sensor\_event](https://docs.qualcomm.com/doc/80-P9361-100/topic/platform_sensors.html#structsns__timer__sensor__event). This event is generated when a timer’s timeout occurs.

- enumerator SNS\_TIMER\_MSGID\_SNS\_TIMER\_SENSOR\_REG\_EVENT

    - Timer registration message.

- enum sns\_timer\_priority

    - Priority of timer events.

*Values:*

- enumerator SNS\_TIMER\_PRIORITY\_LOWEST

    - Priority LOWEST is used for low priority timers.

- enumerator SNS\_TIMER\_PRIORITY\_OTHER

    - Priority OTHER is used for general timer events, and should be used by default.

- enumerator SNS\_TIMER\_PRIORITY\_POLLING

    - Priority POLLING is used for polling physical sensors.

- enumerator SNS\_TIMER\_PRIORITY\_S4S

    - Priority S4S is used for S4S schedules.

- struct sns\_timer\_sensor\_config

    - - struct start\_config\_message

    - Public Members

- required uint32 early\_start\_delta

    - The start\_time may be adjusted to start early by this many ticks.

- required uint32 late\_start\_delta

    - The start\_time may be adjusted to start late by this many ticks.

- struct timeout\_config\_message

    - Public Members

- required uint32 low\_timeout\_delta

    - The initial timeout\_period may be adjusted smaller by this many ticks.

- required uint32 high\_timeout\_delta

    - The initial timeout\_period may be adjusted larger by this many ticks.

- optional uint32 jitter\_ticks

    - jitter\_ticks only applies if “is\_periodic” is true. After the first TIMER\_SENSOR\_EVENT, the timeout\_period will only be adjusted by this many ticks in each period. The accumulated adjustments will stay within the low/high bounds defined in this message.

Public Members

- required uint64 start\_time

    - The time of starting the timer in ticks. This is typically current time.

- required uint64 timeout\_period

    - The timeout period starting from start\_time, in ticks.

- required bool is\_periodic

    - If this timer is periodic. If true, the timer will be rearmed to timeout\_period when the timer fires. If false, the timer will be disarmed after firing once. The memory associated with this timer will not be released until this connection is terminated.

- struct optional start\_config\_ start\_config

    - 

- struct optional timeout\_config\_ timeout\_config

    - 

- optional bool is\_dry\_run [default=false]

    - Set this to true to cause the timer sensor to send a TIMER\_SENSOR\_REG\_EVENT and include this timer as part of the timers to be synchronized, but the timer will not actually be started, and no TIMER\_SENSOR\_EVENTs will be generated. This is useful to know how to synchronize to other timers on the system without actually causing timer events to occur.

- optional sns\_timer\_priority priority [default=SNS\_TIMER\_PRIORITY\_OTHER]

    - If multiple timers expire at the same time, timer events with higher priority will be sent first. default: other.

- optional bool disable\_response [default=false]

    - Set this to true to disable sending a TIMER\_SENSOR\_REG\_EVENT TIMER\_SENSOR\_REG\_EVENT message might be unnecessary if client doesn’t want to handle it.

- struct sns\_timer\_sensor\_event

    - Public Members

- required uint64 requested\_timeout\_time

    - The timeout period generated from the timer\_sensor\_config message in ticks.

- required uint64 timeout\_time

    - The time at which the timer fired, in ticks.

- struct sns\_timer\_sensor\_reg\_event

    - This message is used to acknowledge that a timer was successfully registered. This event contains options selected by the timer sensor based on the config event. The event will be re-sent each time the timer sensor automatically adjusts the period of a periodic timer.

Public Members

- required uint64 start\_time

    - 

- required uint64 timeout\_period

    - 

- required bool is\_periodic

    - 

- required bool is\_dry\_run

    - 

- required sns\_timer\_priority priority

    -

Last Published: Jul 14, 2025

[Previous Topic
sns\_sar\_event\_recurrent](https://docs.qualcomm.com/bundle/publicresource/80-P9361-100/topics/driver.md)