NerfUS / HardwareInterface

Dependents:   NerfUS_cmake_add_library_from_mbed NerfUS NerfUSGameCoordinator

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers WSRequestInterface.hpp Source File

WSRequestInterface.hpp

Go to the documentation of this file.
00001 /**
00002 @file WSRequestInterface.hpp
00003 
00004 @brief Allow communication with a server using a specific websocket.
00005 
00006 @poject NerfUS, Team P5
00007 */
00008 class WSRequestInterface
00009 {
00010     /**
00011     * Allow to send a buffer of information to the server
00012     *
00013     * @param buffer The data to send
00014     * @returns the number of bytes sent
00015     */
00016     virtual int send(char *buffer) = 0;
00017 
00018     /**
00019     * Blocking method to get message back from the server
00020     *
00021     * @param buffer Must be a pointer to the buffer to write the message
00022     * @return true if a websocket frame has been read
00023     */
00024     virtual bool onMessage(char *buffer) = 0;
00025 };