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_
37 typedef void (*CAPacketReceiveCallback)(const char* address, const char* data);
39 void CAWiFiInitialize();
41 void CAWiFiTerminate();
43 int32_t CAWiFiSendUnicastMessage(const char* address, const char* data, int32_t length);
45 int32_t CAWiFiSendMulticastMessage(const char* m_address, const char* data);
47 int32_t CAWiFiStartUnicastServer(const char* address, int32_t port);
49 int32_t CAWiFiStartMulticastServer(const char* m_address, int32_t port);
51 int32_t CAWiFiStopUnicastServer(int32_t server_id);
53 int32_t CAWiFiStopMulticastServer(int32_t server_id);
55 void CAWiFiSetCallback(CAPacketReceiveCallback callback);
57 void* CAUnicastReceiveThread(void* data);
59 void* CAUnicastSendThread(void* data);
61 void CASendUnicastMessage(char* address, void* data);
63 int32_t CASendUnicastMessageImpl(const char* address, const char* data, int32_t lengh);
65 void CAStopUnicastSendThread();
67 void* CAMulticastReceiveThread(void* data);
69 void* CAMulticastSendThread(void* data);
71 void CASendMulticastMessage(void* data);
73 int32_t CASendMulticastMessageImpl(const char* msg);
75 void CAStopMulticastSendThread();
77 void CAGetLocalAddress(char* addressBuffer);