Skip to content

Commit 10e51a4

Browse files
author
Arto Kinnunen
committed
API for changing Thread SED parent buffer size
Application need to control number of packets a SED parent can store. The new API allows application to set values for: -number of small packets saved for each child -total number of big packets saved to parent
1 parent 6122d24 commit 10e51a4

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

nanostack/thread_management_if.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,20 @@ int thread_management_network_certificate_set(int8_t interface_id, const unsigne
426426
*/
427427
int thread_management_partition_weighting_set(int8_t interface_id, uint8_t partition_weighting);
428428

429+
/**
430+
* Set Thread Sleepy End Device parent packet buffer size.
431+
*
432+
* This function can be used to adjust count of packets SED parent is storing.
433+
*
434+
* \param interface_id Network interface ID.
435+
* \param small_packets_per_child_count Number of small packets parent is storing for each SED.
436+
* \param big_packets_total_count Number of big packets parent can store for all SEDs.
437+
*
438+
* \return 0, OK.
439+
* \return <0 fail.
440+
*/
441+
int thread_management_sed_parent_buffer_size_set(int8_t interface_id, uint16_t small_packets_per_child_count, uint16_t big_packets_total_count);
442+
429443
#ifdef __cplusplus
430444
}
431445
#endif

source/6LoWPAN/Thread/thread_management_if.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,3 +1452,27 @@ int thread_management_partition_weighting_set(int8_t interface_id, uint8_t parti
14521452
return -1;
14531453
#endif
14541454
}
1455+
1456+
int thread_management_sed_parent_buffer_size_set(int8_t interface_id, uint16_t small_packets_per_child_count, uint16_t big_packets_total_count)
1457+
{
1458+
(void) interface_id;
1459+
(void) small_packets_per_child_count;
1460+
(void) big_packets_total_count;
1461+
#ifdef HAVE_THREAD
1462+
protocol_interface_info_entry_t *cur;
1463+
1464+
cur = protocol_stack_interface_info_get_by_id(interface_id);
1465+
if (!cur || !cur->thread_info) {
1466+
tr_debug("Invalid interface id");
1467+
return -1;
1468+
}
1469+
1470+
return lowpan_adaptation_indirect_queue_params_set(cur,
1471+
THREAD_INDIRECT_BIG_PACKET_THRESHOLD,
1472+
big_packets_total_count,
1473+
small_packets_per_child_count);
1474+
1475+
#else
1476+
return -1;
1477+
#endif
1478+
}

0 commit comments

Comments
 (0)