Skip to content

v0od0oChild/IntelGalileoWebsocketClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IntelGalileoWebsocketClient

Websocket client ported for INTEL GALILEO boards.

Install the library to "libraries" folder in your Sketchbook folder.

This library is general purpose but was made to support the Muzzley Galileo Arduino Library. Check Muzzley for more details.

Usage Example

#include <Ethernet.h>
#include <WSClient.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
WSClient client;

void setup() {
  Serial.begin(9600);
  Ethernet.begin(mac);
  client.connect("echo.websocket.org", 80, "/");
  addEventListener("on_message", new Delegate<void, char*>(&onMessage));
  addEventListener("on_close", new Delegate<void, char*>(&onConnectionClose));
  client.send("Hello world");
}

void loop() {
  delay(50);
  client.listen();
}

void onConnectionClose(char* msg){
  Serial.println("Connection closed");
  Serial.println("");
}

void onMessage(char* msg) {
  Serial.println("--- Got message ----");
  Serial.println(msg);
}

Credits

Special thanks to:

About

A websocket client lib for intel galileo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages