Skip to content

Commit 211c35e

Browse files
committed
1. Combine 2 ExecCmd request/response dsdl files into one (using ---).
2. Address issue # 12 (no `GLOB_RECURSE`).
1 parent 54f1043 commit 211c35e

File tree

7 files changed

+35
-19
lines changed

7 files changed

+35
-19
lines changed

src/common/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@
66
cmake_minimum_required(VERSION 3.25)
77

88
set(dsdl_ocvsmd_dir ${CMAKE_CURRENT_SOURCE_DIR}/dsdl/ocvsmd)
9-
file(GLOB_RECURSE dsdl_ocvsmd_files CONFIGURE_DEPENDS ${dsdl_ocvsmd_dir}/*.dsdl)
9+
set(dsdl_ocvsmd_files
10+
${dsdl_ocvsmd_dir}/common/ipc/Route.0.1.dsdl
11+
${dsdl_ocvsmd_dir}/common/ipc/RouteChannelEnd.0.1.dsdl
12+
${dsdl_ocvsmd_dir}/common/ipc/RouteChannelMsg.0.1.dsdl
13+
${dsdl_ocvsmd_dir}/common/ipc/RouteConnect.0.1.dsdl
14+
${dsdl_ocvsmd_dir}/common/svc/file_server/ListRoots.0.1.dsdl
15+
${dsdl_ocvsmd_dir}/common/svc/file_server/PopRoot.0.1.dsdl
16+
${dsdl_ocvsmd_dir}/common/svc/file_server/PushRoot.0.1.dsdl
17+
${dsdl_ocvsmd_dir}/common/svc/node/ExecCmd.0.1.dsdl
18+
${dsdl_ocvsmd_dir}/common/svc/node/UavcanNodeExecCmdReq.0.1.dsdl
19+
${dsdl_ocvsmd_dir}/common/svc/node/UavcanNodeExecCmdRes.0.1.dsdl
20+
)
1021

1122
add_cyphal_library(
1223
NAME common

src/common/dsdl/ocvsmd/common/svc/node/ExecCmdSvcRequest.0.1.dsdl renamed to src/common/dsdl/ocvsmd/common/svc/node/ExecCmd.0.1.dsdl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@ uint16[<=128] node_ids
33
UavcanNodeExecCmdReq.0.1 payload
44

55
@extent 600 * 8
6+
7+
---
8+
9+
uint16 node_id
10+
UavcanNodeExecCmdRes.0.1 payload
11+
12+
@extent 64 * 8

src/common/dsdl/ocvsmd/common/svc/node/ExecCmdSvcResponse.0.1.dsdl

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/common/svc/node/exec_cmd_spec.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
#ifndef OCVSMD_COMMON_SVC_NODE_EXEC_CMD_SPEC_HPP_INCLUDED
77
#define OCVSMD_COMMON_SVC_NODE_EXEC_CMD_SPEC_HPP_INCLUDED
88

9-
#include "ocvsmd/common/svc/node/ExecCmdSvcRequest_0_1.hpp"
10-
#include "ocvsmd/common/svc/node/ExecCmdSvcResponse_0_1.hpp"
9+
#include "ocvsmd/common/svc/node/ExecCmd_0_1.hpp"
1110

1211
namespace ocvsmd
1312
{
@@ -20,8 +19,8 @@ namespace node
2019

2120
struct ExecCmdSpec
2221
{
23-
using Request = ExecCmdSvcRequest_0_1;
24-
using Response = ExecCmdSvcResponse_0_1;
22+
using Request = ExecCmd::Request_0_1;
23+
using Response = ExecCmd::Response_0_1;
2524

2625
constexpr auto static svc_full_name()
2726
{

test/common/ipc/test_client_router.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "ocvsmd/common/ipc/RouteChannelMsg_0_1.hpp"
1717
#include "ocvsmd/common/ipc/RouteConnect_0_1.hpp"
1818
#include "ocvsmd/common/ipc/Route_0_1.hpp"
19-
#include "ocvsmd/common/svc/node/ExecCmdSvcRequest_0_1.hpp"
19+
#include "ocvsmd/common/svc/node/ExecCmd_0_1.hpp"
2020

2121
#include <cetl/pf17/cetlpf.hpp>
2222

@@ -155,7 +155,7 @@ TEST_F(TestClientRouter, start)
155155

156156
TEST_F(TestClientRouter, makeChannel)
157157
{
158-
using Msg = ocvsmd::common::svc::node::ExecCmdSvcRequest_0_1;
158+
using Msg = ocvsmd::common::svc::node::ExecCmd::Request_0_1;
159159
using Channel = Channel<Msg, Msg>;
160160

161161
StrictMock<pipe::ClientPipeMock> client_pipe_mock;
@@ -175,7 +175,7 @@ TEST_F(TestClientRouter, makeChannel)
175175

176176
TEST_F(TestClientRouter, makeChannel_send)
177177
{
178-
using Msg = ocvsmd::common::svc::node::ExecCmdSvcRequest_0_1;
178+
using Msg = ocvsmd::common::svc::node::ExecCmd::Request_0_1;
179179
using Channel = Channel<Msg, Msg>;
180180

181181
StrictMock<pipe::ClientPipeMock> client_pipe_mock;
@@ -212,7 +212,7 @@ TEST_F(TestClientRouter, makeChannel_send)
212212

213213
TEST_F(TestClientRouter, makeChannel_receive_events)
214214
{
215-
using Msg = ocvsmd::common::svc::node::ExecCmdSvcRequest_0_1;
215+
using Msg = ocvsmd::common::svc::node::ExecCmd::Request_0_1;
216216
using Channel = Channel<Msg, Msg>;
217217

218218
StrictMock<pipe::ClientPipeMock> client_pipe_mock;

test/common/ipc/test_server_router.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "tracking_memory_resource.hpp"
1414

1515
#include "ocvsmd/common/ipc/Route_0_1.hpp"
16-
#include "ocvsmd/common/svc/node/ExecCmdSvcRequest_0_1.hpp"
16+
#include "ocvsmd/common/svc/node/ExecCmd_0_1.hpp"
1717

1818
#include <cetl/pf17/cetlpf.hpp>
1919

@@ -151,7 +151,7 @@ TEST_F(TestServerRouter, start)
151151

152152
TEST_F(TestServerRouter, registerChannel)
153153
{
154-
using Msg = ocvsmd::common::svc::node::ExecCmdSvcRequest_0_1;
154+
using Msg = ocvsmd::common::svc::node::ExecCmd::Request_0_1;
155155
using Channel = Channel<Msg, Msg>;
156156

157157
StrictMock<pipe::ServerPipeMock> server_pipe_mock;
@@ -172,7 +172,7 @@ TEST_F(TestServerRouter, registerChannel)
172172

173173
TEST_F(TestServerRouter, channel_send)
174174
{
175-
using Msg = ocvsmd::common::svc::node::ExecCmdSvcRequest_0_1;
175+
using Msg = ocvsmd::common::svc::node::ExecCmd::Request_0_1;
176176
using Channel = Channel<Msg, Msg>;
177177

178178
StrictMock<pipe::ServerPipeMock> server_pipe_mock;

test/daemon/engine/svc/node/test_exec_cmd_service.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,17 @@ namespace svc
282282
{
283283
namespace node
284284
{
285-
static void PrintTo(const ExecCmdSvcResponse_0_1& res, std::ostream* os) // NOLINT
285+
namespace ExecCmd
286286
{
287-
*os << "ExecCmdSvcResponse_0_1{node_id=" << res.node_id << "}";
287+
static void PrintTo(const Response_0_1& res, std::ostream* os) // NOLINT
288+
{
289+
*os << "ExecCmd::Response_0_1{node_id=" << res.node_id << "}";
288290
}
289-
static bool operator==(const ExecCmdSvcResponse_0_1& lhs, const ExecCmdSvcResponse_0_1& rhs) // NOLINT
291+
static bool operator==(const Response_0_1& lhs, const Response_0_1& rhs) // NOLINT
290292
{
291293
return lhs.node_id == rhs.node_id;
292294
}
295+
} // namespace ExecCmd
293296
} // namespace node
294297
} // namespace svc
295298
} // namespace common

0 commit comments

Comments
 (0)