This is a big release with almost 400 commits and 300+ files added/changed...! Pi4J V4 introduces the new FFM plugin and bumps the Java version to 25. The FFM plugin uses the new Foreign Function & Memory API (FFM) to access the GPIOs. The FFM API was introduced in Java 22 with JEP 454.
This is the most tested release of Pi4J yet! The pi4j-test module has been reworked by @taartspi to provide a smoke test approach with a fixed hardware setup that uses, for instance, input GPIOs to validate output GPIOs and PWM. Check Hardware Testing for more info and how to set up.
Some highlights of all the changes in this release:
- Issue #454: Implement new FFM API approach. First big pull request by @DigitalSmile: #458 with more to further improve, finetune, and test.
- Consistent use of
bcm,channel,bus,chipwhen initializing an IO instead of the sometimes confusingpinoraddress. With related changes in the Pi4J registry to be able to correctly remove and reuse IO instances. - Issue #478: Race condition in GpioDDigitalInput causes monitor thread to exit
- BoardInfo: added CM5 Lite, and 500 Plus
- Bump Docker builder to JDK 25
- Nexus staging plugin replaced with Central Publishing plugin
- Rework of the pi4j-test module to provide an easy SmokeTest approach with a fixed hardware test setup.
- Various LinuxFS plugin improvements.
- Overall code fixes, improvements, new helper methods, cleanup, etc..
- Complete removal of serial support, use jSerialComm instead of Pi4J for serial communication, as explained here.
Thanks to contributions by @DigitalSmile, @IAmNickNack, @stefanhaustein, @taartspi, @eitch, @fdelporte.
Detailed list of all the changes: 3.0.3...4.0.0