serialport
serialport copied to clipboard
Do we need a recieveAll function?
When I used your library I always end up with a function similar to this...
Should something like it be in the library? I typically work with text console type interfaces
recieveAll :: SerialPort -> IO B.ByteString
recieveAll serialHandle = do
resp <- recv serialHandle 128
case resp of
"" -> return resp
_ -> do
x <- recieveAll serialHandle
return $ resp B.append
x
Actually, that is what recv is doing, reading everything until a inter byte timeout, which returns an empty string.