From 3ba7ca4155c7be439108b174a3b49a508923d378 Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Thu, 30 Jun 2016 21:52:59 -0400 Subject: RPC wire format now includes client handle in all requests, and opcode and client handle in all responses. This simplies the daemon a little, and means that the directly-connected serial client uses the same wire format as the daemon. The expense is some redundant code in rpc_client and rpc_server to process (and throw away) this extra stuff. --- rpc_client_serial.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'rpc_client_serial.c') diff --git a/rpc_client_serial.c b/rpc_client_serial.c index ec53e05..b27c255 100644 --- a/rpc_client_serial.c +++ b/rpc_client_serial.c @@ -44,8 +44,11 @@ #include "hal_internal.h" #include "slip_internal.h" -#define DEVICE "/dev/ttyUSB0" -#define SPEED B115200 +/* XXX These REALLY ought to be passed from the client app command line, + * rather than compiled into the library. + */ +#define DEVICE "/dev/ttyUSB1" +#define SPEED B921600 hal_error_t hal_rpc_client_transport_init(void) { @@ -64,5 +67,8 @@ hal_error_t hal_rpc_send(const uint8_t * const buf, const size_t len) hal_error_t hal_rpc_recv(uint8_t * const buf, size_t * const len) { - return hal_slip_recv(buf, *len); + size_t maxlen = *len; + *len = 0; + hal_error_t err = hal_slip_recv(buf, len, maxlen); + return err; } -- cgit v1.2.3