Remove the brackets around the -f option which imply that it is
optional. The default value is a NULL pointer.
FastRPC is not specialized to serving files to the DSPs and can do other
things such as logging and profiling, pending discovery. Change the
description of the program accordingly.
Referring to a "FastRPC node" is a bit vague and misses the detail that
the program is expecting a path to a file (a device node). Refer to the
file as a FastRPC device node so the user can intuitively look for what
the program wants.
The letter in the -R option was seemingly chosen arbitrarily. Add the
word which it originated from ("root") to make it memorable.
The INIT_ATTACH and INIT_ATTACH_SNS terms have no meaning in the usage
text. They are terms of jargon originating in the userspace API for the
Linux kernel driver, as abbreviations of FASTRPC_IOCTL_INIT_ATTACH and
FASTRPC_IOCTL_INIT_ATTACH_SNS. It is unclear what the difference is
between the two, and SNS is ambiguous with no clear connection to
sensors (did Qualcomm design some DSP communication protocol around a
Social Networking Service?). Instead of deriving terms used to inform
the driver how to interact with the DSP, use the name of the
PD ("sensorspd") and describe the effective interaction with the DSP.
If the file name for the FastRPC device node is a NULL pointer, then the
error message always prints out a NULL pointer, made redundant by the
word "invalid". An unspecified device node is an error made by the user,
and the usage text should be given to the user instead of an internal
diagnosis of invalid usage.
This is a proof-of-concept for interacting with the Snapdragon Sensor Core using the reverse-engineered protocol buffers. It was made to try to initialize it, but the Pixel 3a is missing some sensors once the firmware is loaded.
A best effort is made to prefix all log messages with sensh: so it's clear
which lines were entered by the user.
Requirements
- gcc
- libqrtr
- meson or make
- protobuf-c
- qmic (optional for regenerating QMI, at https://github.com/andersson/qmic)
Installation
This can be compiled using Meson:
$ meson setup build
$ ninja -C build
There is also a Makefile to compile this, if you can get it to work:
$ mkdir build
$ make -k
Usage
Sensh doesn't automatically track, probe, or look up sensors; that is for a full implementation. Instead, it expects you to look up the sensor and copy the ID with your terminal emulator:
lookup accel_cal
sensh: accel_cal sensor found: A1392FDF217B7D9EI6648AED8C04DDFB9
attr A1392FDF217B7D9EI6648AED8C04DDFB9
sensh: name: ASH_CAL
sensh: vendor: GOOGLE
sensh: type: accel_cal
sensh: version: 1
sensh: api: sns_cal.proto
sensh: rates: 10.000000
sensh: stream type: 1
sensh: physical sensor: 0
sensh: available: 1
You can send 3 messages: lookup, attr, and watch. The lookup command returns SUIDs for the passed data type. The attr command returns attributes for the sensor. Finally, the watch command tells the sensor core to send events from a sensor whenever the sensor's value changes.
An EOF (normally Ctrl+D) is enough to exit the shell unless the sensor core died.
References
The following sources were used as reference: