# Skel

## Device Mode

FastRPC IDL interface to set device modes.

Functions

- static \_\_inline void \_qaic\_memmove (void \*dst, void \*src, int size)

    - 

- int sns\_device\_mode\_open(const char \*uri, remote\_handle64 \*h)

    - FastRPC set device mode call from client to DSP.

Opens the handle in the specified domain. If this is the first handle, this creates the session. Typically this means opening the device, aka open(“/dev/adsprpc-smd”), then calling ioctl device APIs to create a PD on the DSP to execute our code in, then asking that PD to dlopen the .so and dlsym the skel function.

- Parameters:

    - - **uri, &lt;interface&gt;\_URI"&\_dom=aDSP"** – &lt;interface&gt;\_URI is a QAIC generated uri, or “file:///&lt;sofilename&gt;?&lt;interface&gt;\_skel\_handle\_invoke&\_modver=1.0” If the \_dom parameter is not present, \_dom=DEFAULT is assumed but not forwarded. Reserved uri keys: [0]: first unamed argument is the skel invoke function \_dom: execution domain name, \_dom=mDSP/aDSP/DEFAULT \_modver: module version, \_modver=1.0 \_\*: any other key name starting with an \_ is reserved Unknown uri keys/values are forwarded as is.
- **h, resulting** – handle

- Return values:

    - **0** – on success

- int sns\_device\_mode\_close(remote\_handle64 h)

    - Closes a handle. If this is the last handle to close, the session is closed as well, releasing all the allocated resources.

- Parameters:

    - **h, the** – handle to close

- Return values:

    - **0** – on success, should always succeed

- int sns\_device\_mode\_set(remote\_handle64 \_h, const char \*vec, int vecLen, uint32 \*result)

    - This function is a synchronous API to notify DSP about the device mode change.

- Parameters:

    - - **vec** – **[in]** Set vec.
- **result** – **[out]** output result.

- Returns:

    - long: output long.

## Direct Channel

FastRPC IDL interface to handle direct channel connections.

Functions

- static \_\_inline void \_qaic\_memmove (void \*dst, void \*src, int size)

    - 

- int sns\_direct\_channel\_open(const char \*uri, remote\_handle64 \*h)

    - open and close are reserved APIs now and will be autogenerated.

Opens the handle in the specified domain. If this is the first handle, this creates the session. Typically this means opening the device, aka open(“/dev/adsprpc-smd”), then calling ioctl device APIs to create a PD on the DSP to execute our code in, then asking that PD to dlopen the .so and dlsym the skel function.

- Parameters:

    - - **uri, &lt;interface&gt;\_URI"&\_dom=aDSP"** – &lt;interface&gt;\_URI is a QAIC generated uri, or “file:///&lt;sofilename&gt;?&lt;interface&gt;\_skel\_handle\_invoke&\_modver=1.0” If the \_dom parameter is not present, \_dom=DEFAULT is assumed but not forwarded. Reserved uri keys: [0]: first unamed argument is the skel invoke function \_dom: execution domain name, \_dom=mDSP/aDSP/DEFAULT \_modver: module version, \_modver=1.0 \_\*: any other key name starting with an \_ is reserved Unknown uri keys/values are forwarded as is.
- **h, resulting** – handle

- Return values:

    - **0** – on success

- int sns\_direct\_channel\_close(remote\_handle64 h)

    - Closes a handle. If this is the last handle to close, the session is closed as well, releasing all the allocated resources.

- Parameters:

    - **h, the** – handle to close

- Return values:

    - **0** – on success, should always succeed

- int sns\_direct\_channel\_create(remote\_handle64 \_h, const unsigned char \*settings, int settingsLen, int \*channel\_handle)

    - API to Create a direct channel with given settings for further client communication to sensor/sensors.

