BEEEEEEEEEEEEEEEEEP

This commit is contained in:
2017-08-20 00:28:31 +02:00
parent fe714bf473
commit 5995988a9b
5 changed files with 91 additions and 2 deletions
+2 -2
View File
@@ -10,6 +10,7 @@
#include "ansi_parser.h"
#include "uart_driver.h"
#include "sgr.h"
#include "cgi_sockets.h"
static char utf_collect[4];
static int utf_i = 0;
@@ -127,8 +128,7 @@ apars_handle_spaceCmd(char c)
void ICACHE_FLASH_ATTR
apars_handle_bel(void)
{
ansi_warn("NOIMPL: BEEP");
// TODO pass to the browser somehow
send_beep();
}
/**
+8
View File
@@ -64,6 +64,14 @@ notifyLabelsTimCb(void *arg)
notify_available = true;
}
/** Beep */
void ICACHE_FLASH_ATTR
send_beep(void)
{
// here's some potential for a race error with the other broadcast functions :C
cgiWebsockBroadcast(URL_WS_UPDATE, "B", 1, 0);
}
/**
* Broadcast screen state to sockets.
+3
View File
@@ -3,12 +3,15 @@
#define URL_WS_UPDATE "/term/update.ws"
#include <cgiwebsocket.h>
#include "screen.h"
/** Update websocket connect callback */
void updateSockConnect(Websock *ws);
void screen_notifyChange(ScreenNotifyChangeTopic topic);
void send_beep(void);
// defined in the makefile
#if DEBUG_INPUT
#define ws_warn warn