Skip to content

Feature daemon#9

Open
riansanderson wants to merge 21 commits intomasterfrom
feature-daemon
Open

Feature daemon#9
riansanderson wants to merge 21 commits intomasterfrom
feature-daemon

Conversation

@riansanderson
Copy link

This is the update which supports:

  • IIO host interface driver
  • OSP daemon with open algorithms

Hunyue Yau added 19 commits September 18, 2015 15:27
Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
- Provide a set of basic algs. Currently, it has only been tested
with the daemon. It should be useable on the embedded side. The make
system needs to be beefed up to support embedded use.

- Add a daemon. This supports different modes of
operation/translation.
Data can be sourced from:
  - Input event devices.
  - IIO devices
  - Files (testing)

Data can be sent to:
  - Another input device
  - A file.

With suitable mods, this can also be linked to part of a the
HAL.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
This is not for a particular kernel and can be adapted to most
kernels.

This driver uses I2C to talk to an OSP sensor hub. Two output options
are offered:
 - input events
 - IIO

See README for installation details.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Remove obsolete Keil work around code.
Consolidate union members.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
This is a temporary work around to support private sensors
prior to debugging inbound control packets. This patch
adds 2 registers used to select between private and android
sensor spaces. By default, android sensor space is selected to
retain compatibility.

0x1f - a read of this register selects the android sensor space
0x1e - a read of this register selects the private sensor space

Usage protocol:
To enable/disable a public sensor:
  read(0x1f)
  read(0x20+sensor number) or read(0x50+sensor number)

To enable/disable a private sensor:
  read(0x1e)
  read(0x20+private sensor number) or read(0x50+private sensor number)

Note the private sensor number is the sensor number without the
high private bit set!

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Non static binaries requires usage of a bionic toolchain.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Unbuffered iio devices do not have a scanelements directory.
Handle the case where that directory is not there.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
- Add null pointer check for data coming from algs.
- Abort if cal length being read is longer then available buffer space.
- Add quiet option to suppress initial banner.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
[inputN|outputN].option provides a way for a driver to receive
configuration/option info. The parameter is a 32bit unsigned value.
Values can be specified as decimal or hex by prefixing it with a 0x.

The meaning of the value is solely determined by the driver.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Add support for 3 options:
bit 0 - enable embedded time stamp support. 64 bit time stamps are
  sent as ABS_THROTTLE (upper 32bit) and ABS_RUDDER (lower 32bit)

bit 1 - Send the 4th element of a quaternion as ABS_WHEEL.

bit 2 - Enable dithering of data.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
These files are used for defines and datastructures but are not
included by the NDK toolchain. For now, save a copy here.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
The data structure is initialized to 0 but DRIVER_INPUT is also
0. Moving DRIVER_INPUT to a non-zero value allows 0'ed but not
configured entries to be ignored.

Signed-off-by: Hunyue Yau <hy-git@hy-research.com>
Signed-off-by: Hunyue Yau <hy-git@hy-research.com>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was this meant to do? Why is this using both fields of the union?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data conversion. As indicated by references to formats.

@gvravindra
Copy link

Some general review comments/questions -

  • Error values returned from API calls are not checked/handled in most of the places.
  • How and at what point of time does the daemon exit?
  • setup_out for drivers implementation is missing, should the fd's be closed in this method?, currently none of them are closed.

@hyau
Copy link

hyau commented Oct 6, 2015

This is a daemon; it does not exit.
setup_out is used only for an output drivers. There are 2 types of drivers.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Total No of android sensors created : 16 ..
While creating IIO device, we are initializing data for android sensors : SENSOR_ACCELEROMETER, SENSOR_GYROSCOPE, SENSOR_MAGNETIC_FIELD &
SENSOR_ROTATION_VECTOR. do we need to set data for other sensors as well?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That code is left over from before the sensorhub was available. It is still there to make it easy to catch the case where the sensorhub is failing to send data. Once we have a reliable hub, this code should go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants