From b852320c19b9136e43fade3a3aa122b48029bb63 Mon Sep 17 00:00:00 2001 From: Frank Delporte Date: Mon, 29 Jul 2024 08:47:55 +0200 Subject: [PATCH] Bump to Pi4J 2.6.1 --- .../pi4j/spring/boot/sample/app/controller/Pi4JController.java | 3 +++ .../main/java/com/pi4j/spring/boot/ContextConfiguration.java | 3 +++ pom.xml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pi4j-spring-boot-starter-sample-app/src/main/java/com/pi4j/spring/boot/sample/app/controller/Pi4JController.java b/pi4j-spring-boot-starter-sample-app/src/main/java/com/pi4j/spring/boot/sample/app/controller/Pi4JController.java index f2583aa..411e0ba 100644 --- a/pi4j-spring-boot-starter-sample-app/src/main/java/com/pi4j/spring/boot/sample/app/controller/Pi4JController.java +++ b/pi4j-spring-boot-starter-sample-app/src/main/java/com/pi4j/spring/boot/sample/app/controller/Pi4JController.java @@ -23,16 +23,19 @@ public Pi4JController(@Autowired Pi4JService pi4JService) { @GetMapping("/led/{state}") public Boolean setLedStatus(@PathVariable Boolean state) { + logger.info("REST request to change the LED state to {}", state); return pi4JService.setLedState(state); } @GetMapping("/button") public DigitalState setLedStatus() { + logger.info("REST request to get the BUTTON state"); return pi4JService.getButtonState(); } @GetMapping("/lcd/{line}/{text}") public Boolean setLcdText(@PathVariable Integer line, @PathVariable String text) { + logger.info("REST request to set on line {} of the LCD: '{}'", line, text); return pi4JService.setLcdText(line, text); } } diff --git a/pi4j-spring-boot/src/main/java/com/pi4j/spring/boot/ContextConfiguration.java b/pi4j-spring-boot/src/main/java/com/pi4j/spring/boot/ContextConfiguration.java index 67cae8d..b9d7d13 100644 --- a/pi4j-spring-boot/src/main/java/com/pi4j/spring/boot/ContextConfiguration.java +++ b/pi4j-spring-boot/src/main/java/com/pi4j/spring/boot/ContextConfiguration.java @@ -29,6 +29,9 @@ public class ContextConfiguration { public ContextConfiguration() { try { if (BoardInfoHelper.current().getBoardModel() == BoardModel.UNKNOWN) { + logger.warn("The Pi4J library could not detect that this system is a Raspberry Pi board."); + logger.warn("For this reason, Mock implementations will be loaded for all I/O."); + logger.warn("This means, you can test most functionality of the Pi4J library, but it will not try to interact with I/Os."); this.pi4j = Pi4J.newContextBuilder() .add(new MockPlatform()) .add(MockAnalogInputProvider.newInstance(), diff --git a/pom.xml b/pom.xml index 3c1ace8..28fb694 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ 17 3.2.5 - 2.6.0 + 2.6.1 0.8.10