back to the documentation index

UARTBus OSI-2: Network layer

2.1.3.1 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.

2.1.3.2 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
00000_0000
-10100_0000
160001_0000
-160100_1111
-640111_1111
630011_1111

Example for two byte addresses:

AddressFirst byteSecond byte
1281000_00010000_0000
-1281100_00000111_1111
81911011_11110111_1111
-81921111_11110111_1111

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.)

2.1.3.3 Default packet scheme

The default packet scheme of the project: