Documentation
¶
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") )
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 thingID:devEUI route-map
CreateThing(thingID string, devEUI string) error
// UpdateThing updates thingID:devEUI route-map
UpdateThing(thingID string, devEUI string) error
// RemoveThing removes thingID:devEUI route-map
RemoveThing(thingID string) error
// CreateChannel creates channelID:appID route-map
CreateChannel(chanID string, appID string) error
// UpdateChannel updates channelID:appID route-map
UpdateChannel(chanID string, appID string) error
// RemoveChannel removes channelID:appID route-map
RemoveChannel(chanID string) error
// Publish forwards messages from the LoRa MQTT broker to Mainflux NATS broker
Publish(ctx context.Context, token string, 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).
Click to show internal directories.
Click to hide internal directories.