Skip to content

Conversation

@vDorst
Copy link
Collaborator

@vDorst vDorst commented Oct 28, 2025

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.

JSON output now looks like:

eee.json:
[{"portNum":5,"isSFP":1},{"portNum":1,"isSFP":0,"eee":"111","eee_lp":"000","active":0},{"portNum":2,"isSFP":0,"eee":"111","eee_lp":"000","active":0},{"portNum":3,"isSFP":0,"eee":"111","eee_lp":"000","active":0},{"portNum":4,"isSFP":0,"eee":"111","eee_lp":"111","active":1},{"portNum":6,"isSFP":1}]

status.json:
[{"portNum":5,"isSFP":1,"enabled":0,"link":1,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"},"portNum":1,"isSFP":0,"enabled":1,"link":0,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"},"portNum":2,"isSFP":0,"enabled":1,"link":2,"txG":"0x03c8","txB":"0x0","rxG":"0x053f","rxB":"0x1"},"portNum":3,"isSFP":0,"enabled":1,"link":0,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"},"portNum":4,"isSFP":0,"enabled":1,"link":5,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"},"portNum":6,"isSFP":1,"enabled":0,"link":1,"txG":"0x00","txB":"0x0","rxG":"0x00","rxB":"0x0"}]

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.
@logicog logicog self-assigned this Oct 29, 2025
@logicog logicog merged commit aa99921 into logicog:main Oct 29, 2025
@logicog
Copy link
Owner

logicog commented Oct 29, 2025

Great idea! Tested and works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants