Skip to content

Commit b61ff0d

Browse files
committed
Fix Natural16Param to support size more than 1. Added demo "demo.u16s" register of u16[2] type.
1 parent 3f178c6 commit b61ff0d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libcyphal_demo/src/application.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class Application final
144144
const Value::allocator_type allocator{&memory_};
145145
Value value{allocator};
146146
auto& uint16s = value.set_natural16();
147-
uint16s.value.push_back(value_.front());
147+
std::copy(value_.cbegin(), value_.cend(), std::back_inserter(uint16s.value));
148148
return value;
149149
}
150150

@@ -180,6 +180,7 @@ class Application final
180180
StringParam<MaxNodeDesc> node_desc_ { "uavcan.node.description", registry_, {NODE_NAME}, {true}};
181181
Natural16Param<1> node_id_ { "uavcan.node.id", registry_, {65535U}, {true}};
182182
StringParam<MaxIfaceLen> udp_iface_ { "uavcan.udp.iface", registry_, {"127.0.0.1"}, {true}};
183+
Natural16Param<2> demo_u16s_ { "demo.u16s", registry_, {0U, 0U}, {false}};
183184
Register<RegisterFootprint> sys_info_mem_block_;
184185
Register<RegisterFootprint> sys_info_mem_general_;
185186
// clang-format on

0 commit comments

Comments
 (0)