@@ -15,7 +15,7 @@ type Client interface {
15
15
DeviceDelete (id string ) error
16
16
DeviceList () ([]iotclient.ArduinoDevicev2 , error )
17
17
DeviceShow (id string ) (* iotclient.ArduinoDevicev2 , error )
18
- DeviceOTA (id string , file * os.File ) error
18
+ DeviceOTA (id string , file * os.File , expireMins int ) error
19
19
CertificateCreate (id , csr string ) (* iotclient.ArduinoCompressedv2 , error )
20
20
ThingCreate (thing * iotclient.Thing , force bool ) (string , error )
21
21
ThingUpdate (id string , thing * iotclient.Thing , force bool ) error
@@ -93,9 +93,9 @@ func (cl *client) DeviceShow(id string) (*iotclient.ArduinoDevicev2, error) {
93
93
94
94
// DeviceOTA performs an OTA upload request to Arduino IoT Cloud, passing
95
95
// the ID of the device to be updated and the actual file containing the OTA firmware.
96
- func (cl * client ) DeviceOTA (id string , file * os.File ) error {
96
+ func (cl * client ) DeviceOTA (id string , file * os.File , expireMins int ) error {
97
97
opt := & iotclient.DevicesV2OtaUploadOpts {
98
- ExpireInMins : optional .NewInt32 (5 ),
98
+ ExpireInMins : optional .NewInt32 (int32 ( expireMins ) ),
99
99
}
100
100
_ , err := cl .api .DevicesV2OtaApi .DevicesV2OtaUpload (cl .ctx , id , file , opt )
101
101
if err != nil {
0 commit comments