zephyr/include
Laczen JMS 36edf92ca8 subsys/settings: change processing to const char
The settings module processes the variable name by splitting it up in
a set of variables. This PR removes the splitting up and keeps the
variable name as one string.

It is an alternative to #16609

The possibility is introduced to register handler including a
separator, or to register a handler for each variable.

The ability is introduced to load a subtree from flash or even to load
a single item.

Two ways to operate on variable and settings_handler names are provided:

settings_name_steq(const char *name, const char *key, const char **next)
which checks if name starts with key, returns 1/0 if it does/does not
the remaining part of name is in next.

settings_name_split(const char *name, char *argv, const char **next)
which splits up name in a part before "/"" that is found in argv and
the remaining part that is in next.

A mutex is added to make settings thread-safe

The settings_handlers list is stored in reverse alphabetical order, this
allows registration of e.g. bt and bt/mesh in separate handlers, the bt
handler itself should not contain any handling of bt/mesh.

A settings_deregister() method is added. Settings_handlers can now be
added/removed when required. This saves RAM when settings_handlers are
not needed.

Tests have been updated to reflect changes in the settings api.

Updates after meeting:
1. Removed settings_deregister

2. Changed settings_name_split() in settings_name_next:

int settings_name_next(const char *name, const char **next): returns
the number of characters before the first separator. This can then be
used to read the correct number of characters from name using strncpy
for processing.

3. New functional test added

Update in settings.h: settings_name_next() changed position -> index

Added some comments in settings.h (settings_name_steq())

Updated tests to reflect change to settings_name_next() and pointer
value comparison. The functional test can now also run on qemu_x86.

Corrected some documentation in header.

Changed registration of handlers to be non ordered.

Changed handler lookup to handle non ordered list of handlers, this
improves handler matching in case different length names are compared
and also makes it easier to add rom based handlers as they will not be
ordered.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-06-18 17:57:08 +02:00
..
app_memory kernel: app_memdomain: remove unused defines 2019-06-17 10:00:22 -07:00
arch arch/x86/Kconfig: remove CONFIG_CMOV 2019-06-14 05:49:13 -04:00
audio
bluetooth Bluetooth: Simplify bt_gatt_notify_cb() API 2019-06-15 10:37:19 +03:00
cmsis_rtos_v1
cmsis_rtos_v2
crypto
debug
dfu dfu: mcuboot: Added defines for upgrade request modes 2019-05-21 15:31:00 -04:00
display arch/x86: drivers/display: add framebuffer driver w/ multiboot support 2019-06-06 10:47:29 -07:00
drivers include/drivers/system_timer.h: Clean up docs 2019-06-17 20:32:50 -04:00
dt-bindings dts: bindings: usb: Add enum to maximum-speed property 2019-05-17 09:53:20 -05:00
fs
linker include: scripts: fix typos in priv_stacks.ld 2019-06-17 10:00:22 -07:00
logging logging: Add option to detect missed transient string duplication 2019-05-29 13:52:31 +02:00
mgmt
misc printk: make it 64-bit compatible 2019-06-17 10:28:44 -07:00
net net: sockets: can: Close the socket cleanly 2019-06-18 17:58:00 +03:00
nvs
posix PTHREAD_MUTEX_DEFINE(): don't store into the _k_mutex section 2019-06-04 09:24:08 -04:00
random
settings subsys/settings: change processing to const char 2019-06-18 17:57:08 +02:00
shell doc: fix doxygen comments with embedded reST 2019-06-10 18:16:12 -04:00
toolchain linker generated list: provide an iterator to simplify list access 2019-06-06 14:21:32 -07:00
usb usb: enforce byte alignment on USB records 2019-06-17 16:41:43 -04:00
zephyr
adc.h drivers: adc: add API to support calibration 2019-05-30 17:18:17 -04:00
aio_comparator.h
atomic.h
base64.h
cache.h
can.h drivers: can: Add loopback driver 2019-05-12 16:54:49 -04:00
clock_control.h C++: Fix compilation error "invalid conversion" 2019-05-03 14:27:07 -04:00
console.h
counter.h drivers: counter: Add flags to counter_config_info structure 2019-05-27 09:18:34 -04:00
crc.h
device.h linker generated list: explicit alignment on data definitions 2019-06-06 14:21:32 -07:00
disk_access.h
display.h
dma.h api: dma: add api to retrieve runtime status 2019-05-07 22:14:36 -04:00
entropy.h entropy: fix C++ compiler warnings 2019-05-21 08:26:12 -04:00
exc_handle.h
fcb.h
flash_map.h doc: Fix typos in flashmap.h 2019-05-28 12:27:43 -04:00
flash.h
fs.h fs: Added API to read mount point 2019-06-11 08:31:54 -04:00
generated_dts_board.h
gna.h
gpio.h
hwinfo.h
i2c.h
i2s.h
init.h
ipm.h
irq_nextlevel.h
irq_offload.h
irq.h
json.h json: make it 64-bit compatible 2019-06-05 07:47:41 -04:00
kernel_includes.h
kernel_version.h
kernel.h k_stack: make it 64-bit compatible 2019-06-14 05:46:29 -04:00
led_strip.h
led.h
pinmux.h C++: Fix compilation error "invalid conversion" 2019-05-03 14:27:07 -04:00
power.h
ptp_clock.h
pwm.h
ring_buffer.h ring_buffer: Add functions for getting capacity and reseting 2019-05-30 09:44:03 -04:00
rtc.h
sched_priq.h
sensor.h include: added new sensor channel SENSOR_CHAN_GAS_RES 2019-05-31 10:27:13 -05:00
shared_irq.h
spi.h
spinlock.h thread_cpu: make it 64-bit compatible 2019-05-30 09:42:23 -04:00
stats.h stats: changed API to use zephyr types 2019-05-01 10:33:17 -04:00
sw_isr_table.h
sys_clock.h kernel: timeout: add syscall for runtime clk freq 2019-05-22 23:33:55 +02:00
sys_io.h misc: memory address type conversions 2019-06-03 21:14:57 -04:00
syscall.h
toolchain.h toolchain: Define a HAS_BUILTIN(x) macro in toolchain.h. 2019-05-14 19:53:30 -05:00
tracing.h tracing: Fix checks of Kconfig options 2019-05-17 15:46:18 -07:00
tty.h
uart.h include/uart.h: Clarify async receive event length 2019-05-27 09:23:39 -04:00
updatehub.h lib: updatehub: Add UpdateHub.io support 2019-06-05 00:20:37 +02:00
watchdog.h include: Removing legacy left-overs in wdt.h API header 2019-06-17 16:45:27 -04:00
zephyr.h