dart_opendroneid
A Dart library for parsing Remote ID advertisements from raw binary payload.
The format of data is defined in the ASTM F3411 Remote ID and the ASD-STAN prEN 4709-002 Direct Remote ID specifications.
Features
Currently supports parsing of the following message types:
- Basic ID
- Location
- Self ID
- System
- Operator ID
- Auth
- Message Pack
Prerequisites
- Dart 3.8.0 or newer
Getting started
To start using the library, simply add it to your pubspec.yaml file and run dart pub get.
Usage
import 'dart:typed_data';
import 'package:dart_opendroneid/dart_opendroneid.dart';
final Uint8List messageData = Uint8List.fromList([
// Message Type = Basic ID, Protcol ver. = 2
0x02,
// ID type = Serial Number (ANSI/CTA-2063-A), UA Type = Aircraft
0x11,
// UAS ID = 15968DEADBEEF
0x31, 0x35, 0x39, 0x36, 0x38, 0x44, 0x45, 0x41, 0x44, 0x42, 0x45, 0x45, 0x46,
// NULL padding
// ...
]);
final type = determineODIDMessageType(messageData);
// Returns T extends ODIDMessage
final message = parseODIDMessage(messageData);
// Returns ParseResult<T extends ODIDMessage>(T message, List<ParseWarning>)
parseODIDMessage returns ParseResult containing the parsed message and any warnings. Any parsing errors preventing the message to be constructed will be thrown as exceptions, subclasses ofOdidMessageParseError.
Use validateODIDMessage to validate ODIDMessage by verifying that values are in allowed limits and are not equal to known invalid values. The method returns true if message is valid.
Testing
Local
The provided test suite uses opendroneid-core-c (present in test/opendroneid_core_library) as a reference implementation. Dart FFI is used to call this reference implementation and it is expected that the built binary is present in the following path:
- Linux:
test/opendroneid_core_library/libopendroneid.so - Windows:
test/opendroneid_core_library/libopendroneid.dll - Mac OS:
test/opendroneid_core_library/libopendroneid.dylib
Build the library by running make inside the test/opendroneid_core_library folder.
cd test/opendroneid_core_library
cmake .
make # or 'cmake --build .' on Windows
Before running the tests, Dart FFI bindings have to be generated. Make sure you have the necessary ffigen requirements and run dart run ffigen.
With all the requirements in place, tests can be run with dart test.
The coverage package can be used to measure code coverage by tests. Run tests with coverage, generate coverage report:
dart run test --coverage=coverage
dart run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib
genhtml -o coverage/html coverage/lcov.info #genhtml from lcov
Open coverage/html/index.html to see the coverage report.
Docker
To test the library, the provided Docker image can be used. Build the image by running the following command from the repository root:
docker build --target test -t dart-opendroneid-test .
On ARM hosts (e.g. Apple M1), use Buildx and specify the platform:
docker buildx build --platform linux/amd64 --target test -t dart-opendroneid-test .
A short-hand for building the test image can be used if you have RPS installed:
rps test
Run tests:
docker run dart-opendroneid-test
Publishing
dart-opendroneid is automatically published to pub.dev using our GitHub Actions workflows. Semantic Release is used to determine release version.
© 2026 Dronetag www.dronetag.com