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 "cainterface.h"
31 #include "cathreadpool.h"
40 * API to initialize RA Interface.
41 * @param[in] registerCallback Callback to register RA interfaces to
42 * Connectivity Abstraction Layer.
43 * @param[in] networkPacketCallback Callback to notify request and
44 * response messages from server(s)
45 * started at Connectivity Abstraction Layer.
46 * @param[in] netCallback Callback to notify the network
47 * additions to Connectivity Abstraction
49 * @param[in] handle Threadpool Handle.
50 * @return ::CA_STATUS_OK or Appropriate error code.
52 CAResult_t CAInitializeRA(CARegisterConnectivityCallback registerCallback,
53 CANetworkPacketReceivedCallback networkPacketCallback,
54 CANetworkChangeCallback netCallback,
55 ca_thread_pool_t handle);
59 * Start RA Interface adapter.
60 * @return ::CA_STATUS_OK or Appropriate error code.
62 CAResult_t CAStartRA();
65 * Sends data to the endpoint using the adapter connectivity.
66 * @param[in] endpoint Remote Endpoint information (like ipaddress, port,
67 * reference uri and transport type) to which
68 * the unicast data has to be sent.
69 * @param[in] data Data which is required to be sent.
70 * @param[in] dataLen Size of data to be sent.
71 * @note dataLen must be > 0.
72 * @return The number of bytes sent on the network, or -1 upon error.
74 int32_t CASendRAUnicastData(const CAEndpoint_t *endpoint, const void *data,
78 * Get RA Connectivity network information.
79 * @param[out] info Local connectivity information structures.
80 * @note info is allocated in this API and should be freed by the caller.
81 * @param[out] size Number of local connectivity structures.
82 * @return ::CA_STATUS_OK or Appropriate error code.
84 CAResult_t CAGetRAInterfaceInformation(CAEndpoint_t **info, uint32_t *size);
87 * Stops RA server and de-register XMPP callback listeners.
88 * @return ::CA_STATUS_OK or Appropriate error code.
90 CAResult_t CAStopRA();
93 * Terminate the RA connectivity adapter.
94 * Configuration information will be deleted from further use.
99 * Set Remote Access information for XMPP Client.
100 * @param[in] caraInfo remote access info.
102 * @return ::CA_STATUS_OK.
104 CAResult_t CASetRAInfo(const CARAInfo_t *caraInfo);
107 * These functions are not applicable to Remote Access adapter.
109 int32_t CASendRAMulticastData(const CAEndpoint_t *endpoint,
110 const void *data, uint32_t dataLen);
113 * Start listening server for receiving search requests.
114 * @return ::CA_NOT_SUPPORTED.
116 CAResult_t CAStartRAListeningServer();
119 * Start discovery servers for receiving advertisements.
120 * @return ::CA_NOT_SUPPORTED.
122 CAResult_t CAStartRADiscoveryServer();
125 * Read Synchronous API callback.
126 * @return ::CA_NOT_SUPPORTED.
128 CAResult_t CAReadRAData();
134 #endif //CA_RA_ADAPTER_H_