Class RayNeoHid
java.lang.Object
eu.svjatoslav.aukio.e3d.gui.headtrack.RayNeoHid
- All Implemented Interfaces:
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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intFrame type: IMU sample. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static RayNeoHidopen()Finds the hidraw node of the glasses by scanning sysfs uevent data, then opens it.intreadFrame(com.sun.jna.Memory out) Blocking read of one 64-byte frame.voidstartImu()Enables the proximity sensor pipeline and starts IMU streaming.voidstopImu()Stops IMU streaming.
-
Field Details
-
FRAME_SIZE
public static final int FRAME_SIZE- See Also:
-
TYPE_IMU
public static final int TYPE_IMUFrame type: IMU sample.- See Also:
-
-
Method Details
-
open
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:
closein interfaceAutoCloseable
-