Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: NerfUS_cmake_add_library_from_mbed NerfUS NerfUSGameCoordinator
WSRequest.hpp
00001 /** 00002 @file WSRequest.hpp 00003 00004 @brief Allow communication with a server using a specific websocket. 00005 00006 @poject NerfUS, Team P5 00007 */ 00008 #ifndef ETHERNET_MAGJACK 00009 #define ETHERNET_MAGJACK 00010 00011 #include "WSRequestInterface.hpp" 00012 #include "mbed.h" 00013 #include "EthernetInterface.h" 00014 #include "Websocket.h" 00015 00016 #define WS_BUFFER_SIZE 32 00017 00018 class WSRequest : public WSRequestInterface 00019 { 00020 public: 00021 /** 00022 * Initialize the communication interface 00023 * 00024 * @param url The url to the websocket server (eg. "ws://192.168.137.1:8000/") 00025 */ 00026 WSRequest(char *url); 00027 00028 // From the interface 00029 virtual int send(char *buffer); 00030 virtual bool onMessage(char *buffer); 00031 ~WSRequest(); 00032 00033 private: 00034 EthernetInterface eth; 00035 Websocket ws; 00036 }; 00037 00038 #endif
Generated on Thu Jul 14 2022 23:27:13 by
1.7.2