mirror of https://github.com/periph/devices
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
365 B
Go
24 lines
365 B
Go
package firmata
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
type FirmwareReport struct {
|
|
Major byte
|
|
Minor byte
|
|
Name []byte
|
|
}
|
|
|
|
func ParseFirmwareReport(data []byte) FirmwareReport {
|
|
return FirmwareReport{
|
|
Major: data[0],
|
|
Minor: data[1],
|
|
Name: data[2:],
|
|
}
|
|
}
|
|
|
|
func (r FirmwareReport) String() string {
|
|
return fmt.Sprintf("%s [%d.%d]", TwoByteString(r.Name), r.Major, r.Minor)
|
|
}
|