Nextion
constructor
when called without a valid "uart" parameter
should throw
when called with a valid "uart" parameter
should not throw
should call UART#bind()
method
setValue()
when Nextion not ready
should wait until readiness
when Nextion ready
should continue
NextionProtocol
should trim a trailing [0xff, 0xff, 0xff] from the read buffer
helper
commandName
when given an unknown command
code
touchEvent
should parse three (3) UInt8 values
should return a result object containing number "pageId", number "buttonId" and boolean "releaseEvent"
pageId
should parse one (1) UInt8 values
should return a result object containing number "pageId"
stringData
should return a result object containing value of the string
numericData
should read an signed 16-bit integer
touchCoordinate
should interpret four coordinates and a touch event
touchCoordinateOnWake
should delegate to touchCoordinate
UART
when supplied a valid "port" object
should return a UART instance
should set default option "returnCommandResult: always"
when supplied an invalid "port" object
bind()
when port emits "error"
should cause UART to emit "error"
utility methods
toHex()
should return a hexadecimal representation of a number
should pad the hexadecimal representation