There have been to problems with the code where zcbor_bool_encode
has been fed value instead of expected pointer and the result
of previous zcbor_encode operations has not been taken to evaluate
value of ok status.
The change also replaces usage of #if IS_ENABLED with #ifdef, as
IS_ENABLED should not be used outside if().
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
In situations, where the address, the port and the auth token of the
hawkbit server are not known during build, it should be possible to set
it during runtime.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
In hawkbit there are currently a lot of values send to the server, that
are not required or even optional. This commit corrects that.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
`setsockopt` is enabled by `CONFIG_POSIX_API`, use
`zsock_setsockopt` instead, otherwise there will be a
compilation error if `CONFIG_NET_SOCKETS_SOCKOPT_TLS` is
enabled.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
remove unnecessary condition for CONFIG_HAWKBIT_POLL_INTERVAL,
changes poll_sleep to be in seconds,
change type of sleep_time in hawkbit_update_sleep(), so the return
value of hawkbit_time2sec() is interpreted correctly.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Change 'Hawkbit' and 'hawkbit' to 'hawkBit' wherever
makes sense, and a bit of touch ups here and there.
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
The library should be using internal socket API functions
so that we do not need to depend on POSIX_API.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
remove hb_context.status_buffer_size and replace it with
sizeof(hb_context.status_buffer), because hb_context.status_buffer_size
is never set.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
Added the CONFIG_MCUMGR_TRANSPORT_BT_DYNAMIC_SVC_REGISTRATION Kconfig
option to manage how the SMP service should be registered.
By default the SMP service must be registered at runtime.
If this Kconfig option is disabled, the SMP service is statically
defined and registered.
This change allows to opt out of using the CONFIG_BT_GATT_DYNAMIC_DB
Kconfig option and as a result, lower the memory usage.
Signed-off-by: Mateusz Kapala <mateusz.kapala@nordicsemi.no>
A lot of the log messages are using highest level, optimize
them to recycle as much messages as possible.
When building the sample with `CONFIG_HAWKBIT_LOG_LEVEL_DBG`
on `frdm_k64f`, the FLASH size is reduced from 150860 B to
150048 B, saving ~800 bytes.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Introduce a current state of Host Command subsystem.
It makes sures that a backend has been initilized and doesn't allow
sending a response twice. There is a possibility, that a command handler
that calls ec_host_cmd_send_response function returns anyway (which is a
mistake).
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Add the ec_host_cmd_send_in_progress_continue function which allows
continuing execution of a handler, while the ec_host_cmd thread is not
blocked and new commands can be handled.
That means some long command handlers can executed in the background
while the Host Command subsys is not frozen.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Adds an optional feature that can be used to reduce the maximum
allowed image upload file size whereby an image could be uploaded
that would be too large to swap even if it could fit the partition
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
There is a possibility that the SPI STM32 Host Command backend is being
suspended, without earlier initialization.
Make sure we are not accessing uninitialized pointer, namely the cs
structure.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
Fixes an issue whereby a message which is too large was attempted
to be sent via the UDP transport would wrongly give an error in
value error
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The SPI STM32 Host Command backend doesn't use general SPI driver, so it
has to implement Power Management on its own.
The suspend procedure includes: setting pins to the sleep state,
disabling device clock and disabling CS pin interrupt.
Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
There are several subsystems and boards which require a relatively large
system heap (used by k_malloc()) to function properly. This became even
more notable with the recent introduction of the ACPICA library, which
causes ACPI-using boards to require a system heap of up to several
megabytes in size.
Until now, subsystems and boards have tried to solve this by having
Kconfig overlays which modify the default value of HEAP_MEM_POOL_SIZE.
This works ok, except when applications start explicitly setting values
in their prj.conf files:
$ git grep CONFIG_HEAP_MEM_POOL_SIZE= tests samples|wc -l
157
The vast majority of values set by current sample or test applications
is much too small for subsystems like ACPI, which results in the
application not being able to run on such boards.
To solve this situation, we introduce support for subsystems to specify
their own custom system heap size requirement. Subsystems do
this by defining Kconfig options with the prefix HEAP_MEM_POOL_ADD_SIZE_.
The final value of the system heap is the sum of the custom
minimum requirements, or the value existing HEAP_MEM_POOL_SIZE option,
whichever is greater.
We also introduce a new HEAP_MEM_POOL_IGNORE_MIN Kconfig option which
applications can use to force a lower value than what subsystems have
specficied, however this behavior is disabled by default.
Whenever the minimum is greater than the requested value a CMake warning
will be issued in the build output.
This patch ends up modifying several places outside of kernel code,
since the presence of the system heap is no longer detected using a
non-zero CONFIG_HEAP_MEM_POOL_SIZE value, rather it's now detected using
a new K_HEAP_MEM_POOL_SIZE value that's evaluated at build.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The implementation waited for a NET_EVENT_L4_CONNECTED event to be
emitted. However we can start the receiving thread in case the interface
is up.
This allows for IPv6 Link Local addresses to be used with mcumgr.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Not clearing that lock lead to the fs_mgmt commands being useless, after
the mgmt callback returned `MGMT_CB_ERROR_RC` once, since the lock is now
occupied and never cleared.
Fixes#66581
Signed-off-by: Ruben Völl <ruben.voell@grandcentrix.net>
Use a flag in `c:struct:mgmt_handler` to skip the cbor start and end byte,
and instead use pure custom user defined payload.
Signed-off-by: Kuno Heltborg <kunoh@live.dk>
The 2 issues were found after CONFIG_OSDP_SC_ENABLED was enabled:
- missing curly brace after if
- typo in type name
Signed-off-by: Arkadiusz Wadowski <wadowski.arkadiusz@gmail.com>
Add const prefix for service uuid and char uuid.
Since Service UUID and Char UUID should not change in the service
definition, they are most reasonably defined as rodata, also for
save some ram footprint.
The field `attr->user_data` type is `void *`, as this PR change
all Service UUID to rodata, so there must add (void *) to avoid warning.
Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
slab_buff size is calculated based on size of osdp_ephemeral_data union
so it is safer to use same structure for slab init.
Changes in osdp_event or osd_cmd structures can cause crashes without this.
Signed-off-by: Arkadiusz Wadowski <wadowski.arkadiusz@gmail.com>
The original SHI module only has one output FIFO buffer. It costs a lot
when the driver has to send/change the protocol control code because it
must fill out all 128 bytes of output FIFO. In npcx4, we introduce
another output buffer in 1-byte depth. These two buffers can switch back
and forth during the transaction. We can use the single-byte buffer
to send the control code and the 128-byte FIFO to send the data payload.
It helps improve the SHI driver's efficiency.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Implement the pm_policy lock to prevent the chip enters the deep slepp
mode while shi transaction is ongoing.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>