forked from mainflux/mainflux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage.go
47 lines (42 loc) · 1.51 KB
/
message.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
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"`
Bandwidth float64 `json:"bandwidth"`
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"`
}