Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

ns_conf.h File Reference

ns_conf.h File Reference

Nanostack configuration API. More...

Go to the source code of this file.

Functions

int ns_conf_gc_threshold_set (uint8_t percentage_high, uint8_t percentage_critical)
 Set threshold for memory garbage collection.
int ns_conf_packet_ingress_rate_limit_by_mem (uint8_t free_heap_percentage)
 Limit amount of incoming packets if system does not have enough free memory.

Detailed Description

Nanostack configuration API.

Definition in file ns_conf.h.


Function Documentation

int ns_conf_gc_threshold_set ( uint8_t  percentage_high,
uint8_t  percentage_critical 
)

Set threshold for memory garbage collection.

Nanostack heap usage is monitored in regular intervals. If too much memory has been used then garbage collection (GC) is triggered. GC has two adjustable thresholds: HIGH and CRITICAL. HIGH threshold is lower one and once exceeded a GC will try to release memory that is used for caching. When CRITTICAL threshold is exceeded them GC will try to release memory more aggressiveliy.

Nanostack memory monitoring can only work if memory statistics are enabled in nsdynmemLIB.

Parameters:
percentage_highPercentage of total heap when garbage collection is first time triggered
percentage_criticalPercentage of total heap when critical garbage collection is triggered
Returns:
0 in success, negative value in case of error.

Definition at line 25 of file ns_conf.c.

int ns_conf_packet_ingress_rate_limit_by_mem ( uint8_t  free_heap_percentage )

Limit amount of incoming packets if system does not have enough free memory.

Memory statistics must been initialized in nsdynmemLIB to get this feature working.

Parameters:
free_heap_percentagePercentage of free heap that must be available when packet arrives to MAC layer.
Returns:
0 in case of success, <0 otherwise.

Definition at line 30 of file ns_conf.c.