mirror of
https://github.com/lumapu/ahoy.git
synced 2025-08-06 09:58:23 +02:00
* made ethernet pinout configurable
* combined common network functions into class * seperated wifi station from AP mode
This commit is contained in:
parent
4fc61dc01f
commit
a44a5833ca
12 changed files with 540 additions and 25 deletions
|
@ -381,6 +381,8 @@ class RestApi {
|
|||
obj[F("hidd")] = mConfig->sys.isHidden;
|
||||
obj[F("mac")] = WiFi.macAddress();
|
||||
obj[F("wifi_channel")] = WiFi.channel();
|
||||
#else
|
||||
getEthernet(obj.createNestedObject(F("eth")));
|
||||
#endif /* !defined(ETHERNET) */
|
||||
obj[F("device_name")] = mConfig->sys.deviceName;
|
||||
obj[F("dark_mode")] = (bool)mConfig->sys.darkMode;
|
||||
|
@ -762,6 +764,18 @@ class RestApi {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(ETHERNET)
|
||||
void getEthernet(JsonObject obj) {
|
||||
obj[F("en")] = mConfig->sys.eth.enabled;
|
||||
obj[F("cs")] = mConfig->sys.eth.pinCs;
|
||||
obj[F("sclk")] = mConfig->sys.eth.pinSclk;
|
||||
obj[F("miso")] = mConfig->sys.eth.pinMiso;
|
||||
obj[F("mosi")] = mConfig->sys.eth.pinMosi;
|
||||
obj[F("irq")] = mConfig->sys.eth.pinIrq;
|
||||
obj[F("reset")] = mConfig->sys.eth.pinRst;
|
||||
}
|
||||
#endif
|
||||
|
||||
void getRadioNrf(JsonObject obj) {
|
||||
obj[F("en")] = (bool) mConfig->nrf.enabled;
|
||||
if(mConfig->nrf.enabled) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue