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

DRAW-UP for decoupling #36

Open RafaelKa opened 6 years ago

RafaelKa commented 6 years ago

Thought on semething like this:

the user could use in his packet consumer method the Protocol to to transform the packets to concrete packet implementation

    const ESP3 = new Protocol()
    const translatedPacket = ESP3.transformToConcretePacket({header: {packetType: 1}})
    assert.instanceOf(translatedPacket, PacketTypes.RADIO_ERP1)