ProjetoBB

Dependencies:   F7_Ethernet WebSocketClient mbed mcp3008

Fork of Nucleo_F746ZG_Ethernet by Dieter Graef

Committer:
DieterGraef
Date:
Sat Jun 18 10:49:12 2016 +0000
Revision:
0:f9b6112278fe
Ethernet for the NUCLEO STM32F746 Board Testprogram uses DHCP and NTP to set the clock

Who changed what in which revision?

UserRevisionLine numberNew contents of line
DieterGraef 0:f9b6112278fe 1 /* Copyright (C) 2012 mbed.org, MIT License
DieterGraef 0:f9b6112278fe 2 *
DieterGraef 0:f9b6112278fe 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
DieterGraef 0:f9b6112278fe 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
DieterGraef 0:f9b6112278fe 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
DieterGraef 0:f9b6112278fe 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
DieterGraef 0:f9b6112278fe 7 * furnished to do so, subject to the following conditions:
DieterGraef 0:f9b6112278fe 8 *
DieterGraef 0:f9b6112278fe 9 * The above copyright notice and this permission notice shall be included in all copies or
DieterGraef 0:f9b6112278fe 10 * substantial portions of the Software.
DieterGraef 0:f9b6112278fe 11 *
DieterGraef 0:f9b6112278fe 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
DieterGraef 0:f9b6112278fe 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
DieterGraef 0:f9b6112278fe 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DieterGraef 0:f9b6112278fe 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
DieterGraef 0:f9b6112278fe 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
DieterGraef 0:f9b6112278fe 17 */
DieterGraef 0:f9b6112278fe 18 #ifndef TCPSOCKETSERVER_H
DieterGraef 0:f9b6112278fe 19 #define TCPSOCKETSERVER_H
DieterGraef 0:f9b6112278fe 20
DieterGraef 0:f9b6112278fe 21 #include "Socket/Socket.h"
DieterGraef 0:f9b6112278fe 22 #include "TCPSocketConnection.h"
DieterGraef 0:f9b6112278fe 23
DieterGraef 0:f9b6112278fe 24 /** TCP Server.
DieterGraef 0:f9b6112278fe 25 */
DieterGraef 0:f9b6112278fe 26 class TCPSocketServer : public Socket {
DieterGraef 0:f9b6112278fe 27 public:
DieterGraef 0:f9b6112278fe 28 /** Instantiate a TCP Server.
DieterGraef 0:f9b6112278fe 29 */
DieterGraef 0:f9b6112278fe 30 TCPSocketServer();
DieterGraef 0:f9b6112278fe 31
DieterGraef 0:f9b6112278fe 32 /** Bind a socket to a specific port.
DieterGraef 0:f9b6112278fe 33 \param port The port to listen for incoming connections on.
DieterGraef 0:f9b6112278fe 34 \return 0 on success, -1 on failure.
DieterGraef 0:f9b6112278fe 35 */
DieterGraef 0:f9b6112278fe 36 int bind(int port);
DieterGraef 0:f9b6112278fe 37
DieterGraef 0:f9b6112278fe 38 /** Start listening for incoming connections.
DieterGraef 0:f9b6112278fe 39 \param backlog number of pending connections that can be queued up at any
DieterGraef 0:f9b6112278fe 40 one time [Default: 1].
DieterGraef 0:f9b6112278fe 41 \return 0 on success, -1 on failure.
DieterGraef 0:f9b6112278fe 42 */
DieterGraef 0:f9b6112278fe 43 int listen(int backlog=1);
DieterGraef 0:f9b6112278fe 44
DieterGraef 0:f9b6112278fe 45 /** Accept a new connection.
DieterGraef 0:f9b6112278fe 46 \param connection A TCPSocketConnection instance that will handle the incoming connection.
DieterGraef 0:f9b6112278fe 47 \return 0 on success, -1 on failure.
DieterGraef 0:f9b6112278fe 48 */
DieterGraef 0:f9b6112278fe 49 int accept(TCPSocketConnection& connection);
DieterGraef 0:f9b6112278fe 50 };
DieterGraef 0:f9b6112278fe 51
DieterGraef 0:f9b6112278fe 52 #endif