mirror of
https://github.com/mainflux/mainflux.git
synced 2025-04-26 13:48:53 +08:00

* NOISSUE - Add tests and connection route-map to lora-adapter Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Rename LoraServer -> ChirpStack and fix links Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Remove ctx arg from Publish method Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix test Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Revert LoRa Server Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix links Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Check ids before to modify connection route-map Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Fix errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com> * Log conn errors Signed-off-by: Manuel Imperiale <manuel.imperiale@gmail.com>
45 lines
1.4 KiB
Go
45 lines
1.4 KiB
Go
package lora
|
|
|
|
// RxInfo receiver parameters
|
|
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"`
|
|
}
|
|
|
|
// DataRate lora data rate
|
|
type DataRate struct {
|
|
Modulation string `json:"modulation"`
|
|
Bandwith float64 `json:"bandwith"`
|
|
SpreadFactor int64 `json:"spreadFactor"`
|
|
}
|
|
|
|
// TxInfo transmeter parameters
|
|
type TxInfo struct {
|
|
Frequency float64 `json:"frequency"`
|
|
DataRate DataRate `json:"dataRate"`
|
|
Adr bool `json:"adr"`
|
|
CodeRate string `json:"codeRate"`
|
|
}
|
|
|
|
// Message lora msg (https://www.chirpstack.io/application-server/integrations/events)
|
|
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"`
|
|
}
|