1 //*****************************************************************
3 // Copyright 2015 Intel Mobile Communications GmbH All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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 * This file contains the APIs for IP Adapter.
25 #ifndef CA_RA_ADAPTER_H_
26 #define CA_RA_ADAPTER_H_
29 #include "caadapterinterface.h"
30 #include "cathreadpool.h"
39 * API to initialize RA Interface.
40 * @param[in] registerCallback Callback to register RA interfaces to
41 * Connectivity Abstraction Layer.
42 * @param[in] networkPacketCallback Callback to notify request and
43 * response messages from server(s)
44 * started at Connectivity Abstraction Layer.
45 * @param[in] netCallback Callback to notify the network
46 * additions to Connectivity Abstraction
48 * @param[in] handle Threadpool Handle.
49 * @return ::CA_STATUS_OK or Appropriate error code.
51 CAResult_t CAInitializeRA(CARegisterConnectivityCallback registerCallback,
52 CANetworkPacketReceivedCallback networkPacketCallback,
53 CANetworkChangeCallback netCallback,
54 ca_thread_pool_t handle);
58 * Start RA Interface adapter.
59 * @return ::CA_STATUS_OK or Appropriate error code.
61 CAResult_t CAStartRA();
64 * Sends data to the endpoint using the adapter connectivity.
65 * @param[in] endpoint Remote Endpoint information (like ipaddress, port,
66 * reference uri and transport type) to which
67 * the unicast data has to be sent.
68 * @param[in] data Data which is required to be sent.
69 * @param[in] dataLen Size of data to be sent.
70 * @note dataLen must be > 0.
71 * @return The number of bytes sent on the network, or -1 upon error.
73 int32_t CASendRAUnicastData(const CAEndpoint_t *endpoint, const void *data,
77 * Get RA Connectivity network information.
78 * @param[out] info Local connectivity information structures.
79 * @note info is allocated in this API and should be freed by the caller.
80 * @param[out] size Number of local connectivity structures.
81 * @return ::CA_STATUS_OK or Appropriate error code.
83 CAResult_t CAGetRAInterfaceInformation(CAEndpoint_t **info, uint32_t *size);
86 * Stops RA server and de-register XMPP callback listeners.
87 * @return ::CA_STATUS_OK or Appropriate error code.
89 CAResult_t CAStopRA();
92 * Terminate the RA connectivity adapter.
93 * Configuration information will be deleted from further use.
98 * Set Remote Access information for XMPP Client.
99 * @param[in] caraInfo remote access info.
101 * @return ::CA_STATUS_OK.
103 CAResult_t CASetRAInfo(const CARAInfo_t *caraInfo);
106 * These functions are not applicable to Remote Access adapter.
108 int32_t CASendRAMulticastData(const CAEndpoint_t *endpoint,
109 const void *data, uint32_t dataLen);
112 * Start listening server for receiving search requests.
113 * @return ::CA_NOT_SUPPORTED.
115 CAResult_t CAStartRAListeningServer();
118 * Start discovery servers for receiving advertisements.
119 * @return ::CA_NOT_SUPPORTED.
121 CAResult_t CAStartRADiscoveryServer();
124 * Read Synchronous API callback.
125 * @return ::CA_NOT_SUPPORTED.
127 CAResult_t CAReadRAData();
133 #endif //CA_RA_ADAPTER_H_