Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
This module exports utility functions to read and parse log files from Contiki-NG applications.
Contiki-NG is a tiny operation system for wireless network devices. It supports RPL.
Synopsis
- parseFile :: Parser Timestamp -> FilePath -> IO ([FoundNodeDIO], [FoundNodeDAO])
- parseFileHandle :: Parser Timestamp -> Handle -> IO ([FoundNodeDIO], [FoundNodeDAO])
- type Parser = ReadP
- pCoojaLogHead :: Parser (Timestamp, Int)
- pCoojaLogHead' :: Parser Timestamp
- pSyslogHead :: Integer -> Maybe TimeZone -> Parser Timestamp
Parser functions
:: Parser Timestamp | Parser for log prefix |
-> FilePath | File to read |
-> IO ([FoundNodeDIO], [FoundNodeDAO]) |
Read and parse a log file from a Contiki-NG application to make
FoundNodeDIO
and FoundNodeDAO
.
Currently this parser function supports logs from "rpl-lite" module only.
It assumes that each line of log file has prefix, and that the
prefix contains timestamp information. You have to pass the parser
for the prefix to this function. For example, if you read a log
file generated by Cooja simulator, use pCoojaLogHead'
parser.
One FoundNodeDIO
object is parsed from one block of log lines
from the rpl module. On the other hand, one or more FoundNodeDAO
objects are parsed from one block of log lines from the rpl
module. The FoundNodeDAO
objects generated from the same log
block share the same timestamp.
:: Parser Timestamp | Parser for log prefix |
-> Handle | File handle to read |
-> IO ([FoundNodeDIO], [FoundNodeDAO]) |
Parser components
pCoojaLogHead :: Parser (Timestamp, Int) Source #
Parse the head of Cooja log line, and return the timestamp and node ID.
pCoojaLogHead' :: Parser Timestamp Source #
Same as pCoojaLogHead
, but it returns the timestamp only.