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 all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
bluetooth Bluetooth: Simplify bt_gatt_notify_cb() API 2019-06-15 10:37:19 +03:00
cmsis_rtos_v1 all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
cmsis_rtos_v2 CMSIS RTOS V2: Introduce CMSIS RTOS V2 API header file 2018-12-20 12:23:22 +01:00
crypto all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
debug include: remove unused header file gdb_server.h 2019-01-22 07:45:22 -05:00
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 smp: shell: Add support for SMP in new shell. 2019-01-15 17:19:20 -05:00
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 fs/nvs: Improve init speed and remove fs->locked 2019-02-21 09:32:52 -05:00
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 jwt: Add JSON web token library 2019-02-08 15:32:58 -06:00
adc.h drivers: adc: add API to support calibration 2019-05-30 17:18:17 -04:00
aio_comparator.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
atomic.h include: Make statements evaluate boolean expressions 2019-03-26 14:31:29 -04:00
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 console: deprecate console_register_line_input() 2019-03-26 12:48:38 -05:00
counter.h drivers: counter: Add flags to counter_config_info structure 2019-05-27 09:18:34 -04:00
crc.h crc: Move crc7 into CRC single header 2018-12-30 16:24:10 -05:00
device.h linker generated list: explicit alignment on data definitions 2019-06-06 14:21:32 -07:00
disk_access.h
display.h drivers: display: Add RGB 565 pixel format to display api 2019-02-07 14:28:55 -06:00
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 all: Update reserved function names 2019-03-11 13:48:42 -04:00
fs.h fs: Added API to read mount point 2019-06-11 08:31:54 -04:00
generated_dts_board.h cmake: Fix the generation of fixup files 2019-01-28 12:18:38 -05:00
gna.h doc: regular misspelling scan 2018-12-26 13:27:14 -05:00
gpio.h include: Make statements evaluate boolean expressions 2019-03-26 14:31:29 -04:00
hwinfo.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
i2c.h all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
i2s.h include: Use macro BIT for shift operations 2019-03-26 14:31:29 -04:00
init.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
ipm.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
irq_nextlevel.h
irq_offload.h
irq.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
json.h json: make it 64-bit compatible 2019-06-05 07:47:41 -04:00
kernel_includes.h kernel/work_q: Spinlockify 2019-02-08 14:49:39 -05:00
kernel_version.h doc: add kernel version API to doxygen 2018-12-08 17:24:53 -05:00
kernel.h k_stack: make it 64-bit compatible 2019-06-14 05:46:29 -04:00
led_strip.h
led.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
pinmux.h C++: Fix compilation error "invalid conversion" 2019-05-03 14:27:07 -04:00
power.h all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
ptp_clock.h
pwm.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
ring_buffer.h ring_buffer: Add functions for getting capacity and reseting 2019-05-30 09:44:03 -04:00
rtc.h all: Add 'U' suffix when using unsigned variables 2019-03-28 17:15:58 -05:00
sched_priq.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
sensor.h include: added new sensor channel SENSOR_CHAN_GAS_RES 2019-05-31 10:27:13 -05:00
shared_irq.h
spi.h all: Update reserved function names 2019-03-11 13:48:42 -04:00
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 include: Use macro BIT for shift operations 2019-03-26 14:31:29 -04:00
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 syscall: Fix comment 2019-04-12 17:59:25 -04:00
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 doc: regular misspelling scan 2018-12-26 13:27:14 -05:00
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