enocean icon indicating copy to clipboard operation
enocean copied to clipboard

Restructure Packet

Open kipe opened this issue 9 years ago • 3 comments

As discussed in #14.

@kipe wrote:

Might need to change the Packet.data to Packet.message and create a new Packet.data to reflect the actual, documented data? This would be a very major change, which I'm a bit reluctant to do. On the other hand, it would be fairly easy to do at this point and way more logical (for example, Packet.optional_data, Packet.sender etc already point to the correct data)...

@romor wrote:

Packet could then only consist of Packet.message while data, rorg, status,... could all be properties just accessing the corresponding entry in Packet.message. Alternatively it could be the other way round such that Packet holds data, rorg, status, ... and Packet.message could just be generated from the other variables. The seconds looks more reasonable to me.

Not sure which way this should be handled, as it's largely dependent on whether we're sending or receiving the message...

kipe avatar Feb 18 '16 14:02 kipe

Packet.data doesn't reflect the data prom the documentation? I did behave that way so far with the BS4 packets I tested

TheMeaningfulEngineer avatar Feb 19 '16 10:02 TheMeaningfulEngineer

Well, it does and it doesn't. Packet.data includes the whole data, including stuff like RORG, Sender ID etc, which are not included in EEP. The idea of this issue is to separate the message to Packet.data, Packet.optional_data, Packet.sender, all of which correspond to the logical parts of the documentation.

kipe avatar Feb 19 '16 11:02 kipe

I am trying to understand how we could decouple Packet.build() and Packet.parse_msg() as they are different for ESP2 (see #72). I guess this would be also related to this issue..

stv0g avatar Mar 03 '19 22:03 stv0g