Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / resource / csdk / connectivity / lib / libcoap-4.1.1 / debug.c
index eedf247..df9ae7b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2010--2012 Olaf Bergmann <bergmann@tzi.org>
  *
  * This file is part of the CoAP library libcoap. Please see
- * README for terms of use. 
+ * README for terms of use.
  */
 
 #include "config.h"
@@ -81,12 +81,12 @@ print_timestamp(char *s, size_t len, coap_tick_t t)
 #ifndef NDEBUG
 
 #ifndef HAVE_STRNLEN
-/** 
- * A length-safe strlen() fake. 
- * 
+/**
+ * A length-safe strlen() fake.
+ *
  * @param s      The string to count characters != 0.
  * @param maxlen The maximum length of @p s.
- * 
+ *
  * @return The length of @p s.
  */
 static inline size_t
@@ -148,7 +148,11 @@ size_t coap_print_addr(const struct coap_address_t *addr, unsigned char *buf, si
 {
 #ifdef HAVE_ARPA_INET_H
     const void *addrptr = NULL;
+#if defined(__ANDROID__)
+    __uint16_t port;
+#else
     in_port_t port;
+#endif
     unsigned char *p = buf;
 
     switch (addr->addr.sa.sa_family)
@@ -341,6 +345,14 @@ coap_show_pdu(const coap_pdu_t *pdu)
 
 #endif /* NDEBUG */
 
+#ifdef WITH_ARDUINO
+void coap_log_impl(coap_log_t level, const char *format, ...)
+{
+    //TODO: Implement logging functionalities for Arduino
+}
+#endif
+
+#ifndef WITH_ARDUINO
 #ifndef WITH_CONTIKI
 void coap_log_impl(coap_log_t level, const char *format, ...)
 {
@@ -389,3 +401,4 @@ coap_log_impl(coap_log_t level, const char *format, ...)
     va_end(ap);
 }
 #endif /* WITH_CONTIKI */
+#endif