add functions to convert containers directly into packet

This commit is contained in:
Vinzenz Schroeter 2025-04-12 22:13:29 +02:00
commit baa450b2f7
10 changed files with 178 additions and 20 deletions

View file

@ -108,6 +108,9 @@ pub unsafe extern "C" fn sp_packet_free(packet: NonNull<Packet>) {
unsafe { heap_drop(packet) }
}
/// Converts u16 into [CommandCode].
///
/// If the provided value is not valid, false is returned and result is not changed.
#[no_mangle]
pub unsafe extern "C" fn sp_u16_to_command_code(
code: u16,