Closed Holger-Will closed 5 years ago
TODO: when creating concrete types we should extract as much information as possible from the given data and fill the rest with meaningful defaults.
f.e. all RadioERP1 Packets have a destinationId we should not require that to be present when creating the packet. it can default to ffffffff
likewise RSSI value should always be ff
for the send case. it does not make much sense to require that in the struct passed to Packet.from()
I'll heck this in and start work on the eep front. it might be easier then to see what is need here.
implementation of a packet-factory
packet.from expects and ESP3Packet, a raw buffer, a string or a struct with at least
{ header:{ packetType:x } }
maybe we can add
Packet.from(number)
where number is a valid packetType