Skip to content

Commit 2b06ad7

Browse files
committed
feat: RpcFunctionDispatcher check max no. of callbacks. examples: wrapper test improved for void func case
1 parent 8385fd3 commit 2b06ad7

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

examples/wrapper_example/wrapper_example.ino

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,20 @@ void loop() {
9797

9898
Serial.println(" ");
9999

100-
wrapped_hello();
100+
MsgPack::arr_size_t no_param_size(0);
101+
packer.clear();
102+
packer.serialize(no_param_size);
103+
unpacker.clear();
104+
unpacker.feed(packer.data(), packer.size());
105+
out_packer.clear();
106+
wrapped_hello(unpacker, out_packer);
107+
108+
for (size_t i=0; i<out_packer.size(); i++){
109+
Serial.print(out_packer.data()[i], HEX);
110+
Serial.print(".");
111+
}
112+
113+
Serial.println(" ");
114+
101115
delay(1000);
102116
}

src/dispatcher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class RpcFunctionDispatcher {
1515
public:
1616
template<typename F>
1717
void bind(MsgPack::str_t name, F&& f) {
18-
//assert(_count < N);
18+
assert(_count < N);
1919
static auto wrapper = wrap(std::forward<F>(f));
2020
_entries[_count++] = {name, &wrapper};
2121
}

0 commit comments

Comments
 (0)