diff options
author | Jakob Odersky <jodersky@gmail.com> | 2014-03-27 20:19:28 +0100 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2014-03-27 20:19:28 +0100 |
commit | b6f27be4eda4ec0e50aaca8eb3a117db60b4067e (patch) | |
tree | a0f9e2e054e8869b4db4b727d9e3e8e3a8fabd85 /flow/src/main/native/posix/flow.c | |
parent | d3960d3748e7b83f3ad18fa226ed88c7a5b01941 (diff) | |
download | akka-serial-b6f27be4eda4ec0e50aaca8eb3a117db60b4067e.tar.gz akka-serial-b6f27be4eda4ec0e50aaca8eb3a117db60b4067e.tar.bz2 akka-serial-b6f27be4eda4ec0e50aaca8eb3a117db60b4067e.zip |
re-implement native side (TODO: direct buffers)
Diffstat (limited to 'flow/src/main/native/posix/flow.c')
-rw-r--r-- | flow/src/main/native/posix/flow.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/flow/src/main/native/posix/flow.c b/flow/src/main/native/posix/flow.c index 18aa9c2..c408670 100644 --- a/flow/src/main/native/posix/flow.c +++ b/flow/src/main/native/posix/flow.c @@ -4,8 +4,10 @@ #include <errno.h> #include <termios.h> #include <fcntl.h> +#include <sys/file.h> #include "flow.h" + #define DATA_CANCEL 0xffffffff static bool debug = false; @@ -186,7 +188,7 @@ int serial_close(struct serial_config* const serial) { return 0; } -int serial_read(struct serial_config* const serial, unsigned char* const buffer, size_t size) { +int serial_read(struct serial_config* const serial, char* const buffer, size_t size) { int port = serial->port_fd; int pipe = serial->pipe_read_fd; @@ -234,7 +236,7 @@ int serial_cancel_read(struct serial_config* const serial) { return 0; } -int serial_write(struct serial_config* const serial, unsigned char* const data, size_t size) { +int serial_write(struct serial_config* const serial, char* const data, size_t size) { int r = write(serial->port_fd, data, size); if (r < 0) { DEBUG(perror("error writing to port");); |