Commit Graph
19 Commits
Author SHA1 Message Date
logicog 3679b46ff2 Add LAG implementation in httpd 2025-12-05 07:38:16 +01:00
logicog 7f715e9218 Move inline itohex() into header file to allow external access 2025-12-01 18:26:46 +01:00
logicog f485102d26 Add fetching of configuration file and current cmd history 2025-11-29 12:44:23 +01:00
René van Dorst f59be9cf2b Added software version + git short hash string to firmware.
The Makefile has the version number and generates a version.h which
has VERSION_SW define that looks like "v<VERSION>-g<GIT_SHORT_HASH>".

Software version shows at boot in the serial console.
And shown with command: `version`.

It can also be requested via `information.json`.
```
{
    "ip_address": "192.168.10.247",
    "ip_gateway": "192.168.10.1",
    "ip_netmask": "255.255.255.0",
    "mac_address": "1c:2a:a3:23:00:02",
    "sw_ver": "v0.1.0-gd48235f",
    "hw_ver": "SWGT024-V2.0"
}
```
2025-11-26 23:08:23 +01:00
logicog 51c5bd75eb Add mirroring web-calls 2025-10-29 15:39:47 +01:00
René van Dorst 7d94f3d328 Improve JSON response.
Remove all the extra spaces from the json.
Also simplify the generation of the json.
Codespace is cheap so duplicated strings is not an issue.
But generating strings from different parts is more expensive in clock cycles.

Add a helper funcion `bool_to_html()` to generate bool value for html output.
2025-10-28 21:10:26 +01:00
logicog 726b421824 Add EEE httpd support 2025-10-21 17:46:18 +02:00
René van Dorst 52fa41760c Don't pass the first 16-bit argument via xdata.
Calling confention already uses the DPTR registers as the first two byte arguments.
So adds a lot of code to put the 16-bit value on xdata, still passes the 16-bit xdata ptr in DPTR registers, then read the xdata value.
So it doesn't save any sram bytes.
2025-10-05 16:22:23 +02:00
René van Dorst 884bc18a61 Remove flash_read_bulk(), refactor website and execute_config().
flash_read_bulk() is kind of a printf function. But did not work as well.
flash_read_bulk() was used in the http generation so this needed to be changed as well.

For the website we decided that we are going to use CSR(Client Side Rendering).
So every HTML and JS files are now static.
Variables are fetched via json calls and output is render on the client side.
Also usefull for the future when we want a REST like API.

execute_config() was also using flash_read_bulk().
This have been replaced with flash_read_bulk() and parsing the flash_buf buffer.
2025-10-05 15:47:14 +02:00
René van Dorst 2eb1416ada httpd: fix print ip-address, added missing shift. 2025-09-11 07:47:33 +02:00
René van Dorst 8ff124af30 httpd: fix itoa_html() does not print the middle zero.
when the input is 100.
the first zero is not printed because t = 0 and skip printing.
So the output is "10" instead of "100".
2025-09-11 07:34:18 +02:00
René van Dorst 94ae1472c3 httpd: optimize sfr_data_to_html()
This also fixes a compiler warning.
page_impl.c: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
2025-09-11 07:34:16 +02:00
René van Dorst 24f588effd httpd: Also don't byte_to_html() and itoa_html() to save 1.5kbytes.
Also fixed compiler "warning page_impl.c:47: warning 126: unreachable code".
But I think it was a false-positive.
2025-09-11 07:32:25 +02:00
René van Dorst 18f1fb5f1a http: don't inline char_to_html(), save 1k of flash 2025-09-10 16:07:59 +02:00
logicog 829fbf707a Use uip for mac-address, enable STP packages 2025-08-30 18:43:31 +02:00
logicog a0239b72f4 Add support for VLAN names 2025-08-28 16:58:51 +02:00
logicog ae80aa1017 Add support for different statistic counters 2025-08-21 16:12:59 +02:00
logicog 53a8046874 Implement sending of status and VLAN info 2025-08-20 10:13:14 +02:00
logicog f8eb55d587 Adding code for dynamic html page functions 2025-08-05 09:33:42 +02:00