RIOT-OS / rust-riot-wrappers

The `riot-wrappers` crate, which enables high-level access to RIOT from the Rust programming language
13 stars 10 forks source link

Consistency for PID and zone identifiers #121

Open chrysn opened 1 month ago

chrysn commented 1 month ago

Right now, we have KernelPid which is i16 internally (and converts into an i16 without preserving the implied "it is positive and not zero" property), but also interface identifiers which in GNRC are inherently PID bound but expressed as NonZero in gnrc::nib because the underlying gnrc_ipv6_nib_nc_get_iface returns a C unsigned int (which, remind you, is not usize but basically an arbitrary type, and 32-bit long on some 64-bit systems)

It may be worth considering whether we can and should unify those. Practically, I don't expect interface identifiers to exceed 127 anyway on RIOT systems :-)

chrysn commented 1 month ago

In use, a usize will be practical when https://gitlab.com/twittner/minicbor/-/merge_requests/48 is merged