- Parameters:

    - - **settings** – **[in]** pb encoded [sns\_direct\_channel\_create\_msg](https://docs.qualcomm.com/doc/80-P9361-100/topic/standard.html#structsns__direct__channel__create__msg) raw bytes, details in sns\_direct\_channel.proto
- **handle** – **[out]** Unique handle to be used for config/delete

- Returns:

    - long: 0 — Operation was successful. All other values — Operation failed due to an unknown error.

- int sns\_direct\_channel\_config(remote\_handle64 \_h, int channel\_handle, const unsigned char \*config\_request, int config\_requestLen)

    - API to Either Configure the channel with sensor standard request or to update the existing channel run time parameters.

- Parameters:

    - - **handle** – **[in]** Channel handle from open API
- **config\_request** – **[in]** pb encoded [sns\_direct\_channel\_config\_msg](https://docs.qualcomm.com/doc/80-P9361-100/topic/standard.html#structsns__direct__channel__config__msg), details in sns\_direct\_channel.proto

- Returns:

    - 0 — Operation was successful. All other values — Operation failed due to an unknown error.

- int sns\_direct\_channel\_delete(remote\_handle64 \_h, int channel\_handle)

    - API to delete the direct channel.

- Parameters:

    - **handle** – **[in]** handle from open API.

- Returns:

    - 0 — Operation was successful. All other values — Operation failed due to an unknown error.

## Dynamic Loader

FastRPC IDL interface to load and unload dynamic libraries by QSH.

- struct load\_library\_config

    - Public Members

- char lib\_name[128]

    - name of the library

- unsigned char \*lib\_buffer

    - Buffer with library data in binary format

- int lib\_bufferLen

    -

- struct sensor\_reg\_config

    - Public Members

- char func[128]

    - Name of the sensor register function.

- uint8\_t count

    - Number of instances this sensor will be registered with QSH. The limit is enforced by QSH based on the maximum number of sensors supported per sensor type.

- struct sns\_dl\_entry

    - Public Members

- [load\_library\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/skel.html#_CPPv419load_library_config) load\_config

    - 

- boolean has\_reg\_config

    - True if registration config is provided using reg\_config below. If false, default registration configuration is used.

- [sensor\_reg\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/skel.html#_CPPv417sensor_reg_config) reg\_config

    - Valid when has\_reg\_config is true.

- struct sns\_dl\_handle

    - Public Members

- char lib\_name[128]

    - name of the library

Functions

- static \_\_inline void \_qaic\_memmove (void \*dst, void \*src, int size)

    - 

- int sns\_dynamic\_loader\_open(const char \*uri, remote\_handle64 \*h)

    - sns dynamic loader APIs

Opens the handle in the specified domain. If this is the first handle, this creates the session. Typically this means opening the device, aka open(“/dev/adsprpc-smd”), then calling ioctl device APIs to create a PD on the DSP to execute our code in, then asking that PD to dlopen the .so and dlsym the skel function.

- Parameters:

    - - **uri, &lt;interface&gt;\_URI"&\_dom=aDSP"** – &lt;interface&gt;\_URI is a QAIC generated uri, or “file:///&lt;sofilename&gt;?&lt;interface&gt;\_skel\_handle\_invoke&\_modver=1.0” If the \_dom parameter is not present, \_dom=DEFAULT is assumed but not forwarded. Reserved uri keys: [0]: first unamed argument is the skel invoke function \_dom: execution domain name, \_dom=mDSP/aDSP/DEFAULT \_modver: module version, \_modver=1.0 \_\*: any other key name starting with an \_ is reserved Unknown uri keys/values are forwarded as is.
- **h, resulting** – handle

- Return values:

    - **0** – on success

- int sns\_dynamic\_loader\_close(remote\_handle64 h)

    - Closes a handle. If this is the last handle to close, the session is closed as well, releasing all the allocated resources.

- Parameters:

    - **h, the** – handle to close

- Return values:

    - **0** – on success, should always succeed

- AEEResult sns\_dynamic\_loader\_load\_library(remote\_handle64 \_h, const [load\_library\_config](https://docs.qualcomm.com/doc/80-P9361-100/topic/skel.html#_CPPv419load_library_config) \*load\_config)

    - This is a synchronous API to load the dynamic library on DSP. The client needs to read the contents of the dynamic library into the load\_config-&gt;lib\_buffer and update the load\_config-&gt;lib\_bufferLen.

- Parameters:

    - **load\_config** – **[in]** set login\_config.

- Returns:

    - AEEResult: Returns AEEResult.

- AEEResult sns\_dynamic\_loader\_load\_sensor(remote\_handle64 \_h, const [sns\_dl\_entry](https://docs.qualcomm.com/doc/80-P9361-100/topic/skel.html#_CPPv412sns_dl_entry) \*dl\_entry)

    - This is a synchronous API to load the dynamic library on DSP and register it as a QSH sensor. The client needs to read the contents of the dynamic library into the load\_config-&gt;lib\_buffer and update the load\_config-&gt;lib\_bufferLen.

After loading the library, the sensor registration is attempted with the details provided in reg\_config. If reg\_config is not provided, the default registration configuration is used. If sensor registration fails, the library is unloaded.

- Parameters:

    - **dl\_entry** – **[in]** set dl\_entry.

- Returns:

    - AEEResult: Returns AEEResult.

- AEEResult sns\_dynamic\_loader\_unload(remote\_handle64 \_h, const [sns\_dl\_handle](https://docs.qualcomm.com/doc/80-P9361-100/topic/skel.html#_CPPv413sns_dl_handle) \*dl\_handle)

    - This is a synchronous API to unload the dynamic library loaded on DSP.

If a sensor is unloaded, any active datastreams to that sensor will get the sensor invalid state error.

- Parameters:

    - **dl\_handle** – **[in]** set dl\_handle.

- Returns:

    - AEEResult: Returns AEEResult

## Remote Proc State

FastRPC IDL interface for Clients to send Client processor time offset to Remote Proc State Sensor running on the DSP.

Enums

- enum sns\_client\_proc\_types

    - Client processor enum types supported by remote proc state sensor.

*Values:*

- enumerator SNS\_CLIENT\_PROC\_UNKNOWN

    - 

- enumerator SNS\_CLIENT\_PROC\_SSC

    - 

- enumerator SNS\_CLIENT\_PROC\_APSS

    - 

- enumerator SNS\_CLIENT\_PROC\_ADSP

    - 

- enumerator SNS\_CLIENT\_PROC\_MDSP

    - 

- enumerator SNS\_CLIENT\_PROC\_CDSP

    - 

- enumerator \_32BIT\_PLACEHOLDER\_sns\_client\_proc\_types

    -

Functions

- static \_\_inline void \_qaic\_memmove (void \*dst, void \*src, int size)

    - 

- int sns\_remote\_proc\_state\_open(const char \*uri, remote\_handle64 \*h)

    - sns remote proc state sensor APIs.

Opens the handle in the specified domain. If this is the first handle, this creates the session. Typically this means opening the device, aka open(“/dev/adsprpc-smd”), then calling ioctl device APIs to create a PD on the DSP to execute our code in, then asking that PD to dlopen the .so and dlsym the skel function.

- Parameters:

    - - **uri, &lt;interface&gt;\_URI"&\_dom=aDSP"** – &lt;interface&gt;\_URI is a QAIC generated uri, or “file:///&lt;sofilename&gt;?&lt;interface&gt;\_skel\_handle\_invoke&\_modver=1.0” If the \_dom parameter is not present, \_dom=DEFAULT is assumed but not forwarded. Reserved uri keys: [0]: first unamed argument is the skel invoke function \_dom: execution domain name, \_dom=mDSP/aDSP/DEFAULT \_modver: module version, \_modver=1.0 \_\*: any other key name starting with an \_ is reserved Unknown uri keys/values are forwarded as is.
- **h, resulting** – handle

- Return values:

    - **0** – on success

- int sns\_remote\_proc\_state\_close(remote\_handle64 h)

    - Closes a handle. If this is the last handle to close, the session is closed as well, releasing all the allocated resources.

- Parameters:

    - **h, the** – handle to close

- Return values:

    - **0** – on success, should always succeed

- AEEResult sns\_remote\_proc\_state\_set\_time\_offset(remote\_handle64 \_h, [sns\_client\_proc\_types](https://docs.qualcomm.com/doc/80-P9361-100/topic/skel.html#_CPPv421sns_client_proc_types) proc\_type, int64\_t time\_offset)

    - This function is a synchronous API to send Client processor time offset to remote proc state sensor running on the DSP.

- Parameters:

    - - **proc\_type** – **[in]** : Client processor type.
- **time\_offset** – **[in]** : Time offset between client processor time domain & QSH time domain in nano seconds.

- Returns:

    - AEEResult: Returns AEEResult.

Last Published: Jul 14, 2025

[Previous Topic
sns\_timer\_sensor\_reg\_event](https://docs.qualcomm.com/bundle/publicresource/80-P9361-100/topics/platform_sensors.md) [Next Topic
Standard](https://docs.qualcomm.com/bundle/publicresource/80-P9361-100/topics/standard.md)