CanMessage constructor
Allocates a NativeCanMessage and holds a reference to its pointer.
Implementation
factory CanMessage({required int id, required List<int> data}) {
final pointer = calloc<NativeCanMessage>();
final buffer = data.toNativeBuffer();
pointer.ref.id = id;
pointer.ref.data = buffer.cast();
pointer.ref.length = data.length;
return CanMessage.fromPointer(pointer, isNative: false);
}