Corrected @file tags and restored 'Files' section.
[platform/upstream/iotivity.git] / resource / csdk / connectivity / src / ethernet_adapter / arduino / caethernetadapterutils.h
1 /* ****************************************************************
2 *
3 * Copyright 2014 Samsung Electronics All Rights Reserved.
4 *
5 *
6 *
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
10 *
11 *      http://www.apache.org/licenses/LICENSE-2.0
12 *
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.
18 *
19 ******************************************************************/
20
21 /**
22  * @file
23  *
24  * This file provides APIs ethernet client/server/network monitor modules.
25  */
26
27 #ifndef _CA_ETHERNET_ADAPTER_UTILS_
28 #define _CA_ETHERNET_ADAPTER_UTILS_
29
30 #include <Arduino.h>
31 #include <Ethernet.h>
32 #include <socket.h>
33 #include <w5100.h>
34 #include <EthernetUdp.h>
35 #include <IPAddress.h>
36
37 #include "logger.h"
38 #include "cacommon.h"
39 #include "caadapterinterface.h"
40 #include "caethernetadapter_singlethread.h"
41 #include "caadapterutils.h"
42
43 #ifdef __cplusplus
44 extern "C"
45 {
46 #endif
47
48 /**
49  * @brief Get available UDP socket
50  * @param   sockID      [OUT]   Available UDP socket ID
51  * @return  #CA_STATUS_OK or Appropriate error code
52  */
53 CAResult_t CAArduinoGetAvailableSocket(int *sockID);
54
55 /**
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
60  */
61 CAResult_t CAArduinoInitUdpSocket(uint16_t *port, int *socketID);
62
63 /**
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
70  */
71 CAResult_t CAArduinoInitMulticastUdpSocket(const char *mcastAddress,
72                                            uint16_t mport, uint16_t lport,
73                                            int *socketID);
74
75 #ifdef __cplusplus
76 }
77 #endif
78
79 #endif //_CA_ETHERNET_ADAPTER_UTILS_
80
81