The code from https://github.com/vpcola/Nucleo

Committer:
sinrab
Date:
Wed Oct 08 11:00:24 2014 +0000
Revision:
0:5464d5e415e5
The code from https://github.com/vpcola/Nucleo

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sinrab 0:5464d5e415e5 1 /* Copyright (C) 2013 mbed.org, MIT License
sinrab 0:5464d5e415e5 2 *
sinrab 0:5464d5e415e5 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
sinrab 0:5464d5e415e5 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
sinrab 0:5464d5e415e5 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
sinrab 0:5464d5e415e5 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
sinrab 0:5464d5e415e5 7 * furnished to do so, subject to the following conditions:
sinrab 0:5464d5e415e5 8 *
sinrab 0:5464d5e415e5 9 * The above copyright notice and this permission notice shall be included in all copies or
sinrab 0:5464d5e415e5 10 * substantial portions of the Software.
sinrab 0:5464d5e415e5 11 *
sinrab 0:5464d5e415e5 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
sinrab 0:5464d5e415e5 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
sinrab 0:5464d5e415e5 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
sinrab 0:5464d5e415e5 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
sinrab 0:5464d5e415e5 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
sinrab 0:5464d5e415e5 17 */
sinrab 0:5464d5e415e5 18 #ifndef ENDPOINT_H
sinrab 0:5464d5e415e5 19 #define ENDPOINT_H
sinrab 0:5464d5e415e5 20
sinrab 0:5464d5e415e5 21 #include "cc3000.h"
sinrab 0:5464d5e415e5 22
sinrab 0:5464d5e415e5 23 using namespace mbed_cc3000;
sinrab 0:5464d5e415e5 24
sinrab 0:5464d5e415e5 25 class UDPSocket;
sinrab 0:5464d5e415e5 26
sinrab 0:5464d5e415e5 27 /**
sinrab 0:5464d5e415e5 28 IP Endpoint (address, port)
sinrab 0:5464d5e415e5 29 */
sinrab 0:5464d5e415e5 30 class Endpoint {
sinrab 0:5464d5e415e5 31 friend class UDPSocket;
sinrab 0:5464d5e415e5 32
sinrab 0:5464d5e415e5 33 public:
sinrab 0:5464d5e415e5 34 /** IP Endpoint (address, port)
sinrab 0:5464d5e415e5 35 */
sinrab 0:5464d5e415e5 36 Endpoint(void);
sinrab 0:5464d5e415e5 37
sinrab 0:5464d5e415e5 38 ~Endpoint(void);
sinrab 0:5464d5e415e5 39
sinrab 0:5464d5e415e5 40 /** Reset the address of this endpoint
sinrab 0:5464d5e415e5 41 */
sinrab 0:5464d5e415e5 42 void reset_address(void);
sinrab 0:5464d5e415e5 43
sinrab 0:5464d5e415e5 44 /** Set the address of this endpoint
sinrab 0:5464d5e415e5 45 \param host The endpoint address (it can either be an IP Address or a hostname that will be resolved with DNS).
sinrab 0:5464d5e415e5 46 \param port The endpoint port
sinrab 0:5464d5e415e5 47 \return 0 on success, -1 on failure (when an hostname cannot be resolved by DNS).
sinrab 0:5464d5e415e5 48 */
sinrab 0:5464d5e415e5 49 int set_address(const char* host, const int port);
sinrab 0:5464d5e415e5 50
sinrab 0:5464d5e415e5 51 /** Get the IP address of this endpoint
sinrab 0:5464d5e415e5 52 \return The IP address of this endpoint.
sinrab 0:5464d5e415e5 53 */
sinrab 0:5464d5e415e5 54 char* get_address(void);
sinrab 0:5464d5e415e5 55
sinrab 0:5464d5e415e5 56 /** Get the port of this endpoint
sinrab 0:5464d5e415e5 57 \return The port of this endpoint
sinrab 0:5464d5e415e5 58 */
sinrab 0:5464d5e415e5 59 int get_port(void);
sinrab 0:5464d5e415e5 60
sinrab 0:5464d5e415e5 61 protected:
sinrab 0:5464d5e415e5 62 char _ipAddress[17];
sinrab 0:5464d5e415e5 63 sockaddr_in _remote_host;
sinrab 0:5464d5e415e5 64 cc3000 *_cc3000_module;
sinrab 0:5464d5e415e5 65 };
sinrab 0:5464d5e415e5 66
sinrab 0:5464d5e415e5 67 #endif
sinrab 0:5464d5e415e5 68