Skip to content

Commit 47f7b1b

Browse files
committed
RPC: x8: fix some strange incoherence
1 parent d66b412 commit 47f7b1b

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

libraries/RPC/src/RPC.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class RPCClass : public Stream, public rpc::detail::dispatcher {
7777
Args... args) {
7878

7979
auto client = new rpc::client();
80-
client->call(func_name, args...);
80+
client->send(func_name, args...);
8181
delete client;
8282
}
8383

libraries/RPC/src/RPC_client.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class client {
2020

2121
auto args_obj = std::make_tuple(args...);
2222
auto call_obj = std::make_tuple(
23-
static_cast<uint8_t>(client::request_type::request), (const int)callThreadId, func_name,
23+
static_cast<uint8_t>(client::request_type::call), (int32_t)callThreadId, func_name,
2424
args_obj);
2525

2626
auto buffer = new RPCLIB_MSGPACK::sbuffer;
@@ -48,9 +48,11 @@ class client {
4848
void send(std::string const &func_name, Args... args) {
4949
LOG_DEBUG("Call function {} and forget", func_name);
5050

51+
callThreadId = osThreadGetId();
52+
5153
auto args_obj = std::make_tuple(args...);
5254
auto call_obj = std::make_tuple(
53-
static_cast<uint8_t>(client::request_type::request_no_answer), func_name,
55+
static_cast<uint8_t>(client::request_type::notification), (const int)callThreadId, func_name,
5456
args_obj);
5557

5658
auto buffer = new RPCLIB_MSGPACK::sbuffer;
@@ -66,7 +68,7 @@ class client {
6668
RPCLIB_MSGPACK::object_handle result;
6769

6870
private:
69-
enum class request_type { raw = 1, request = 2, request_no_answer = 3, response = 4 };
71+
enum class request_type { call = 0, notification = 2 };;
7072

7173
void send_msgpack(RPCLIB_MSGPACK::sbuffer *buffer);
7274
void getResult(RPCLIB_MSGPACK::object_handle& res);

libraries/RPC/src/SerialRPC.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class SerialRPCClass : public Stream {
4545
for (size_t i=0; i < len; i++) {
4646
tx_buffer.push_back(buf[i]);
4747
}
48-
RPC.send("on_write", tx_buffer);
48+
RPC.send("tty", tx_buffer);
4949
return len;
5050
}
5151

@@ -55,7 +55,7 @@ class SerialRPCClass : public Stream {
5555
if (RPC.begin() == 0) {
5656
return 0;
5757
}
58-
RPC.bind("on_write", mbed::callback(this, &SerialRPCClass::onWrite));
58+
RPC.bind("tty", mbed::callback(this, &SerialRPCClass::onWrite));
5959
return 1;
6060
}
6161

0 commit comments

Comments
 (0)