#ifndef CA_ADAPTER_UTILS_H_
#define CA_ADAPTER_UTILS_H_
+#include "iotivity_config.h"
+
#include <stdbool.h>
#ifdef __ANDROID__
#include <jni.h>
#endif
-#ifndef WITH_ARDUINO
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+#if defined(HAVE_WINSOCK2_H) && defined(HAVE_WS2TCPIP_H)
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include "cacommon.h"
#include "logger.h"
-#include "pdu.h"
+#include <coap/pdu.h>
#include "uarraylist.h"
#include "cacommonutil.h"
const char* methodFormat);
/**
+ * check JNI exception occurrence
+ * @param[in] env JNI interface pointer.
+ * @return true(occurrence) or false(no occurrence).
+ */
+bool CACheckJNIException(JNIEnv *env);
+
+/**
* To Delete other Global References
* Called during CATerminate to remove global references
*/
#endif
+#ifndef WITH_ARDUINO
+/**
+ * print send state in the adapter.
+ * @param[in] adapter transport adapter type.
+ * @param[in] addr remote address.
+ * @param[in] port port.
+ * @param[in] sentLen sent data length.
+ * @param[in] isSuccess sent state.
+ * @param[in] message detailed message.
+ */
+void CALogSendStateInfo(CATransportAdapter_t adapter,
+ const char *addr, uint16_t port, ssize_t sentLen,
+ bool isSuccess, const char* message);
+
+/**
+ * print adapter state in the adapter.
+ * @param[in] adapter transport adapter type.
+ * @param[in] state adapter state.
+ */
+void CALogAdapterStateInfo(CATransportAdapter_t adapter, CANetworkStatus_t state);
+
+/**
+ * print adapter type name in the adapter.
+ * @param[in] adapter transport adapter type.
+ */
+void CALogAdapterTypeInfo(CATransportAdapter_t adapter);
+#endif
+
#ifdef __cplusplus
} /* extern "C" */
#endif