abeeway

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgTypeFramePending     = 0x00 // Frame pending - trigger sending
	MsgTypePosition         = 0x03 // Position - GPS, low power GPS, WIFI or BLE position data
	MsgTypeStatus           = 0x04 // Status - Power and health status of the tracker (was EnergyStatus)
	MsgTypeHeartbeat        = 0x05 // Heartbeat - Notify that tracker is operational
	MsgTypeActivityStatus   = 0x07 // Activity Status, Configuration, Shock detection, or BLE MAC address
	MsgTypeShutdown         = 0x09 // Shutdown - Sent when tracker is set off
	MsgTypeEvent            = 0x0A // Event - Sends event information about tracker (was GeolocStart)
	MsgTypeCollectionScan   = 0x0B // Collection scan - WIFI or BLE collection scan data
	MsgTypeExtendedPosition = 0x0E // Extended Position - GPS, WiFi, BLE position
	MsgTypeDebug            = 0x0F // Debug - Internal use only

	// Legacy aliases for backward compatibility
	MsgTypeEnergyStatus = 0x04
	MsgTypeGeolocStart  = 0x0A
)

Message type constants for Abeeway Industrial Tracker AT2 v2.5

View Source
const (
	PosTypeGPS      = 0x01
	PosTypeWiFi     = 0x02
	PosTypeBLE      = 0x03
	PosTypeLowPower = 0x04
)

Position data type constants

View Source
const (
	StatusSOSBit              = 0x10 // Bit 4: SOS mode active
	StatusTrackingIdleBit     = 0x08 // Bit 3: Tracking/idle state
	StatusTrackerMovingBit    = 0x04 // Bit 2: Tracker is moving
	StatusPeriodicPositionBit = 0x02 // Bit 1: Periodic position message
	StatusPODMessageBit       = 0x01 // Bit 0: Position on demand
)

Status bit masks

View Source
const (
	ModeStandby           = 0
	ModeMotionTracking    = 1
	ModePermanentTracking = 2
	ModeMotionStartEnd    = 3
	ModeActivityTracking  = 4
	ModeOff               = 5
)

Operating mode values

View Source
const (
	DeviceTypeAbeewayIndustrialTracker = "ABEEWAY_INDUSTRIAL_TRACKER"
)

Abeeway Devices

Variables

This section is empty.

Functions

func GetMessageTypeName

func GetMessageTypeName(msgType byte) string

GetMessageTypeName returns the name of a message type

func GetModeName

func GetModeName(mode int) string

GetModeName returns the name of an operating mode

Types

type AbeewayComponent

type AbeewayComponent struct {
	// contains filtered or unexported fields
}

AbeewayComponent handles Abeeway Industrial Tracker devices

func NewAbeewayComponent

func NewAbeewayComponent() *AbeewayComponent

NewAbeewayComponent creates a new Abeeway component

func (*AbeewayComponent) CanHandle

func (c *AbeewayComponent) CanHandle(deviceType components.DeviceType, payload *components.RawPayload) bool

CanHandle checks if this component can handle the given device type and payload

func (*AbeewayComponent) GetInfo

GetInfo returns component metadata

func (*AbeewayComponent) GetSupportedDevices

func (c *AbeewayComponent) GetSupportedDevices() []components.DeviceType

GetSupportedDevices returns the device types this component supports

func (*AbeewayComponent) GetSupportedEntityTypes

func (c *AbeewayComponent) GetSupportedEntityTypes(deviceType components.DeviceType) []string

GetSupportedEntityTypes returns the entity types this device supports

func (*AbeewayComponent) GetSupportedPorts

func (c *AbeewayComponent) GetSupportedPorts(deviceType components.DeviceType) []int

GetSupportedPorts returns the fPorts this device type uses

func (*AbeewayComponent) Parse

Parse converts raw payload into structured ParsedData (DEPRECATED: Use ParseToEntities)

func (*AbeewayComponent) ParseToEntities

func (c *AbeewayComponent) ParseToEntities(ctx context.Context, orgSlug, model string, deviceType components.DeviceType, payload *components.RawPayload, deviceLocation *components.Location) (*components.ParseResult, error)

ParseToEntities converts raw payload into multiple entities

func (*AbeewayComponent) SupportsGPS

func (c *AbeewayComponent) SupportsGPS(deviceType components.DeviceType) bool

SupportsGPS returns true if the device has built-in GPS

func (*AbeewayComponent) Validate

func (c *AbeewayComponent) Validate(deviceType components.DeviceType, data *components.ParsedData) error

Validate performs device-specific validation on the parsed data

type AbeewayPayload

type AbeewayPayload struct {
	MessageType byte
	Status      byte
	Battery     byte // Raw battery value
	Temperature byte // Raw temperature value
	Ack         byte
	Data        []byte // Message-specific data
}

AbeewayPayload represents the parsed common payload header

type BLEBeacon

type BLEBeacon struct {
	MAC   string
	RSSI  int
	Major int
	Minor int
}

BLEBeacon represents a detected BLE beacon

type DeviceParser added in v0.0.2

type DeviceParser interface {
	ParsePayload(payload *components.RawPayload) (*components.ParsedData, error)
	ParseToEntities(orgSlug, model string, payload *components.RawPayload, deviceLocation *components.Location) ([]components.Entity, error)
	SupportsGPS() bool
	GetSupportedPorts() []int
	GetSupportedEntityTypes() []string
}

DeviceParser handles device-specific parsing logic

type EnergyData

type EnergyData struct {
	BatteryVoltage   float64
	BatteryLevel     float64
	Temperature      float64
	MainSupply       bool
	Charging         bool
	PowerConsumption float64
}

EnergyData represents energy status information

type IndustrialTrackerParser

type IndustrialTrackerParser struct{}

IndustrialTrackerParser handles parsing of Abeeway Industrial Tracker payloads

func NewIndustrialTrackerParser

func NewIndustrialTrackerParser() *IndustrialTrackerParser

NewIndustrialTrackerParser creates a new Industrial Tracker parser

func (*IndustrialTrackerParser) GetSupportedEntityTypes

func (p *IndustrialTrackerParser) GetSupportedEntityTypes() []string

GetSupportedEntityTypes returns entity types supported by Industrial Tracker

func (*IndustrialTrackerParser) GetSupportedPorts

func (p *IndustrialTrackerParser) GetSupportedPorts() []int

GetSupportedPorts returns the fPorts typically used by Industrial Tracker

func (*IndustrialTrackerParser) ParsePayload

ParsePayload parses Industrial Tracker device payload

func (*IndustrialTrackerParser) ParseToEntities

func (p *IndustrialTrackerParser) ParseToEntities(orgSlug, model string, payload *components.RawPayload, deviceLocation *components.Location) ([]components.Entity, error)

ParseToEntities creates entities for Industrial Tracker device

func (*IndustrialTrackerParser) SupportsGPS

func (p *IndustrialTrackerParser) SupportsGPS() bool

SupportsGPS returns true since Industrial Tracker has GPS

type PositionData

type PositionData struct {
	Type       string // "gps", "wifi", "ble", "low_power"
	Latitude   float64
	Longitude  float64
	Altitude   float64
	Accuracy   float64
	Satellites int
	Speed      float64
	Heading    float64
	Age        int      // Position age in seconds
	BSSIDList  []string // For WiFi positioning
	BLEData    []BLEBeacon
}

PositionData represents parsed position information

Jump to

Keyboard shortcuts

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