Documentation ¶
Overview ¶
Package lora contains the domain concept definitions needed to support Magistrala LoRa service functionality.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMalformedMessage indicates malformed LoRa message. ErrMalformedMessage = errors.New("malformed message received") // ErrNotFoundDev indicates a non-existent route map for a device EUI. ErrNotFoundDev = errors.New("route map not found for this device EUI") // ErrNotFoundApp indicates a non-existent route map for an application ID. ErrNotFoundApp = errors.New("route map not found for this application ID") // ErrNotConnected indicates a non-existent route map for a connection. ErrNotConnected = errors.New("route map not found for this connection") )
Functions ¶
This section is empty.
Types ¶
type DataRate ¶
type DataRate struct { Modulation string `json:"modulation"` Bandwidth float64 `json:"bandwidth"` SpreadFactor int64 `json:"spreadFactor"` }
DataRate lora data rate.
type Message ¶
type Message struct { ApplicationID string `json:"applicationID"` ApplicationName string `json:"applicationName"` DeviceName string `json:"deviceName"` DevEUI string `json:"devEUI"` DeviceStatusBattery string `json:"deviceStatusBattery"` DeviceStatusMrgin string `json:"deviceStatusMargin"` RxInfo RxInfo `json:"rxInfo"` TxInfo TxInfo `json:"txInfo"` FCnt int `json:"fCnt"` FPort int `json:"fPort"` Data string `json:"data"` Object interface{} `json:"object"` }
Message lora msg (https://www.chirpstack.io/application-server/integrations/events).
type RouteMapRepository ¶
type RouteMapRepository interface { // Save stores/routes pair lora application topic & magistrala channel. Save(context.Context, string, string) error // Channel returns magistrala channel for given lora application. Get(context.Context, string) (string, error) // Removes mapping from cache. Remove(context.Context, string) error }
RouteMapRepository store route map between Lora App Server and Magistrala.
type RxInfo ¶
type RxInfo []struct { Mac string `json:"mac"` Name string `json:"name"` Latitude float64 `json:"latitude"` Longitude float64 `json:"longitude"` Altitude float64 `json:"altitude"` Time string `json:"time"` Rssi float64 `json:"rssi"` LoRaSNR float64 `json:"loRaSNR"` }
RxInfo receiver parameters.
type Service ¶
type Service interface { // CreateThing creates thingID:devEUI route-map CreateThing(ctx context.Context, thingID, devEUI string) error // UpdateThing updates thingID:devEUI route-map UpdateThing(ctx context.Context, thingID, devEUI string) error // RemoveThing removes thingID:devEUI route-map RemoveThing(ctx context.Context, thingID string) error // CreateChannel creates channelID:appID route-map CreateChannel(ctx context.Context, chanID, appID string) error // UpdateChannel updates channelID:appID route-map UpdateChannel(ctx context.Context, chanID, appID string) error // RemoveChannel removes channelID:appID route-map RemoveChannel(ctx context.Context, chanID string) error // ConnectThing creates thingID:channelID route-map ConnectThing(ctx context.Context, chanID, thingID string) error // DisconnectThing removes thingID:channelID route-map DisconnectThing(ctx context.Context, chanID, thingID string) error // Publish forwards messages from the LoRa MQTT broker to Magistrala Message Broker Publish(ctx context.Context, msg *Message) error }
Service specifies an API that must be fullfiled by the domain service implementation, and all of its decorators (e.g. logging & metrics).
Directories ¶
Path | Synopsis |
---|---|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations.
|
Package api contains API-related concerns: endpoint definitions, middlewares and all resource representations. |
Package events provides the domain concept definitions needed to support lora events functionality.
|
Package events provides the domain concept definitions needed to support lora events functionality. |
Package mocks contains mocks for testing purposes.
|
Package mocks contains mocks for testing purposes. |
Package mqtt contains the domain concept definitions needed to support Magistrala MQTT adapter functionality.
|
Package mqtt contains the domain concept definitions needed to support Magistrala MQTT adapter functionality. |
Click to show internal directories.
Click to hide internal directories.