Implementation of connectivity abstraction feature Release v0.3
[platform/upstream/iotivity.git] / resource / csdk / connectivity / inc / cawificore.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 cawificore.h
23  * @brief This file contains the APIs for Wi-Fi communications.
24  */
25 #ifndef __CA_WIFICORE_H_
26 #define __CA_WIFICORE_H_
27
28 #include "cacommon.h"
29 #include "config.h"
30 #include "coap.h"
31 #include "uthreadpool.h"
32
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif
37
38 typedef void (*CAPacketReceiveCallback)(char* address, const int port, const char* data);
39
40 void CAWiFiSetCallback(CAPacketReceiveCallback callback);
41
42 void CAWiFiInitMutex();
43
44 void CAWiFiInitialize(u_thread_pool_t handle);
45
46 int32_t CABindUnicastSocket();
47
48 void CAWiFiTerminate();
49
50 int32_t CAWiFiSendUnicastMessage(const char* address, const int port, char* data, int32_t length);
51
52 int32_t CAWiFiSendMulticastMessage(const char* m_address, char* data);
53
54 int32_t CAWiFiStartUnicastServer();
55
56 int32_t CAWiFiStartMulticastServer();
57
58 int32_t CAWiFiStopUnicastServer();
59
60 int32_t CAWiFiStopMulticastServer();
61
62 void CAGetLocalAddress(char *addressBuffer);
63
64 int32_t CASendUnicastMessageImpl(const char *address, const int port, const char *data);
65
66 int32_t CASendMulticastMessageImpl(const char *msg);
67
68 CAResult_t CAGetWIFIInterfaceInfo(CALocalConnectivity_t **info, uint32_t* size);
69
70 #ifdef __cplusplus
71 } /* extern "C" */
72 #endif
73
74 #endif