Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
System.Serial.BlockingManager
Description
This is a largely drop-in replacement for System.Serial.Manager which sends and receives one command at a time from the port, and so is garuanteed to send the write information back to the right function. It may be necessary when working with devices that have ambiguous returns, such as a single acknowledgement character for all successful commands. See the analagous functions in System.Serial.Manager for the full documentation. The notes here only point out the differences.
- serialManager :: Handle -> Int -> IO BlockingSerialManager
- wrapCommand :: String -> String -> BlockingSerialManager -> IO (Maybe String)
- type BlockingSerialManager = MVar BlockingSerialCommand
- type BlockingSerialCommand = (String, MVar (Maybe String))
Documentation
Arguments
:: Handle | |
-> Int | timeout (in ms) |
-> IO BlockingSerialManager |
The blocking serialManager
function takes one additional argument, the timeout (since it cannot continue executing commands in parallel while one command freezes).
Arguments
:: String | The end of line character for this port |
-> String | The command to send |
-> BlockingSerialManager | The serial port to access |
-> IO (Maybe String) |
|
Wrapping commands is identical to the non-blocking version except that there is no predicate to recognize return values.