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 ******************************************************************/
22 * @file caethernetadapterutils.h
23 * @brief This file provides APIs ethernet client/server/network monitor modules
26 #ifndef CA_ETHERNET_ADAPTER_UTILS_
27 #define CA_ETHERNET_ADAPTER_UTILS_
33 #include <EthernetUdp.h>
34 #include <IPAddress.h>
38 #include "caadapterinterface.h"
39 #include "caipadapter.h"
40 #include "caadapterutils.h"
48 * @brief Get available UDP socket
49 * @param sockID [OUT] Available UDP socket ID
50 * @return #CA_STATUS_OK or Appropriate error code
52 CAResult_t CAArduinoGetAvailableSocket(int *sockID);
55 * @brief Initialize Unicast UDP socket
56 * @param port [INOUT] Port to start the unicast server
57 * @param socketID [OUT Unicast socket ID
58 * @return #CA_STATUS_OK or Appropriate error code
60 CAResult_t CAArduinoInitUdpSocket(uint16_t *port, int *socketID);
63 * @brief Initialize Multicast UDP socket
64 * @param mcastAddress [IN] Port to start the unicast server
65 * @param mport [IN] Multicast port
66 * @param lport [IN] Local port on which the server is started
67 * @param socketID [OUT] Multicast socket ID
68 * @return #CA_STATUS_OK or Appropriate error code
70 CAResult_t CAArduinoInitMulticastUdpSocket(const char *mcastAddress,
71 uint16_t mport, uint16_t lport,
78 #endif /* CA_ETHERNET_ADAPTER_UTILS_ */