Open enesbcs opened 5 years ago
So 16 bit it should become. At least in the ESPEasy addressing a plugin. That would already be a huge refactoring process and will perhaps also break current p2p implementation. So I maybe want to 'reserve' bit nr 7 (128 - 255) to be able to toggle between 1 byte and 2 byte representation. Or do you already have plugins in that range?
I have 7 plugin in range 128-255 but i can renumber it. Perhaps the C013 P2P V1 structures may be untouched for backward compatibility with R120, and the P2P V2 has to support 16 bit plugin number.
The older versions don't support the (not yet existing) plugins anyway. So we have still about 40 plugins to go until we really have to make the decision what to do with the most significant bit of the plugin ID. One thing we really should do is make sure the p2p messages will be discarded if not supported. Or we simply use a new message ID for the plugin ID's > 127.
About the node unit numbers. If the support for LoRa and ESPnow really will be accepted the way I hope it will be, then we may run out of unit numbers. I already know of people having > 200 ESP nodes active although I don't know if these are all in the same network. Also the current implementation of ESPeasy p2p is very inefficient when it comes to large number of units. So that may be also a thing to solve when working on p2p v2.
To ease the transition, we could already use a define for the unit numbers and plugin ID. Not sure if the compiler can apply strict checks on a defined type. Would be nice if we can let the compiler do the checking for us.
This issue is no longer relevant, or at least implemented differently, so can probably be closed.
Nope, is still an issue
@TD-er :
Absolutely. Originally i choosed "word" type as i started programming with TurboPascal and a word means a two-byte long numeric variable that can hold value between 0..65535 to me at least. :) As you can see i am not an expert C programmer... Now i changed it to
uint16_t plugin_id;
as the ESP32 has other thoughts about "word" datatype meaning.Unit number is a really interesting question as i've never heard anybody running more than 255 ESPEasy-RPIEasy-ArduinoEasy on the same network, but it can happen. Personally i do not think that it is common, but we can ask the users instead. :)