back to the documentation index

UARTBus OSI-2: Network layer Device and device group addresses

Every node receives every packets on bus. This makes possible to create broadcast addresses (0 is a general broadcast address) and device groups by using negative addresses for this purpose. Variable length addressing

Instead of using fixed int{8,16,32,64}_t for addressing, i've created a so called variable length addressing:

To balance between this extreme cases i've created an encoder/decoder that enables short address bytes when addresses are low (between -64 and +63) and increase address length when assign higher addresses.

7. bit6. bit5. bit4. bit3. bit2. bit1. bit0. bit
First byteESA5A4A3A2A1A0
Nth byteEA6A5A4A3A2A1A0

Byte scheme:

Example for one byte addresses:

AddressFirst byte

Example for two byte addresses:

AddressFirst byteSecond byte

These types described as (s)vint_t (signed variable int) but it is not a real type which the compiler knows, just a notation. (There's an implementation for uvint_t if you use only unsigned values.) Default packet scheme

The default packet scheme of the project: