* @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.
uint32_t dataLength, CAResult_t result);
/**
- * Callback to be notified when exception occures on multicast/unicast server.
- * @param type Type of server(#CAAdapterServerType_t).
- * @pre Callback must be registered using CAIPSetExceptionCallback().
- */
-typedef void (*CAIPExceptionCallback)(CAAdapterServerType_t type);
-
-/**
* Start IP server.
*
* @param threadPool Thread pool for managing Unicast/Multicast server threads.
void CAIPSetPacketReceiveCallback(CAIPPacketReceivedCallback callback);
/**
- * Set this callback for receiving exception notifications.
- *
- * @param[in] callback Callback to be notified on exception on running servers.
- */
-void CAIPSetExceptionCallback(CAIPExceptionCallback callback);
-
-/**
* Set socket description for sending unicast UDP data.
* Once the Unicast server is started,
* the same socket descriptor is used for sending the Unicast UDP data.
#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;
- uint32_t ipv4addr; /**< used for IPv4 only. */
-} 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.
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] ipErrorCallback callback to notify error to the ipadapter.
+ * Create multicast socket to receive multicast message from remote device.
*/
-void CAIPSetErrorHandleCallback(CAIPErrorHandleCallback ipErrorCallback);
+void CreateMulticastSocket();
+/**
+ * Close multicast socket to stop receiving multicast message.
+ */
+void CloseMulticastSocket();
#ifdef __cplusplus
}
#endif