Documentation
¶
Index ¶
- Constants
- func GetMessageTypeName(msgType byte) string
- func GetModeName(mode int) string
- type AbeewayComponent
- func (c *AbeewayComponent) CanHandle(deviceType components.DeviceType, payload *components.RawPayload) bool
- func (c *AbeewayComponent) GetInfo() components.ComponentInfo
- func (c *AbeewayComponent) GetSupportedDevices() []components.DeviceType
- func (c *AbeewayComponent) GetSupportedEntityTypes(deviceType components.DeviceType) []string
- func (c *AbeewayComponent) GetSupportedPorts(deviceType components.DeviceType) []int
- func (c *AbeewayComponent) Parse(ctx context.Context, deviceType components.DeviceType, ...) (*components.ParsedData, error)
- func (c *AbeewayComponent) ParseToEntities(ctx context.Context, orgSlug, model string, deviceType components.DeviceType, ...) (*components.ParseResult, error)
- func (c *AbeewayComponent) SupportsGPS(deviceType components.DeviceType) bool
- func (c *AbeewayComponent) Validate(deviceType components.DeviceType, data *components.ParsedData) error
- type AbeewayPayload
- type BLEBeacon
- type DeviceParser
- type EnergyData
- type IndustrialTrackerParser
- func (p *IndustrialTrackerParser) GetSupportedEntityTypes() []string
- func (p *IndustrialTrackerParser) GetSupportedPorts() []int
- func (p *IndustrialTrackerParser) ParsePayload(payload *components.RawPayload) (*components.ParsedData, error)
- func (p *IndustrialTrackerParser) ParseToEntities(orgSlug, model string, payload *components.RawPayload, ...) ([]components.Entity, error)
- func (p *IndustrialTrackerParser) SupportsGPS() bool
- type PositionData
Constants ¶
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
const ( PosTypeGPS = 0x01 PosTypeWiFi = 0x02 PosTypeBLE = 0x03 PosTypeLowPower = 0x04 )
Position data type constants
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
const ( ModeStandby = 0 ModeMotionTracking = 1 ModePermanentTracking = 2 ModeMotionStartEnd = 3 ModeActivityTracking = 4 ModeOff = 5 )
Operating mode values
const (
DeviceTypeAbeewayIndustrialTracker = "ABEEWAY_INDUSTRIAL_TRACKER"
)
Abeeway Devices
Variables ¶
This section is empty.
Functions ¶
func GetMessageTypeName ¶
GetMessageTypeName returns the name of a message type
func GetModeName ¶
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 ¶
func (c *AbeewayComponent) GetInfo() components.ComponentInfo
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 ¶
func (c *AbeewayComponent) Parse(ctx context.Context, deviceType components.DeviceType, payload *components.RawPayload) (*components.ParsedData, error)
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 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 ¶
func (p *IndustrialTrackerParser) ParsePayload(payload *components.RawPayload) (*components.ParsedData, error)
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