serialport icon indicating copy to clipboard operation
serialport copied to clipboard

Do we need a recieveAll function?

Open zmanian opened this issue 10 years ago • 1 comments

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

zmanian avatar Feb 12 '14 22:02 zmanian

Actually, that is what recv is doing, reading everything until a inter byte timeout, which returns an empty string.

jputcu avatar Feb 13 '14 21:02 jputcu