@@ -48,11 +48,34 @@ func ListAll(ctx context.Context, req *rpc.BoardListAllReq) (*rpc.BoardListAllRe
48
48
list := & rpc.BoardListAllResp {Boards : []* rpc.BoardListItem {}}
49
49
for _ , targetPackage := range pm .Packages {
50
50
for _ , platform := range targetPackage .Platforms {
51
- platformRelease := pm .GetInstalledPlatformRelease (platform )
52
- if platformRelease == nil {
51
+ installedPlatformRelease := pm .GetInstalledPlatformRelease (platform )
52
+ // We only want to list boards for installed platforms
53
+ if installedPlatformRelease == nil {
53
54
continue
54
55
}
55
- for _ , board := range platformRelease .Boards {
56
+
57
+ installedVersion := ""
58
+ if installedPlatformRelease != nil {
59
+ installedVersion = installedPlatformRelease .Version .String ()
60
+ }
61
+
62
+ latestVersion := ""
63
+ if latestPlatformRelease := platform .GetLatestRelease (); latestPlatformRelease != nil {
64
+ latestVersion = latestPlatformRelease .Version .String ()
65
+ }
66
+
67
+ rpcPlatform := & rpc.Platform {
68
+ ID : platform .String (),
69
+ Installed : installedVersion ,
70
+ Latest : latestVersion ,
71
+ Name : platform .Name ,
72
+ Maintainer : platform .Package .Maintainer ,
73
+ Website : platform .Package .WebsiteURL ,
74
+ Email : platform .Package .Email ,
75
+ ManuallyInstalled : platform .ManuallyInstalled ,
76
+ }
77
+
78
+ for _ , board := range installedPlatformRelease .Boards {
56
79
if ! match (board .Name ()) {
57
80
continue
58
81
}
@@ -63,6 +86,7 @@ func ListAll(ctx context.Context, req *rpc.BoardListAllReq) (*rpc.BoardListAllRe
63
86
Name : board .Name (),
64
87
FQBN : board .FQBN (),
65
88
IsHidden : board .IsHidden (),
89
+ Platform : rpcPlatform ,
66
90
})
67
91
}
68
92
}
0 commit comments