Skip to content

Commit

Permalink
v1.12.1 to improve and fix bug in examples
Browse files Browse the repository at this point in the history
### Release v1.12.1

1. Improve and fix bug in examples
  • Loading branch information
khoih-prog authored Oct 9, 2022
1 parent d3f3c13 commit b4d3bbd
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void setup()
client.onEvent(onEventsCallback);
}

void sendMessage(void)
void sendMessage()
{
// try to connect to Websockets server
bool connected = client.connect(websockets_server_host, websockets_server_port, "/");
Expand All @@ -122,10 +122,10 @@ void checkToSendMessage()
{
#define REPEAT_INTERVAL 10000L

static unsigned long checkstatus_timeout = 0;
static unsigned long checkstatus_timeout = 1000;

// Send WebSockets message every REPEAT_INTERVAL (10) seconds.
if ((millis() > checkstatus_timeout) || (checkstatus_timeout == 0))
if (millis() > checkstatus_timeout)
{
sendMessage();
checkstatus_timeout = millis() + REPEAT_INTERVAL;
Expand Down
2 changes: 1 addition & 1 deletion examples/ESP32/Esp32-Server/Esp32-Server.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using namespace websockets2_generic;

WebsocketsServer server;

void heartBeatPrint(void)
void heartBeatPrint()
{
static int num = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ void checkToSendMessage()
{
#define REPEAT_INTERVAL 10000L

static unsigned long checkstatus_timeout = 0;
static unsigned long checkstatus_timeout = 1000;

// Send WebSockets message every REPEAT_INTERVAL (10) seconds.
if ((millis() > checkstatus_timeout) || (checkstatus_timeout == 0))
if (millis() > checkstatus_timeout)
{
sendMessage();
checkstatus_timeout = millis() + REPEAT_INTERVAL;
Expand Down
2 changes: 1 addition & 1 deletion examples/ESP8266/Esp8266-Server/Esp8266-Server.ino
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ using namespace websockets2_generic;

WebsocketsServer server;

void heartBeatPrint(void)
void heartBeatPrint()
{
static int num = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void setup()
client.onEvent(onEventsCallback);
}

void sendMessage(void)
void sendMessage()
{
// try to connect to Websockets server
bool connected = client.connect(websockets_server_host, websockets_server_port, "/");
Expand All @@ -120,10 +120,10 @@ void checkToSendMessage()
{
#define REPEAT_INTERVAL 10000L

static unsigned long checkstatus_timeout = 0;
static unsigned long checkstatus_timeout = 1000;

// Send WebSockets message every REPEAT_INTERVAL (10) seconds.
if ((millis() > checkstatus_timeout) || (checkstatus_timeout == 0))
if (millis() > checkstatus_timeout)
{
sendMessage();
checkstatus_timeout = millis() + REPEAT_INTERVAL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ using namespace websockets2_generic;

WebsocketsServer server;

void heartBeatPrint(void)
void heartBeatPrint()
{
static int num = 1;

Expand Down

0 comments on commit b4d3bbd

Please sign in to comment.