summaryrefslogtreecommitdiff
path: root/samples/net/coap_server/src/coap-server.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/net/coap_server/src/coap-server.c')
-rw-r--r--samples/net/coap_server/src/coap-server.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/samples/net/coap_server/src/coap-server.c b/samples/net/coap_server/src/coap-server.c
index f45bd7923..503d04f54 100644
--- a/samples/net/coap_server/src/coap-server.c
+++ b/samples/net/coap_server/src/coap-server.c
@@ -59,6 +59,10 @@ char fiberStack[STACKSIZE];
#include <net/tinydtls.h>
#endif
+#include <bluetooth/bluetooth.h>
+#include <ipsp/src/ipss.h>
+
+#if !defined(CONFIG_BLUETOOTH)
#if defined(CONFIG_NETWORKING_IPV6_NO_ND)
/* The peer is the client in our case. Just invent a mac
* address for it because lower parts of the stack cannot set it
@@ -70,6 +74,7 @@ static uint8_t peer_mac[] = { 0x15, 0x0a, 0xbe, 0xef, 0xf0, 0x0d };
/* This is my mac address
*/
static uint8_t my_mac[] = { 0x0a, 0xbe, 0xef, 0x15, 0xf0, 0x0d };
+#endif
#if defined(CONFIG_NETWORKING_WITH_IPV6)
#if 0
@@ -107,6 +112,7 @@ static inline void init_app(void)
{
PRINT("%s: run coap server\n", __func__);
+#if !defined(CONFIG_BLUETOOTH)
net_set_mac(my_mac, sizeof(my_mac));
#if defined(CONFIG_NETWORKING_WITH_IPV4)
@@ -140,6 +146,7 @@ static inline void init_app(void)
uip_ds6_addr_add(addr, 0, ADDR_MANUAL);
}
#endif
+#endif
}
#if defined(DTLS_PSK)
@@ -303,6 +310,15 @@ void startup(void)
init_app();
+#if defined(CONFIG_NETWORKING_WITH_BT)
+ if (bt_enable(NULL)) {
+ PRINT("Bluetooth init failed\n");
+ return;
+ }
+ ipss_init();
+ ipss_advertise();
+#endif
+
/* Activate the application-specific resources. */
rest_activate_resource(&res_plugtest_test, "test");
rest_activate_resource(&res_plugtest_longpath, "seg1/seg2/seg3");