Skip to content

Commit

Permalink
minor beautification changes
Browse files Browse the repository at this point in the history
Re-ordered methods in KXRadio for symmetry.
Fixed indentation on table commments in webserver.cpp.
  • Loading branch information
jeffkowalski committed Oct 17, 2024
1 parent 30bc0b4 commit 6cdaa48
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
23 changes: 13 additions & 10 deletions include/kx_radio.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,21 @@ class KXRadio : public Lockable {

public:
static KXRadio & getInstance ();
int connect ();
void empty_kx_input_buffer (int wait_ms);
long get_from_kx (const char * command, int tries, int num_digits);
bool put_to_kx (const char * command, int num_digits, long value, int tries);
long get_from_kx_menu_item (uint8_t menu_item, int tries);
bool put_to_kx_menu_item (uint8_t menu_item, long value, int tries);
void get_kx_state (kx_state_t * in_state);
void restore_kx_state (const kx_state_t * in_state, int tries);
bool get_from_kx_string (const char * command, int tries, char * result, int result_size);
bool put_to_kx_command_string (const char * cmd, int tries);

int connect ();

bool is_connected () const { return m_is_connected; }

void empty_kx_input_buffer (int wait_ms);

long get_from_kx (const char * command, int tries, int num_digits);
bool put_to_kx (const char * command, int num_digits, long value, int tries);
long get_from_kx_menu_item (uint8_t menu_item, int tries);
bool put_to_kx_menu_item (uint8_t menu_item, long value, int tries);
bool get_from_kx_string (const char * command, int tries, char * result, int result_size);
bool put_to_kx_command_string (const char * command, int tries);
void get_kx_state (kx_state_t * in_state);
void restore_kx_state (const kx_state_t * in_state, int tries);
};

extern KXRadio & kxRadio; // global singleton
8 changes: 4 additions & 4 deletions src/webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ typedef struct
* Represents an array of asset entries to facilitate URI to asset mapping.
*/
static const asset_entry_t asset_map[] = {
// uri asset_start asset_end asset_type cache_time
// ================= ================== ================== ================== ======================
// uri asset_start asset_end asset_type cache_time
// ================= ================== ================== ================== ======================
{"/", index_html_srt, index_html_end, "text/html", 60}, // 1 minute cache
{"/index.html", index_html_srt, index_html_end, "text/html", 60},
{"/style.css", style_css_srt, style_css_end, "text/css", 60},
Expand Down Expand Up @@ -80,8 +80,8 @@ typedef struct
* GET, PUT, POST handlers
*/
static const api_handler_t api_handlers[] = {
// method api_name handler_func requires_radio
// ========== =================== ============================= =============
// method api_name handler_func requires_radio
// ========== =================== ============================= =============
{HTTP_GET, "batteryPercent", handler_batteryPercent_get, false},
{HTTP_GET, "batteryVoltage", handler_batteryVoltage_get, false},
{HTTP_GET, "connectionStatus", handler_connectionStatus_get, true },
Expand Down

0 comments on commit 6cdaa48

Please sign in to comment.