Class RayNeoHid

java.lang.Object
eu.svjatoslav.aukio.e3d.gui.headtrack.RayNeoHid
All Implemented Interfaces:
AutoCloseable

public final class RayNeoHid extends Object implements AutoCloseable
Raw HID transport for RayNeo AR glasses (T&A Mobile Phones, VID 1BBB, PID AF50) via Linux hidraw.

IMU sample layout inside a 0x65 frame (all little-endian):

  • float acc[3] at offset 4 (m/s²)
  • float gyro[3] at offset 16 (degrees/second)
  • float temperature at 28, float magnet[0..1] at 32
  • uint32 tick at 40 (NOT microseconds — ~50µs per unit; use only as a liveness signal, never for integration timing)
  • float psensor at 44, float lsensor at 48, float magnet[2] at 52

Startup sequence that yields live data: psensor enable (0x38) THEN IMU on (0x01). Without the psensor enable the glasses may stream frozen sensor values.

Permissions: /dev/hidraw* is root-only by default. Install a udev rule (e.g. 99-rayneo-glasses.rules with MODE="0666" for VID 1BBB PID AF50) to allow user access.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
    Frame type: IMU sample.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    static RayNeoHid
    Finds the hidraw node of the glasses by scanning sysfs uevent data, then opens it.
    int
    readFrame(com.sun.jna.Memory out)
    Blocking read of one 64-byte frame.
    void
    Enables the proximity sensor pipeline and starts IMU streaming.
    void
    Stops IMU streaming.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • open

      public static RayNeoHid open() throws IOException
      Finds the hidraw node of the glasses by scanning sysfs uevent data, then opens it. Returns null when the glasses are not connected.
      Throws:
      IOException
    • startImu

      public void startImu()
      Enables the proximity sensor pipeline and starts IMU streaming. Both commands are required; psensor-first ordering matters.
    • stopImu

      public void stopImu()
      Stops IMU streaming.
    • readFrame

      public int readFrame(com.sun.jna.Memory out)
      Blocking read of one 64-byte frame. Returns the frame type byte (e.g. TYPE_IMU) or -1 on error/closed device. The frame bytes are left in the given buffer for the caller to parse.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable