File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
source/Service_Libs/utils Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,14 @@ extern "C" {
46
46
*/
47
47
int ns_conf_gc_threshold_set (uint8_t percentage_high , uint8_t percentage_critical );
48
48
49
+ /**
50
+ * \brief Limit amount of incoming packets if system does not have enough free memory.
51
+ * Memory statistics must been initialized in nsdynmemLIB to get this feature working.
52
+ *
53
+ * \param free_heap_percentage Percentage of free heap that must be available when packet arrives to MAC layer.
54
+ * \return 0 in case of success, <0 otherwise.
55
+ */
56
+ int ns_conf_packet_ingress_rate_limit_by_mem (uint8_t free_heap_percentage );
49
57
50
58
#ifdef __cplusplus
51
59
}
Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
+ #include "nsconfig.h"
18
19
#include "ns_types.h"
19
20
20
21
#include "Core/include/ns_monitor.h"
22
+ #include "mac_api.h" // for mcps_packet_ingress_rate_limit_by_memory
23
+ #include "MAC/IEEE802_15_4/mac_mcps_sap.h" // for mcps_packet_ingress_rate_limit_by_memory
21
24
22
25
int ns_conf_gc_threshold_set (uint8_t percentage_high , uint8_t percentage_critical )
23
26
{
24
27
return ns_monitor_heap_gc_threshold_set (percentage_high , percentage_critical );
25
28
}
29
+
30
+ int ns_conf_packet_ingress_rate_limit_by_mem (uint8_t free_heap_percentage )
31
+ {
32
+ return mcps_packet_ingress_rate_limit_by_memory (free_heap_percentage );
33
+ }
You can’t perform that action at this time.
0 commit comments