mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 00:04:28 +01:00
Added SubGhz channel support to AP Web GUI.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -54,6 +54,7 @@ class tagRecord {
|
||||
|
||||
struct Config {
|
||||
uint8_t channel;
|
||||
uint8_t subghzchannel;
|
||||
char alias[32];
|
||||
uint8_t led;
|
||||
uint8_t tft;
|
||||
|
||||
@@ -257,6 +257,7 @@ build_flags =
|
||||
-D SERIAL_FLASHER_BOOT_HOLD_TIME_MS=50
|
||||
-D SERIAL_FLASHER_RESET_HOLD_TIME_MS=100
|
||||
-D C6_OTA_FLASHING
|
||||
-D HAS_SUBGHZ
|
||||
build_src_filter =
|
||||
+<*>-<usbflasher.cpp>-<swd.cpp>-<webflasher.cpp>
|
||||
board_build.flash_mode=qio
|
||||
|
||||
@@ -640,8 +640,11 @@ void setAPchannel() {
|
||||
udpsync.getAPList();
|
||||
} else {
|
||||
if (curChannel.channel != config.channel) {
|
||||
curChannel.channel = config.channel;
|
||||
sendChannelPower(&curChannel);
|
||||
curChannel.channel = config.channel;
|
||||
#ifdef HAS_SUBGHZ
|
||||
curChannel.subghzchannel = config.subghzchannel;
|
||||
#endif
|
||||
sendChannelPower(&curChannel);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,6 +315,7 @@ void initAPconfig() {
|
||||
configFile.close();
|
||||
}
|
||||
config.channel = APconfig.containsKey("channel") ? APconfig["channel"] : 0;
|
||||
config.subghzchannel = APconfig.containsKey("subghzchannel") ? APconfig["subghzchannel"] : 0;
|
||||
if (APconfig["alias"]) strlcpy(config.alias, APconfig["alias"], sizeof(config.alias));
|
||||
config.led = APconfig.containsKey("led") ? APconfig["led"] : 255;
|
||||
config.tft = APconfig.containsKey("tft") ? APconfig["tft"] : 255;
|
||||
@@ -343,6 +344,7 @@ void saveAPconfig() {
|
||||
fs::File configFile = contentFS->open("/current/apconfig.json", "w");
|
||||
DynamicJsonDocument APconfig(500);
|
||||
APconfig["channel"] = config.channel;
|
||||
APconfig["subghzchannel"] = config.subghzchannel;
|
||||
APconfig["alias"] = config.alias;
|
||||
APconfig["led"] = config.led;
|
||||
APconfig["tft"] = config.tft;
|
||||
|
||||
@@ -509,6 +509,13 @@ void init_web() {
|
||||
#else
|
||||
response->print("\"hasBLE\": \"0\", ");
|
||||
#endif
|
||||
|
||||
#ifdef HAS_SUBGHZ
|
||||
response->print("\"hasSubGhz\": \"1\", ");
|
||||
#else
|
||||
response->print("\"hasSubGhz\": \"0\", ");
|
||||
#endif
|
||||
|
||||
response->print("\"apstate\": \"" + String(apInfo.state) + "\"");
|
||||
|
||||
File configFile = contentFS->open("/current/apconfig.json", "r");
|
||||
@@ -542,6 +549,9 @@ void init_web() {
|
||||
if (request->hasParam("channel", true)) {
|
||||
config.channel = static_cast<uint8_t>(request->getParam("channel", true)->value().toInt());
|
||||
}
|
||||
if (request->hasParam("subghzchannel", true)) {
|
||||
config.subghzchannel = static_cast<uint8_t>(request->getParam("subghzchannel", true)->value().toInt());
|
||||
}
|
||||
if (request->hasParam("led", true)) {
|
||||
config.led = static_cast<uint8_t>(request->getParam("led", true)->value().toInt());
|
||||
updateBrightnessFromConfig();
|
||||
|
||||
@@ -289,6 +289,24 @@ options:
|
||||
<option value="27">27</option>
|
||||
</select>
|
||||
</p>
|
||||
<p title="Enable SubGhz support and select channel. This requires an AP that has an optional CC1101 SubGhz radio module attached.">
|
||||
<label for="apcfgsubgigchid">SubGhz channel</label>
|
||||
<select id="apcfgsubgigchid">
|
||||
<option value="0" selected>disabled</option>
|
||||
<option value="100">100 - 864.000 Mhz (Europe, etc)</option>
|
||||
<option value="101">101 - 865.006 Mhz (Europe, etc)</option>
|
||||
<option value="102">102 - 866.014 Mhz (Europe, etc)</option>
|
||||
<option value="103">103 - 867.020 Mhz (Europe, etc)</option>
|
||||
<option value="104">104 - 868.027 Mhz (Europe, etc)</option>
|
||||
<option value="105">105 - 869.034 Mhz (Europe, etc)</option>
|
||||
<option value="200">200 - 903.000 Mhz (US, etc)</option>
|
||||
<option value="201">201 - 907.027 Mhz (US, etc)</option>
|
||||
<option value="202">202 - 911.054 Mhz (US, etc)</option>
|
||||
<option value="203">203 - 915.083 Mhz (US, etc)</option>
|
||||
<option value="204">204 - 919.110 Mhz (US, etc)</option>
|
||||
<option value="205">205 - 923.138 Mhz (US, etc)</option>
|
||||
</select>
|
||||
</p>
|
||||
<p title="Enable Bluetooth (BLE) support. Only enable this if you have BLE capable tags. Changing this value requires a reboot to take effect.">
|
||||
<label for="apcfgble">Bluetooth</label>
|
||||
<select id="apcfgble">
|
||||
|
||||
@@ -64,6 +64,9 @@ window.addEventListener("loadConfig", function () {
|
||||
if (data.hasBLE == 0) {
|
||||
$("#apcfgble").parentNode.style.display = 'none';
|
||||
}
|
||||
if (data.hasSubGhz == 0) {
|
||||
$("#apcfgsubgigchid").parentNode.style.display = 'none';
|
||||
}
|
||||
if (data.savespace) {
|
||||
}
|
||||
if (data.apstate) {
|
||||
@@ -730,6 +733,7 @@ document.addEventListener("loadTab", function (event) {
|
||||
apConfig = data;
|
||||
$('#apcfgalias').value = data.alias;
|
||||
$('#apcfgchid').value = data.channel;
|
||||
$('#apcfgsubgigchid').value = data.subghzchannel;
|
||||
$('#apcfgble').value = data.ble;
|
||||
$("#apcfgledbrightness").value = data.led;
|
||||
$("#apcfgtftbrightness").value = data.tft;
|
||||
@@ -765,6 +769,7 @@ $('#apcfgsave').onclick = function () {
|
||||
let formData = new FormData();
|
||||
formData.append("alias", $('#apcfgalias').value);
|
||||
formData.append("channel", $('#apcfgchid').value);
|
||||
formData.append("subghzchannel", $('#apcfgsubgigchid').value);
|
||||
formData.append('ble', $('#apcfgble').value);
|
||||
formData.append('led', $('#apcfgledbrightness').value);
|
||||
formData.append('tft', $('#apcfgtftbrightness').value);
|
||||
|
||||
@@ -18,6 +18,9 @@ struct espSetChannelPower {
|
||||
uint8_t checksum;
|
||||
uint8_t channel;
|
||||
uint8_t power;
|
||||
#ifdef HAS_SUBGHZ
|
||||
uint8_t subghzchannel;
|
||||
#endif
|
||||
} __packed;
|
||||
|
||||
struct espAvailDataReq {
|
||||
|
||||
Reference in New Issue
Block a user