Skip to content

Commit a5dbe50

Browse files
authored
Merge branch 'main' into dependabot/github_actions/github/codeql-action-3.29.5
2 parents e772384 + 90a2d25 commit a5dbe50

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

tools/projmgr/include/ProjMgrRpcServerData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class RpcDataCollector {
4949
std::string ResultStringFromRteItem(const RteItem* item) const;
5050

5151
protected:
52-
void CollectBoardDevices(vector<RpcArgs::Device>& boardDevices, RteBoard* rteBoard, bool bInstalled, std::list<RteDevice*>& processedDevices) const;
52+
void CollectBoardDevices(vector<RpcArgs::Device>& boardDevices, RteBoard* rteBoard, bool bMounted, std::list<RteDevice*>& processedDevices) const;
5353
void CollectCtBundles(RpcArgs::CtClass& ctClass, RteComponentGroup* rteClass) const;
5454
void CollectCtChildren(RpcArgs::CtTreeItem& parent, RteComponentGroup* rteGroup, const string& bundleName) const;
5555
void CollectCtAggregates(RpcArgs::CtTreeItem& parent, RteComponentGroup* rteGroup, const string& bundleName) const;

tools/projmgr/src/ProjMgrRpcServerData.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ RpcArgs::Board RpcDataCollector::FromRteBoard( RteBoard* rteBoard, bool bInclude
227227
vector<RpcArgs::Device> devices;
228228
list<RteDevice*> processedDevices;
229229
CollectBoardDevices(devices, rteBoard, true, processedDevices);
230-
CollectBoardDevices(devices, rteBoard, false, processedDevices);
231230
if(!devices.empty()) {
232231
b.devices = devices;
233232
}
@@ -236,19 +235,18 @@ RpcArgs::Board RpcDataCollector::FromRteBoard( RteBoard* rteBoard, bool bInclude
236235
}
237236

238237
void RpcDataCollector::CollectBoardDevices(vector<RpcArgs::Device>& boardDevices, RteBoard* rteBoard,
239-
bool bInstalled, list<RteDevice*>& processedDevices) const {
238+
bool bMounted, list<RteDevice*>& processedDevices) const {
240239
list<RteItem*> refDevices;
241-
rteBoard->GetDevices(refDevices, !bInstalled, bInstalled);
240+
rteBoard->GetDevices(refDevices, !bMounted, bMounted);
242241
for(auto rteItem : refDevices) {
243242
RteDevice* rteDevice = m_model->GetDevice(rteItem->GetDeviceName(), rteItem->GetDeviceVendor());
244243
if(rteDevice && find(processedDevices.begin(), processedDevices.end(), rteDevice) == processedDevices.end()) {
245244
processedDevices.push_back(rteDevice);
246-
boardDevices.push_back(FromRteDevice(rteDevice, bInstalled));
245+
boardDevices.push_back(FromRteDevice(rteDevice, bMounted));
247246
}
248247
}
249248
}
250249

251-
252250
void RpcDataCollector::CollectDeviceList(RpcArgs::DeviceList& deviceList, const std::string& namePattern, const std::string& vendor) const {
253251
list<RteDevice*> devices;
254252
if(m_model) {

tools/projmgr/test/src/ProjMgrRpcTests.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,16 +380,17 @@ TEST_F(ProjMgrRpcTests, RpcBoardInfo) {
380380
EXPECT_EQ(b1["pack"], "ARM::[email protected]");
381381
EXPECT_EQ(b1["description"], "uVision Simulator");
382382
auto devices = b1["devices"];
383-
EXPECT_EQ(devices.size(), 4);
383+
EXPECT_EQ(devices.size(), 2);
384384
EXPECT_FALSE(b1.contains("memories"));
385385
auto d1 = devices[1];
386386
EXPECT_EQ(d1["id"], "ARM::RteTest_ARMCM0_Dual");
387387
EXPECT_EQ(d1["processors"].size(), 2);
388388
EXPECT_EQ(d1["processors"][0]["name"], "cm0_core0");
389389

390-
auto d2 = devices[2];
391-
EXPECT_EQ(d2["id"], "ARM::RteTest_ARMCM4_NOFP");
392-
EXPECT_FALSE(d2.contains("processors"));
390+
auto d0 = devices[0];
391+
EXPECT_EQ(d0["id"], "ARM::RteTest_ARMCM3");
392+
EXPECT_EQ(d0["processors"].size(), 1);
393+
EXPECT_EQ(d0["processors"][0]["name"], "");
393394

394395
auto b2 = responses[2]["result"]["board"];
395396
EXPECT_EQ(b2["id"], "Keil::RteTest Test board:1.1.1");

0 commit comments

Comments
 (0)