X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fconnectivity%2Finc%2Fcaipinterface.h;h=62eb0fdd9eeae30c3ae7a4ac97501fc675dc22fe;hb=c315c87e07c4080ecd0ef488e7a1047bc3c509b2;hp=67018251b18169143e300c566d8e2d02245b5258;hpb=defdf6eff73081dc0ccb48b3f0253ec655d7c085;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/connectivity/inc/caipinterface.h b/resource/csdk/connectivity/inc/caipinterface.h index 6701825..62eb0fd 100644 --- a/resource/csdk/connectivity/inc/caipinterface.h +++ b/resource/csdk/connectivity/inc/caipinterface.h @@ -53,11 +53,12 @@ typedef enum * @param[in] sep network endpoint description. * @param[in] data Data received from remote OIC device. * @param[in] dataLength Length of data in bytes. + * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h). * @pre Callback must be registered using CAIPSetPacketReceiveCallback(). */ -typedef void (*CAIPPacketReceivedCallback)(const CASecureEndpoint_t *sep, - const void *data, - uint32_t dataLength); +typedef CAResult_t (*CAIPPacketReceivedCallback)(const CASecureEndpoint_t *sep, + const void *data, + uint32_t dataLength); /** * Callback to notify error in the IP adapter. @@ -162,54 +163,6 @@ void CAIPPullData(); #define CA_COAP 5683 #define CA_SECURE_COAP 5684 -#define INTERFACE_NAME_MAX 16 - -typedef struct -{ - char name[INTERFACE_NAME_MAX]; - uint32_t index; - uint32_t flags; - uint16_t family; - char addr[MAX_ADDR_STR_SIZE_CA]; -} CAInterface_t; - - -/** - * Callback to be notified when IP adapter connection state changes. - * - * @param[in] adapter Transport adapter. - * @param[in] status Connection status either ::CA_INTERFACE_UP or ::CA_INTERFACE_DOWN. - * @see CAIPSetConnectionStateChangeCallback() for registration. - */ -typedef void (*CAIPConnectionStateChangeCallback)(CATransportAdapter_t adapter, CANetworkStatus_t status); - -/** - * Set callback for receiving local IP adapter connection status. - * - * @param[in] adapter Callback to be notified when IP adapter connection state changes. - */ -void CAIPSetConnectionStateChangeCallback(CAIPConnectionStateChangeCallback callback); - -/** - * Set callback for receiving local IP adapter connection status. - * - * @param[in] callback Callback to be notified when IP adapter connection state changes. - */ -void CAIPSetNetworkMonitorCallback(CAIPConnectionStateChangeCallback callback); - -/** - * Get a list of CAInterface_t items. - * - * @return List of CAInterface_t items. - */ -u_arraylist_t *CAIPGetInterfaceInformation(int desiredIndex); - -/** - * Find a new network interface. - * - * @return Description of interface (or NULL if no change) - */ -CAInterface_t *CAFindInterfaceChange(); /** * Let the network monitor update the polling interval. @@ -220,31 +173,37 @@ CAInterface_t *CAFindInterfaceChange(); int CAGetPollingInterval(int interval); /** - * Tell the IP server an interface has been added. + * Set callback for error handling. + * + * @param[in] errorHandleCallback callback to notify error to the ipadapter. */ -void CAWakeUpForChange(); +void CAIPSetErrorHandler(CAIPErrorHandleCallback errorHandleCallback); /** - * Start network monitor. + * Set udp multicast time to live value to control the scope of the multicasts. + * @param[in] ttl To be set to any value from 0 to 255. * - * @return ::CA_STATUS_OK or Appropriate error code. + * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h). */ -CAResult_t CAIPStartNetworkMonitor(); +CAResult_t CAIPSetMulticastTTL(size_t ttl); /** - * Stops network monitor. + * Get udp multicast time to live value. + * @param[out] ttl TTL pointer to get the stored multicast time to live. * - * @return ::CA_STATUS_OK or Appropriate error code. + * @return ::CA_STATUS_OK or ERROR CODES (::CAResult_t error codes in cacommon.h). */ -CAResult_t CAIPStopNetworkMonitor(); +CAResult_t CAIPGetMulticastTTL(size_t *ttl); /** - * Set callback for error handling. - * - * @param[in] errorHandleCallback callback to notify error to the ipadapter. + * Create multicast socket to receive multicast message from remote device. */ -void CAIPSetErrorHandler(CAIPErrorHandleCallback errorHandleCallback); +void CreateMulticastSocket(); +/** + * Close multicast socket to stop receiving multicast message. + */ +void CloseMulticastSocket(); #ifdef __cplusplus } #endif