Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMalformedIdentity indicates malformed identity received (e.g. // invalid appID or deviceEUI). ErrMalformedIdentity = errors.New("malformed identity received") // 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") )
Functions ¶
This section is empty.
Types ¶
type DataRate ¶
type DataRate struct { Modulation string `json:"modulation"` Bandwith float64 `json:"bandwith"` 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 (www.loraserver.io/lora-app-server/integrate/data/)
type RouteMapRepository ¶
type RouteMapRepository interface { // Save stores/routes pair lora application topic & mainflux channel. Save(string, string) error // Channel returns mainflux channel for given lora application. Get(string) (string, error) // Removes mapping from cache. Remove(string) error }
RouteMapRepository store route map between Lora App Server and Mainflux
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 thing mfx:lora & lora:mfx route-map CreateThing(string, string) error // UpdateThing updates thing mfx:lora & lora:mfx route-map UpdateThing(string, string) error // RemoveThing removes thing mfx:lora & lora:mfx route-map RemoveThing(string) error // CreateChannel creates channel mfx:lora & lora:mfx route-map CreateChannel(string, string) error // UpdateChannel updates mfx:lora & lora:mfx route-map UpdateChannel(string, string) error // RemoveChannel removes channel mfx:lora & lora:mfx route-map RemoveChannel(string) error // Publish forwards messages from the LoRa MQTT broker to Mainflux NATS broker Publish(context.Context, string, Message) error }
Service specifies an API that must be fullfiled by the domain service implementation, and all of its decorators (e.g. logging & metrics).
func New ¶
func New(pub mainflux.MessagePublisher, thingsRM, channelsRM RouteMapRepository) Service
New instantiates the LoRa adapter implementation.
Click to show internal directories.
Click to hide internal directories.