@@ -164,6 +164,10 @@ func main() {
164
164
log .Println ("calling LibrarySearch(audio)" )
165
165
callLibSearch (client , instance )
166
166
167
+ // List the dependencies of the ArduinoIoTCloud library
168
+ log .Println ("calling LibraryResolveDependencies(ArduinoIoTCloud)" )
169
+ callLibraryResolveDependencies (client , instance )
170
+
167
171
// List installed libraries
168
172
log .Println ("calling LibraryList" )
169
173
callLibList (client , instance )
@@ -734,6 +738,26 @@ func callLibSearch(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
734
738
}
735
739
}
736
740
741
+ func callLibraryResolveDependencies (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
742
+ libraryResolveDependenciesResp , err := client .LibraryResolveDependencies (context .Background (),
743
+ & rpc.LibraryResolveDependenciesReq {
744
+ Instance : instance ,
745
+ Name : "ArduinoIoTCloud" ,
746
+ })
747
+
748
+ if err != nil {
749
+ log .Fatalf ("Error listing library dependencies: %s" , err )
750
+ }
751
+
752
+ for _ , resp := range libraryResolveDependenciesResp .GetDependencies () {
753
+ log .Printf ("Dependency Name: %s" , resp .GetName ())
754
+ log .Printf ("Version Required: %s" , resp .GetVersionRequired ())
755
+ if resp .GetVersionInstalled () != "" {
756
+ log .Printf ("Version Installed: %s\n " , resp .GetVersionInstalled ())
757
+ }
758
+ }
759
+ }
760
+
737
761
func callLibList (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
738
762
libLstResp , err := client .LibraryList (context .Background (),
739
763
& rpc.LibraryListReq {
0 commit comments