diff --git a/src/WebApi_device.cpp b/src/WebApi_device.cpp
index 96b95576..0e26dae7 100644
--- a/src/WebApi_device.cpp
+++ b/src/WebApi_device.cpp
@@ -4,6 +4,7 @@
*/
#include "WebApi_device.h"
#include "Configuration.h"
+#include "PinMapping.h"
#include "WebApi.h"
#include "WebApi_errors.h"
#include "helper.h"
@@ -32,8 +33,27 @@ void WebApiDeviceClass::onDeviceAdminGet(AsyncWebServerRequest* request)
AsyncJsonResponse* response = new AsyncJsonResponse(false, MQTT_JSON_DOC_SIZE);
JsonObject root = response->getRoot();
const CONFIG_T& config = Configuration.get();
+ const PinMapping_t& pin = PinMapping.get();
- root[F("dev_pinmapping")] = config.Dev_PinMapping;
+ JsonObject curPin = root.createNestedObject("curPin");
+ curPin[F("name")] = config.Dev_PinMapping;
+
+ JsonObject nrfObj = curPin.createNestedObject("nrf24");
+ nrfObj[F("clk")] = pin.nrf24_clk;
+ nrfObj[F("cs")] = pin.nrf24_cs;
+ nrfObj[F("en")] = pin.nrf24_en;
+ nrfObj[F("irq")] = pin.nrf24_irq;
+ nrfObj[F("miso")] = pin.nrf24_miso;
+ nrfObj[F("mosi")] = pin.nrf24_mosi;
+
+ JsonObject ethObj = curPin.createNestedObject("eth");
+ ethObj[F("enabled")] = pin.eth_enabled;
+ ethObj[F("phy_addr")] = pin.eth_phy_addr;
+ ethObj[F("power")] = pin.eth_power;
+ ethObj[F("mdc")] = pin.eth_mdc;
+ ethObj[F("mdio")] = pin.eth_mdio;
+ ethObj[F("type")] = pin.eth_type;
+ ethObj[F("clk_mode")] = pin.eth_clk_mode;
response->setLength();
request->send(response);
diff --git a/webapp/src/components/PinInfo.vue b/webapp/src/components/PinInfo.vue
index 019a1d33..e3946b57 100644
--- a/webapp/src/components/PinInfo.vue
+++ b/webapp/src/components/PinInfo.vue
@@ -6,64 +6,78 @@
| NRF24 |
MISO |
- {{ pinAssignment?.nrf24?.miso }} |
+ {{ selectedPinAssignment?.nrf24?.miso }} |
+ {{ currentPinAssignment?.nrf24?.miso }} |
| MOSI |
- {{ pinAssignment?.nrf24?.mosi }} |
+ {{ selectedPinAssignment?.nrf24?.mosi }} |
+ {{ currentPinAssignment?.nrf24?.mosi }} |
| CLK |
- {{ pinAssignment?.nrf24?.clk }} |
+ {{ selectedPinAssignment?.nrf24?.clk }} |
+ {{ currentPinAssignment?.nrf24?.clk }} |
| IRQ |
- {{ pinAssignment?.nrf24?.irq }} |
+ {{ selectedPinAssignment?.nrf24?.irq }} |
+ {{ currentPinAssignment?.nrf24?.irq }} |
| EN |
- {{ pinAssignment?.nrf24?.en }} |
+ {{ selectedPinAssignment?.nrf24?.en }} |
+ {{ currentPinAssignment?.nrf24?.en }} |
| CS |
- {{ pinAssignment?.nrf24?.cs }} |
+ {{ selectedPinAssignment?.nrf24?.cs }} |
+ {{ currentPinAssignment?.nrf24?.cs }} |
| Ethernet |
enabled |
- {{ pinAssignment?.eth?.enabled }} |
+ {{ selectedPinAssignment?.eth?.enabled }} |
+ {{ currentPinAssignment?.eth?.enabled }} |
| phy_addr |
- {{ pinAssignment?.eth?.phy_addr }} |
+ {{ selectedPinAssignment?.eth?.phy_addr }} |
+ {{ currentPinAssignment?.eth?.phy_addr }} |
| power |
- {{ pinAssignment?.eth?.power }} |
+ {{ selectedPinAssignment?.eth?.power }} |
+ {{ currentPinAssignment?.eth?.power }} |
| mdc |
- {{ pinAssignment?.eth?.mdc }} |
+ {{ selectedPinAssignment?.eth?.mdc }} |
+ {{ currentPinAssignment?.eth?.mdc }} |
| mdio |
- {{ pinAssignment?.eth?.mdio }} |
+ {{ selectedPinAssignment?.eth?.mdio }} |
+ {{ currentPinAssignment?.eth?.mdio }} |
| type |
- {{ pinAssignment?.eth?.type }} |
+ {{ selectedPinAssignment?.eth?.type }} |
+ {{ currentPinAssignment?.eth?.type }} |
| clk_mode |
- {{ pinAssignment?.eth?.clk_mode }} |
+ {{ selectedPinAssignment?.eth?.clk_mode }} |
+ {{ currentPinAssignment?.eth?.clk_mode }} |
@@ -82,7 +96,8 @@ export default defineComponent({
CardElement,
},
props: {
- pinAssignment: { type: Object as PropType