Add firmware information
This commit is contained in:
@@ -164,16 +164,22 @@ 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,
|
||||||
Modulation: protocol.LoRa,
|
FirmwareDate: firmwareDate,
|
||||||
Position: pos,
|
FirmwareVersion: drv.info.FirmwareVersion,
|
||||||
Frequency: drv.info.Frequency,
|
Modulation: protocol.LoRa,
|
||||||
Bandwidth: drv.info.Bandwidth,
|
Position: pos,
|
||||||
Power: float64(drv.info.Power),
|
Frequency: drv.info.Frequency,
|
||||||
LoRaSF: drv.info.SpreadingFactor,
|
Bandwidth: drv.info.Bandwidth,
|
||||||
LoRaCR: drv.info.CodingRate,
|
Power: float64(drv.info.Power),
|
||||||
|
LoRaSF: drv.info.SpreadingFactor,
|
||||||
|
LoRaCR: drv.info.CodingRate,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,29 @@
|
|||||||
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
|
||||||
Antenna string `yaml:"antenna" json:"antenna"` // Antenna type
|
FirmwareDate time.Time `yaml:"firmware_date" json:"firmware_date,omitempty"` // Firmware date
|
||||||
Modulation string `yaml:"modulation" json:"modulation"` // Modulation (constant from protocol)
|
FirmwareVersion string `yaml:"firmware_version" json:"firmware_version"` // Firmware version
|
||||||
Position *Position `yaml:"position" json:"position"` // Position
|
Antenna string `yaml:"antenna" json:"antenna"` // Antenna type
|
||||||
Frequency float64 `yaml:"frequency" json:"frequency"` // Frequency (in MHz)
|
Modulation string `yaml:"modulation" json:"modulation"` // Modulation (constant from protocol)
|
||||||
RXFrequency float64 `yaml:"rx_frequency" json:"rx_frequency,omitempty"` // Used with split VFOs
|
Position *Position `yaml:"position" json:"position"` // Position
|
||||||
TXFrequency float64 `yaml:"tx_frequency" json:"tx_frequency,omitempty"` // Used with split VFOs
|
Frequency float64 `yaml:"frequency" json:"frequency"` // Frequency (in MHz)
|
||||||
Bandwidth float64 `yaml:"bandwidth" json:"bandwidth"` // Bandwidth (in kHz)
|
RXFrequency float64 `yaml:"rx_frequency" json:"rx_frequency,omitempty"` // Used with split VFOs
|
||||||
Power float64 `yaml:"power" json:"power"` // Power (in dBm)
|
TXFrequency float64 `yaml:"tx_frequency" json:"tx_frequency,omitempty"` // Used with split VFOs
|
||||||
Gain float64 `yaml:"gain" json:"gain"` // Gain (in dBm)
|
Bandwidth float64 `yaml:"bandwidth" json:"bandwidth"` // Bandwidth (in kHz)
|
||||||
LoRaSF uint8 `yaml:"lora_sf" json:"lora_sf,omitempty"` // LoRa spreading factor
|
Power float64 `yaml:"power" json:"power"` // Power (in dBm)
|
||||||
LoRaCR uint8 `yaml:"lora_cr" json:"lora_cr,omitempty"` // LoRa coding rate
|
Gain float64 `yaml:"gain" json:"gain"` // Gain (in dBm)
|
||||||
Extra map[string]any `yaml:"extra" json:"extra"` // Extra metadata
|
LoRaSF uint8 `yaml:"lora_sf" json:"lora_sf,omitempty"` // LoRa spreading factor
|
||||||
|
LoRaCR uint8 `yaml:"lora_cr" json:"lora_cr,omitempty"` // LoRa coding rate
|
||||||
|
Extra map[string]any `yaml:"extra" json:"extra"` // Extra metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
type Position struct {
|
type Position struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user