sensors

package
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetProvider

func SetProvider(p Provider)

func StartSensor

func StartSensor(sensorType string) error

func StopSensor

func StopSensor(sensorType string) error

Types

type Provider

type Provider interface {
	StartSensor(sensorType string) error
	StopSensor(sensorType string) error
}

Provider is a native sensors backend. On mobile the shell registers one via SetProvider (SensorManager on Android, CoreMotion on iOS) and delivers readings through the bridge event channel. Desktop machines rarely have motion sensors; the JS bridge falls back to devicemotion/deviceorientation events where the WebView supports them.

type SensorData

type SensorData struct {
	Type      string  `json:"type"`
	X         float64 `json:"x"`
	Y         float64 `json:"y"`
	Z         float64 `json:"z"`
	Timestamp int64   `json:"timestamp"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL