68
68
#include "6LoWPAN/MAC/mac_data_poll.h"
69
69
#include "mlme.h"
70
70
71
- #ifdef HAVE_THREAD_ROUTER
71
+ #ifdef HAVE_THREAD
72
72
73
73
typedef struct scan_query {
74
74
int8_t coap_service_id ;
@@ -1134,6 +1134,7 @@ int thread_management_server_init(int8_t interface_id)
1134
1134
this -> announce_ptr = NULL ;
1135
1135
this -> external_commissioner_port = THREAD_COMMISSIONING_PORT ;
1136
1136
1137
+ #ifdef HAVE_THREAD_ROUTER
1137
1138
if (thread_border_router_init (this -> interface_id ) != 0 ) {
1138
1139
ns_dyn_mem_free (this );
1139
1140
return -5 ;
@@ -1143,19 +1144,20 @@ int thread_management_server_init(int8_t interface_id)
1143
1144
ns_dyn_mem_free (this );
1144
1145
return -5 ;
1145
1146
}
1146
-
1147
+ #endif
1147
1148
this -> coap_service_id = coap_service_initialize (this -> interface_id , THREAD_MANAGEMENT_PORT , COAP_SERVICE_OPTIONS_NONE , NULL , NULL );
1148
1149
if (this -> coap_service_id < 0 ) {
1149
1150
tr_warn ("Thread management init failed" );
1150
1151
ns_dyn_mem_free (this );
1151
1152
return -3 ;
1152
1153
}
1153
-
1154
+ #ifdef HAVE_THREAD_ROUTER
1154
1155
if (thread_leader_service_init (interface_id , this -> coap_service_id ) != 0 ) {
1155
1156
tr_warn ("Thread leader service init failed" );
1156
1157
ns_dyn_mem_free (this );
1157
1158
return -3 ;
1158
1159
}
1160
+ #endif
1159
1161
thread_extension_init (interface_id , this -> coap_service_id );
1160
1162
1161
1163
// All thread devices
@@ -1556,7 +1558,7 @@ int thread_management_server_tmf_get_request_handler(int8_t interface_id, int8_t
1556
1558
return ret_val ;
1557
1559
}
1558
1560
1559
- #else // HAVE_THREAD_ROUTER
1561
+ #else // HAVE_THREAD
1560
1562
1561
1563
int thread_management_server_init (int8_t interface_id )
1562
1564
{
@@ -1571,7 +1573,7 @@ void thread_management_server_delete(int8_t interface_id)
1571
1573
1572
1574
int thread_management_server_joiner_router_init (int8_t interface_id )
1573
1575
{
1574
- (void )interface_id ;
1576
+ (void )interface_id ;
1575
1577
return 0 ;
1576
1578
}
1577
1579
@@ -1601,4 +1603,4 @@ int thread_management_server_tmf_get_request_handler(int8_t interface_id, int8_t
1601
1603
(void )request_ptr ;
1602
1604
return -1 ;
1603
1605
}
1604
- #endif //HAVE_THREAD_ROUTER
1606
+ #endif //HAVE_THREAD
0 commit comments