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 ******************************************************************/
23 * @brief This file contains the APIs for Wi-Fi communications.
25 #ifndef __CA_WIFICORE_H_
26 #define __CA_WIFICORE_H_
31 #include "uthreadpool.h"
38 typedef void (*CAPacketReceiveCallback)(char* address, const int port, const char* data);
40 void CAWiFiSetCallback(CAPacketReceiveCallback callback);
42 void CAWiFiInitMutex();
44 void CAWiFiInitialize(u_thread_pool_t handle);
46 int32_t CABindUnicastSocket();
48 void CAWiFiTerminate();
50 int32_t CAWiFiSendUnicastMessage(const char* address, const int port, char* data, int32_t length);
52 int32_t CAWiFiSendMulticastMessage(const char* m_address, char* data);
54 int32_t CAWiFiStartUnicastServer();
56 int32_t CAWiFiStartMulticastServer();
58 int32_t CAWiFiStopUnicastServer();
60 int32_t CAWiFiStopMulticastServer();
62 void CAGetLocalAddress(char *addressBuffer);
64 int32_t CASendUnicastMessageImpl(const char *address, const int port, const char *data);
66 int32_t CASendMulticastMessageImpl(const char *msg);
68 CAResult_t CAGetWIFIInterfaceInfo(CALocalConnectivity_t **info, uint32_t* size);