@@ -15,7 +15,7 @@ type Client interface {
1515 DeviceDelete (id string ) error
1616 DeviceList () ([]iotclient.ArduinoDevicev2 , error )
1717 DeviceShow (id string ) (* iotclient.ArduinoDevicev2 , error )
18- DeviceOTA (id string , file * os.File ) error
18+ DeviceOTA (id string , file * os.File , expireMins int ) error
1919 CertificateCreate (id , csr string ) (* iotclient.ArduinoCompressedv2 , error )
2020 ThingCreate (thing * iotclient.Thing , force bool ) (string , error )
2121 ThingUpdate (id string , thing * iotclient.Thing , force bool ) error
@@ -93,9 +93,9 @@ func (cl *client) DeviceShow(id string) (*iotclient.ArduinoDevicev2, error) {
9393
9494// DeviceOTA performs an OTA upload request to Arduino IoT Cloud, passing
9595// 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 {
9797 opt := & iotclient.DevicesV2OtaUploadOpts {
98- ExpireInMins : optional .NewInt32 (5 ),
98+ ExpireInMins : optional .NewInt32 (int32 ( expireMins ) ),
9999 }
100100 _ , err := cl .api .DevicesV2OtaApi .DevicesV2OtaUpload (cl .ctx , id , file , opt )
101101 if err != nil {
0 commit comments