Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UDPSocket.h Source File

UDPSocket.h

00001 
00002 /** \addtogroup netsocket */
00003 /** @{*/
00004 /* UDPSocket
00005  * Copyright (c) 2015 ARM Limited
00006  *
00007  * Licensed under the Apache License, Version 2.0 (the "License");
00008  * you may not use this file except in compliance with the License.
00009  * You may obtain a copy of the License at
00010  *
00011  *     http://www.apache.org/licenses/LICENSE-2.0
00012  *
00013  * Unless required by applicable law or agreed to in writing, software
00014  * distributed under the License is distributed on an "AS IS" BASIS,
00015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016  * See the License for the specific language governing permissions and
00017  * limitations under the License.
00018  */
00019 
00020 #ifndef UDPSOCKET_H
00021 #define UDPSOCKET_H
00022 
00023 #include "netsocket/InternetSocket.h"
00024 #include "netsocket/NetworkStack.h"
00025 #include "netsocket/NetworkInterface.h"
00026 #include "netsocket/InternetDatagramSocket.h"
00027 #include "rtos/EventFlags.h"
00028 #include "ICMPSocket.h"
00029 
00030 
00031 /** UDP socket implementation.
00032  */
00033 class UDPSocket : public InternetDatagramSocket {
00034 public:
00035     /** Create an uninitialized socket.
00036      *
00037      *  @note Must call open to initialize the socket on a network stack.
00038      */
00039     UDPSocket();
00040 
00041     /** Create and open a socket on the network stack of the given
00042      *  network interface.
00043      *
00044      *  @tparam S    Type of the Network stack.
00045      *  @param stack Network stack as target for socket.
00046      *  @deprecated since mbed-os-5.11
00047      */
00048     template <typename S>
00049     MBED_DEPRECATED_SINCE("mbed-os-5.11",
00050                           "The UDPSocket(S *stack) constructor is deprecated"
00051                           "It discards the open() call return value."
00052                           "Use another constructor and call open() explicitly, instead.")
00053     UDPSocket(S *stack)
00054     {
00055         open(stack);
00056     }
00057 
00058 #if !defined(DOXYGEN_ONLY)
00059 
00060 protected:
00061     virtual nsapi_protocol_t get_proto();
00062 
00063 #endif //!defined(DOXYGEN_ONLY)
00064 
00065 };
00066 
00067 
00068 #endif
00069 
00070 /** @}*/