diff options
author | Rob Austein <sra@hactrn.net> | 2016-06-30 21:11:19 -0400 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-06-30 21:11:19 -0400 |
commit | 3ed08b68d4d4bd51d85334aa1a21690737b95cfe (patch) | |
tree | c6e96226598704a3b21148c63fee3b81a25eae85 /rpc_client_serial.c | |
parent | 03a407b83da294ff05d4f230437ec06c910b2e85 (diff) |
Start work to support client code on Mac OS X.
Includes preliminary support for the magic Mac-specific ioctl() to see
line speed, but has not yet been tested, that's waiting for some
supporting tweaks to the RPC code from Paul.
Includes some general cleanup which isn't really specific to Mac OS X
per se but which needed doing and which simplifies adding the Mac code.
Diffstat (limited to 'rpc_client_serial.c')
-rw-r--r-- | rpc_client_serial.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/rpc_client_serial.c b/rpc_client_serial.c index ec53e05..5eed2dd 100644 --- a/rpc_client_serial.c +++ b/rpc_client_serial.c @@ -33,6 +33,7 @@ */ #include <stdio.h> +#include <stdlib.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> @@ -44,12 +45,9 @@ #include "hal_internal.h" #include "slip_internal.h" -#define DEVICE "/dev/ttyUSB0" -#define SPEED B115200 - hal_error_t hal_rpc_client_transport_init(void) { - return hal_serial_init(DEVICE, SPEED); + return hal_serial_init(HAL_CLIENT_SERIAL_DEFAULT_DEVICE, HAL_CLIENT_SERIAL_DEFAULT_SPEED); } hal_error_t hal_rpc_client_transport_close(void) @@ -64,5 +62,5 @@ 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); + return hal_slip_recv(buf, len, *len); } |