@@ -164,6 +164,10 @@ func main() {
164164 log .Println ("calling LibrarySearch(audio)" )
165165 callLibSearch (client , instance )
166166
167+ // List the dependencies of the ArduinoIoTCloud library
168+ log .Println ("calling LibraryResolveDependencies(ArduinoIoTCloud)" )
169+ callLibraryResolveDependencies (client , instance )
170+
167171 // List installed libraries
168172 log .Println ("calling LibraryList" )
169173 callLibList (client , instance )
@@ -734,6 +738,26 @@ func callLibSearch(client rpc.ArduinoCoreClient, instance *rpc.Instance) {
734738 }
735739}
736740
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+
737761func callLibList (client rpc.ArduinoCoreClient , instance * rpc.Instance ) {
738762 libLstResp , err := client .LibraryList (context .Background (),
739763 & rpc.LibraryListReq {
0 commit comments