diff --git a/main/protocol.c b/main/protocol.c index 08a9c47..c81d8b1 100644 --- a/main/protocol.c +++ b/main/protocol.c @@ -144,6 +144,14 @@ static int send_sysex(const uint8_t *sysex, uint16_t len) return wifi_send_sysex(sysex, len); } +/* ---- outbound: keepalive ---- */ + +int send_keepalive(void) +{ + uint8_t sx[] = { 0xF0, 0x7D, RSP_KEEPALIVE, 0xF7 }; + return send_sysex(sx, sizeof(sx)); +} + /* ---- outbound: EIS ---- */ int send_sweep_start(uint32_t num_points, float freq_start, float freq_stop) diff --git a/main/protocol.h b/main/protocol.h index 54b756b..dfab429 100644 --- a/main/protocol.h +++ b/main/protocol.h @@ -56,6 +56,7 @@ #define RSP_REF_LP_RANGE 0x21 #define RSP_REFS_DONE 0x22 #define RSP_REF_STATUS 0x23 +#define RSP_KEEPALIVE 0x50 /* Session sync responses (0x4x) */ #define RSP_SESSION_CREATED 0x40 @@ -138,6 +139,9 @@ int send_ref_lp_range(uint8_t mode, uint8_t low_idx, uint8_t high_idx); int send_refs_done(void); int send_ref_status(uint8_t has_refs); +/* keepalive (sent during long blocking ops) */ +int send_keepalive(void); + /* session management */ const Session *session_get_all(uint8_t *count); uint8_t session_get_current(void);