Add firmware information
This commit is contained in:
@@ -164,9 +164,15 @@ func (drv *companionDriver) Info() *radio.Info {
|
|||||||
Longitude: drv.info.Longitude,
|
Longitude: drv.info.Longitude,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var firmwareDate time.Time
|
||||||
|
firmwareDate, _ = time.Parse("02-01-2006", drv.info.FirmwareBuildDate)
|
||||||
|
|
||||||
return &radio.Info{
|
return &radio.Info{
|
||||||
Name: drv.info.Name,
|
Name: drv.info.Name,
|
||||||
Manufacturer: drv.info.Manufacturer,
|
Manufacturer: drv.info.Manufacturer,
|
||||||
|
FirmwareDate: firmwareDate,
|
||||||
|
FirmwareVersion: drv.info.FirmwareVersion,
|
||||||
Modulation: protocol.LoRa,
|
Modulation: protocol.LoRa,
|
||||||
Position: pos,
|
Position: pos,
|
||||||
Frequency: drv.info.Frequency,
|
Frequency: drv.info.Frequency,
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
package radio
|
package radio
|
||||||
|
|
||||||
import "math"
|
import (
|
||||||
|
"math"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
// Info descriptor.
|
// Info descriptor.
|
||||||
type Info struct {
|
type Info struct {
|
||||||
Name string `yaml:"name" json:"name"` // Name of the device
|
Name string `yaml:"name" json:"name"` // Name of the device
|
||||||
Device string `yaml:"device" json:"device"` // Device type
|
Device string `yaml:"device" json:"device"` // Device type
|
||||||
Manufacturer string `yaml:"manufacturer" json:"manufacturer"` // Device manufacturer
|
Manufacturer string `yaml:"manufacturer" json:"manufacturer"` // Device manufacturer
|
||||||
|
FirmwareDate time.Time `yaml:"firmware_date" json:"firmware_date,omitempty"` // Firmware date
|
||||||
|
FirmwareVersion string `yaml:"firmware_version" json:"firmware_version"` // Firmware version
|
||||||
Antenna string `yaml:"antenna" json:"antenna"` // Antenna type
|
Antenna string `yaml:"antenna" json:"antenna"` // Antenna type
|
||||||
Modulation string `yaml:"modulation" json:"modulation"` // Modulation (constant from protocol)
|
Modulation string `yaml:"modulation" json:"modulation"` // Modulation (constant from protocol)
|
||||||
Position *Position `yaml:"position" json:"position"` // Position
|
Position *Position `yaml:"position" json:"position"` // Position
|
||||||
|
|||||||
Reference in New Issue
Block a user