1 /* ****************************************************************
3 * Copyright 2014 Samsung Electronics All Rights Reserved.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 ******************************************************************/
24 * This file provides APIs ethernet client/server/network monitor modules.
27 #ifndef _CA_ETHERNET_ADAPTER_UTILS_
28 #define _CA_ETHERNET_ADAPTER_UTILS_
34 #include <EthernetUdp.h>
35 #include <IPAddress.h>
39 #include "caadapterinterface.h"
40 #include "caethernetadapter_singlethread.h"
41 #include "caadapterutils.h"
49 * @brief Get available UDP socket
50 * @param sockID [OUT] Available UDP socket ID
51 * @return #CA_STATUS_OK or Appropriate error code
53 CAResult_t CAArduinoGetAvailableSocket(int *sockID);
56 * @brief Initialize Unicast UDP socket
57 * @param port [INOUT] Port to start the unicast server
58 * @param socketID [OUT Unicast socket ID
59 * @return #CA_STATUS_OK or Appropriate error code
61 CAResult_t CAArduinoInitUdpSocket(uint16_t *port, int *socketID);
64 * @brief Initialize Multicast UDP socket
65 * @param mcastAddress [IN] Port to start the unicast server
66 * @param mport [IN] Multicast port
67 * @param lport [IN] Local port on which the server is started
68 * @param socketID [OUT] Multicast socket ID
69 * @return #CA_STATUS_OK or Appropriate error code
71 CAResult_t CAArduinoInitMulticastUdpSocket(const char *mcastAddress,
72 uint16_t mport, uint16_t lport,
79 #endif //_CA_ETHERNET_ADAPTER_UTILS_