RafaelKa / node-serialport-enocean-parser

ESP3 parser for nodes serialport
Do What The F*ck You Want To Public License
6 stars 2 forks source link

include complete Buffer in ESP3Packet returned from Parser. #1

Closed Holger-Will closed 8 years ago

Holger-Will commented 8 years ago

I'm using your parser in node-enocean now. My receiving and testing code relies on having the complete telegram avaiable as a Buffer. currently i have to convert the ESPPackat returned by the parser back to a Buffer. It woud be very convienient if this would be part of the ESPPacket.

{
  syncByte: 85,
  header: { dataLength: 5, optionalLength: 1, packetType: 2 },
  crc8Header: 219,
  data: <Buffer 00 ff a0 87 00>,
  optionalData: <Buffer 09>,
  crc8Data: 228,
  buffer: <Buffer 55 00 05 00 01...the complete packet as a Buffer...> 
}