Skip to content

Commit ba77092

Browse files
committed
Merge branch 'exposeInfo'
2 parents aaf0e94 + a53ec29 commit ba77092

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

api/firmware/device.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,13 @@ func NewDevice(
170170
}
171171
}
172172

173-
// info uses the opInfo api endpoint to learn about the version, platform/edition, and unlock
173+
// Info uses the opInfo api endpoint to learn about the version, platform/edition, and unlock
174174
// status (true if unlocked).
175-
func (device *Device) info() (*semver.SemVer, common.Product, bool, error) {
176-
175+
func Info(communication Communication) (*semver.SemVer, common.Product, bool, error) {
177176
// CAREFUL: hwwInfo is called on the raw transport, not on device.rawQuery, which behaves
178177
// differently depending on the firmware version. Reason: the version is not
179178
// available (this call is used to get the version), so it must work for all firmware versions.
180-
response, err := device.communication.Query([]byte(hwwInfo))
179+
response, err := communication.Query([]byte(hwwInfo))
181180
if err != nil {
182181
return nil, "", false, err
183182
}
@@ -227,6 +226,10 @@ func (device *Device) info() (*semver.SemVer, common.Product, bool, error) {
227226
return version, product, unlocked, nil
228227
}
229228

229+
func (device *Device) info() (*semver.SemVer, common.Product, bool, error) {
230+
return Info(device.communication)
231+
}
232+
230233
// Version returns the firmware version.
231234
func (device *Device) Version() *semver.SemVer {
232235
if device.version == nil {

0 commit comments

Comments
 (0)