From 068040a4b41c866ee8b8dd3527a182faf0307bf5 Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Tue, 10 May 2011 20:23:28 +0200 Subject: [PATCH] [spid] remove line-based discipline on the uart fifos --- mote/v2/openwrt/package/flukso/luasrc/spid.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mote/v2/openwrt/package/flukso/luasrc/spid.lua b/mote/v2/openwrt/package/flukso/luasrc/spid.lua index e61021a..729a631 100755 --- a/mote/v2/openwrt/package/flukso/luasrc/spid.lua +++ b/mote/v2/openwrt/package/flukso/luasrc/spid.lua @@ -37,6 +37,8 @@ local SPI_TX_RX_DELAY_NS = 2e7 local SPI_CT_DELAY_NS = 5e8 local POLL_TIMEOUT_MS = 100 +local UART_MAX_BYTES = 256 + local TIMERFD_ENABLE = 1 local TIMERFD_SEC = 1 local TIMERFD_NS = 0 @@ -106,7 +108,7 @@ while true do msg:parse() elseif uart.revents == POLLIN then - msg = spi.new_msg('uart', uart.line()) + msg = spi.new_msg('uart', uart.fdin:read(UART_MAX_BYTES)) end msg:encode() @@ -128,7 +130,7 @@ while true do end if dispatch.uart then - uart.fdout:write(dispatch.uart .. '\n') + uart.fdout:write(dispatch.uart) end end end