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 * @brief 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 * @brief API to initialize RA Interface.
40 * @param registerCallback [IN] Callback to register RA interfaces to Connectivity
42 * @param networkPacketCallback [IN] Callback to notify request and response messages from server(s)
43 * started at Connectivity Abstraction Layer.
44 * @param netCallback [IN] Callback to notify the network additions to Connectivity
46 * @param handle [IN] Threadpool Handle
47 * @return #CA_STATUS_OK or Appropriate error code
49 CAResult_t CAInitializeRA(CARegisterConnectivityCallback registerCallback,
50 CANetworkPacketReceivedCallback networkPacketCallback,
51 CANetworkChangeCallback netCallback,
52 ca_thread_pool_t handle);
56 * @brief Start RA Interface adapter.
57 * @return #CA_STATUS_OK or Appropriate error code
59 CAResult_t CAStartRA();
62 * @brief Sends data to the endpoint using the adapter connectivity.
63 * @param endpoint [IN] Remote Endpoint information (like ipaddress , port,
64 * reference uri and transport type) to which the unicast data has to be sent.
65 * @param data [IN] Data which is required to be sent.
66 * @param dataLen [IN] Size of data to be sent.
67 * @return The number of bytes sent on the network. Return value equal to -1 indicates error.
68 * @remarks dataLen must be > 0.
70 int32_t CASendRAUnicastData(const CAEndpoint_t *endpoint, const void *data,
74 * @brief Get RA Connectivity network information
75 * @param info [OUT] Local connectivity information structures
76 * @param size [OUT] Number of local connectivity structures.
77 * @return #CA_STATUS_OK or Appropriate error code
78 * @remarks info is allocated in this API and should be freed by the caller.
80 CAResult_t CAGetRAInterfaceInformation(CAEndpoint_t **info, uint32_t *size);
83 * @brief Stops RA server and de-register XMPP callback listeners
84 * @return #CA_STATUS_OK or Appropriate error code
86 CAResult_t CAStopRA();
89 * @brief Terminate the RA connectivity adapter.
90 * Configuration information will be deleted from further use
96 * @brief Set Remote Access information for XMPP Client.
97 * @param caraInfo [IN] remote access info.
99 * @return CA_STATUS_OK
101 CAResult_t CASetRAInfo(const CARAInfo_t *caraInfo);
104 * These functions are not applicable to Remote Access adapter
106 int32_t CASendRAMulticastData(const CAEndpoint_t *endpoint,
107 const void *data, uint32_t dataLen);
109 * @brief Start listening server for receiving search requests.
110 * @return #CA_NOT_SUPPORTED
112 CAResult_t CAStartRAListeningServer();
115 * @brief Start discovery servers for receiving advertisements.
116 * @return #CA_NOT_SUPPORTED
118 CAResult_t CAStartRADiscoveryServer();
121 * @brief Read Synchronous API callback.
122 * @return #CA_NOT_SUPPORTED
124 CAResult_t CAReadRAData();
130 #endif //CA_RA_ADAPTER_H_