Skip to content

Commit 02bafe6

Browse files
committed
documentation: rename OP_INFO to REQ_INFO
Rename OP_INFO to REQ_INFO because the name changed after this commit: BitBoxSwiss/bitbox02-firmware@a785012 The name should be the same as in the firmware repositroy so that the code base is easier to understand.
1 parent fd97755 commit 02bafe6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

api/firmware/device.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ type DeviceInfoREQ_INFO struct {
132132
//
133133
// Can be given if known at the time of instantiation, e.g. by parsing the USB HID product string.
134134
// It must be provided if the version could be less than 4.3.0.
135-
// If nil, the version will be queried from the device using the OP_INFO api endpoint. Do this
135+
// If nil, the version will be queried from the device using the REQ_INFO api endpoint. Do this
136136
// when you are sure the firmware version is bigger or equal to 4.3.0.
137137
//
138-
// product: same deal as with the version, after 4.3.0 it can be inferred by OP_INFO.
138+
// product: same deal as with the version, after 4.3.0 it can be inferred by REQ_INFO.
139139
func NewDevice(
140140
version *semver.SemVer,
141141
product *common.Product,
@@ -232,13 +232,13 @@ func (device *Device) Version() *semver.SemVer {
232232
return device.version
233233
}
234234

235-
// inferVersionAndProduct either sets the version and product by using OP_INFO if they were not
236-
// provided. In this case, the firmware is assumed to be >=v4.3.0, before that OP_INFO was not
235+
// inferVersionAndProduct either sets the version and product by using REQ_INFO if they were not
236+
// provided. In this case, the firmware is assumed to be >=v4.3.0, before that REQ_INFO was not
237237
// available.
238238
func (device *Device) inferVersionAndProduct(version *semver.SemVer, product common.Product) {
239-
// The version has not been provided, so we try to get it from OP_INFO.
239+
// The version has not been provided, so we try to get it from REQ_INFO.
240240
if device.version == nil {
241-
device.log.Info(fmt.Sprintf("OP_INFO: version=%s, product=%s", version, product))
241+
device.log.Info(fmt.Sprintf("REQ_INFO: version=%s, product=%s", version, product))
242242
device.version = version
243243
device.product = &product
244244
}
@@ -263,7 +263,7 @@ func (device *Device) Init() error {
263263
deviceInfo, err := device.info()
264264
if err != nil {
265265
return errp.New(
266-
"OP_INFO unavailable; need to provide version and product via the USB HID descriptor")
266+
"REQ_INFO unavailable; need to provide version and product via the USB HID descriptor")
267267
}
268268
// Does nothing if device.version == nil
269269
device.inferVersionAndProduct(deviceInfo.version, deviceInfo.product)

api/firmware/query.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const (
3636
hwwReqRetry = "\x01"
3737
// Cancel any outstanding request.
3838
// hwwReqCancel = "\x02"
39-
// INFO api call (used to be OP_INFO api call), graduated to the toplevel framing so it works
39+
// REQ_INFO api call (used to be OP_INFO api call), graduated to the toplevel framing so it works
4040
// the same way for all firmware versions.
4141
hwwInfo = "i"
4242

0 commit comments

Comments
 (0)