@@ -13,6 +13,7 @@ type Client interface {
1313 DeviceCreate (fqbn , name , serial , devType string ) (string , error )
1414 DeviceDelete (id string ) error
1515 DeviceList () ([]iotclient.ArduinoDevicev2 , error )
16+ DeviceShow (id string ) (* iotclient.ArduinoDevicev2 , error )
1617 CertificateCreate (id , csr string ) (* iotclient.ArduinoCompressedv2 , error )
1718 ThingCreate (thing * iotclient.Thing , force bool ) (string , error )
1819 ThingUpdate (id string , thing * iotclient.Thing , force bool ) error
@@ -77,6 +78,17 @@ func (cl *client) DeviceList() ([]iotclient.ArduinoDevicev2, error) {
7778 return devices , nil
7879}
7980
81+ // DeviceShow allows to retrieve a specific device, given its id,
82+ // from Arduino IoT Cloud.
83+ func (cl * client ) DeviceShow (id string ) (* iotclient.ArduinoDevicev2 , error ) {
84+ dev , _ , err := cl .api .DevicesV2Api .DevicesV2Show (cl .ctx , id )
85+ if err != nil {
86+ err = fmt .Errorf ("retrieving device, %w" , errorDetail (err ))
87+ return nil , err
88+ }
89+ return & dev , nil
90+ }
91+
8092// CertificateCreate allows to upload a certificate on Arduino IoT Cloud.
8193// It returns the certificate parameters populated by the cloud.
8294func (cl * client ) CertificateCreate (id , csr string ) (* iotclient.ArduinoCompressedv2 , error ) {
0 commit comments