tinyMesh-0.1.0.0: TinyMesh - communicating with auto-meshing sensor network

Safe HaskellNone
LanguageHaskell2010

TinyMesh

Synopsis

Documentation

serialSettings :: SerialPortSettings Source

Serial settings successfully used for communication.

queryCmd :: ByteString Source

readN :: SerialPort -> Int -> IO (Maybe ByteString) Source

Reading exactly N bytes from serial port, or reporting a failure.

readPacket :: SerialPort -> IO (Maybe ByteString) Source

Reading a packet:

readPackets :: SerialPort -> IO [ByteString] Source

Read all the packets currently in the buffer/network.

data Header Source

Constructors

Header 

Fields

len :: Int

length of the packet

systemId :: NetAddr

system address for mesh nodes

originId :: NetAddr

network address of originating node

originRSSI :: Int

origin RSSI

netLevel :: Int

number of vertical hops to gateway

hops :: Int

number of actual hops from router to gateway

origMsgCnt :: Int

origin message counter

latency :: Int

latency between message creation and delivery *10ms

packetType :: Int

integer packet type

data Payload Source

Constructors

Event 
Serial 

Fields

blockCount :: Maybe Int
 
serData :: ByteString
 
Unknown ByteString 

Instances

data Packet Source

Constructors

Packet 

Fields

header :: Header
 
payload :: Payload
 

Instances

Show Packet 
Generic Packet 
Parse Packet

TODO: Hex literals

type Rep Packet 

newtype NetAddr Source

Constructors

NetAddr 

Fields

netAddrAsTuple :: (Int, Int, Int, Int)
 

byte :: Parser Int Source

word :: Parser Int Source

bytestringParser :: Int -> Parser ByteString Source

parsePacket :: ByteString -> Packet Source

main :: IO () Source

Main test script: