Skip to content

Commit d400859

Browse files
author
Arto Kinnunen
authored
Fix Thread 1.1 unitests (ARMmbed#2145)
Adjust HAVE_THREAD_V2 flags to get Thread 1.1 unit tests working
1 parent 38978f3 commit d400859

File tree

8 files changed

+14
-5
lines changed

8 files changed

+14
-5
lines changed

source/6LoWPAN/Thread/thread_bootstrap.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ void thread_bootstrap_address_registration_timer(protocol_interface_info_entry_t
225225
#define thread_bootstrap_dua_address_generate(cur, domain_prefix, domain_prefix_len)
226226
#define thread_bootstrap_address_registration(interface, addr, child_mac64, refresh_child_entry, duplicate_child_detected)
227227
#define thread_bootstrap_child_address_registration_response_process(interface)
228-
229228
#define thread_bootstrap_address_registration_timer_set(interface, dua_delay_seconds, mlr_refresh_seconds)
230229
#define thread_bootstrap_address_registration_timer(interface, seconds)
231230

source/6LoWPAN/Thread/thread_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2271,6 +2271,6 @@ int thread_common_primary_bbr_get(struct protocol_interface_info_entry *cur, uin
22712271
return -1;
22722272
}
22732273

2274-
#endif
2274+
#endif // HAVE_THREAD_V2
22752275
#endif
22762276

test/nanostack/unittest/stub/thread_bbr_commercial_stub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
#include "NWK_INTERFACE/Include/protocol.h"
5757
#include "Common_Protocols/ipv6.h"
5858

59-
59+
#if defined(HAVE_THREAD_V2) && defined(HAVE_THREAD_BORDER_ROUTER)
6060
int8_t thread_bbr_commercial_init(int8_t interface_id, int8_t backbone_interface_id)
6161
{
6262
return 0;
@@ -109,3 +109,4 @@ void thread_bbr_commercial_mcast_fwd_check(int8_t interface_id, bool *multicast_
109109
{
110110
return;
111111
}
112+
#endif

test/nanostack/unittest/stub/thread_bootstrap_stub.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ int thread_bootstrap_network_data_activate(protocol_interface_info_entry_t *cur)
314314
{
315315
return 0;
316316
}
317+
#ifdef HAVE_THREAD_V2
317318
void thread_bootstrap_address_registration_init(void)
318319
{
319320
return;
@@ -350,4 +351,5 @@ void thread_bootstrap_address_registration_timer(protocol_interface_info_entry_t
350351
{
351352
return;
352353
}
354+
#endif
353355

test/nanostack/unittest/stub/thread_ccm_stub.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "6LoWPAN/Thread/thread_nvm_store.h"
4949
#include "6LoWPAN/Thread/thread_ccm.h"
5050

51+
#ifdef HAVE_THREAD_V2
5152
void thread_ccm_free(protocol_interface_info_entry_t *cur)
5253
{
5354
}
@@ -95,3 +96,4 @@ int thread_ccm_network_certificate_enable(protocol_interface_info_entry_t *cur,
9596
int thread_ccm_reenrollment_start(protocol_interface_info_entry_t *cur, int8_t service_id, uint8_t *pbbr_addr)
9697
{
9798
}
99+
#endif

test/nanostack/unittest/stub/thread_common_stub.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17+
1718
#include "nsconfig.h"
1819
#include <string.h>
1920
#include <ns_types.h>
@@ -421,6 +422,7 @@ bool thread_addresses_needs_to_be_registered(protocol_interface_info_entry_t *cu
421422
{
422423
return true;
423424
}
425+
#ifdef HAVE_THREAD_V2
424426
bool thread_common_ccm_enabled(protocol_interface_info_entry_t *cur)
425427
{
426428
return true;
@@ -429,3 +431,4 @@ int thread_common_primary_bbr_get(struct protocol_interface_info_entry *cur, uin
429431
{
430432
return true;
431433
}
434+
#endif

test/nanostack/unittest/stub/thread_management_client_stub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void thread_management_client_coap_message_delete(int8_t interface_id, uint16_t
119119
void thread_management_client_old_partition_data_clean(int8_t interface_id)
120120
{
121121
}
122-
122+
#ifdef HAVE_THREAD_V2
123123
void thread_management_client_addr_ntf_send(int8_t interface_id, uint8_t *destination_address, const uint8_t *addr_data_ptr, uint8_t bbr_status)
124124
{
125125
}
@@ -128,4 +128,5 @@ int thread_management_client_mlr_req_send(int8_t interface_id, const uint8_t br_
128128
{
129129
return 0;
130130
}
131+
#endif
131132

test/nanostack/unittest/stub/thread_management_server_stub.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ bool thread_management_server_source_address_check(int8_t interface_id, uint8_t
7777
{
7878
return false;
7979
}
80-
80+
#ifdef HAVE_THREAD_V2
8181
int thread_management_server_ccm_service_init(int8_t interface_id)
8282
{
8383
return 0;
8484
}
85+
#endif

0 commit comments

Comments
 (0)