The BT code uses co-op thread priorities to implement some
critical sections. This won't work with SMP turned on.
Express this in our configuration ontology, so that it's
not possible for the end user to set up the system in this
way and get crashes or odd behavior.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This emulator supports enable functionality to start up the device and
read a few samples. It connects itself to any BMI160 device it finds in
the device tree. The SPI emulation controller driver is used to direct
SPI messages from the BMI160 driver to the BMI160 emulator.
Add a few more definitions to the header file, as needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a log message to indicate that a new emulator is attached. Also add
a message in the assert to make it clearer what has gone wrong.
Signed-off-by: Simon Glass <sjg@chromium.org>
This commit fixes PUSH FOTA when opaque content-format is used.
This consists of the following fixes:
* Moved `struct block_context` to a private header, so that it can be a
part of `struct lwm2m_input_context`. This allows content decoders to
make use of the block context data.
* Removed faulty `get_length_left` function from the plain text
decoder, and replace it with coap_packet_get_payload() to obtain the
actual payload size.
* Introduce `struct lwm2m_opaque_context` as a part of block context,
which allows to keep track of opaque data download progress.
* Simplify `lwm2m_write_handler_opaque()` function. It will now only
make calls to `engine_get_opaque` - it's the decoder responsibility
to update the opaque context according to it's content format (for
instance TLV decoder should only update it with the actual opaque
data size, not the whole TLV).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Added a check for adv->lll.aux before starting extended advertising to
fix observed NULL pointer dereference when updating AD data of legacy
advertising.
Fixes#28544.
Signed-off-by: Jordan Montgomery <montytyper@msn.com>
The L4 connected/disconnected events are usually used to detect
when the application is connected to the network. Unfortunately
if the device has also a static address, then the connected event
might be created (for the static address) even if DHCPv4 is not
ready yet and application would not be able to connect (yet) to the
network. In order to allow the application to fine tune the network
connection creation, generate start, bound and stop events for DHCPv4.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Avoid warning about uninitialized variable.
The for loop should do at least two iterations
in a valid execution, hence initialize to an
error value.
Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
The second argument of this foonction is a bool, so passing 0 and 1
is incorrect.
Coccinelle script:
@@
expression e;
@@
flash_write_protection_set(e,
(
- 0
+ false
|
- 1
+ true
)
)
Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
To get a list of all supported shell commands user must hit the TAB
button. It may be awkward on some terminal emulators. This change
enhances the help command in a way it will in addition print all
supported commands.
Fixes: #28785
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
Functions shell_help_subcmd_print and shell_help_cmd_print
are more generic. Now they can operate on command passed as an
argument not hard coded active_cmd.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
The "tc" field which was holding the traffic class thread
priority is not used nor needed so remove it from the struct
to save some space.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Changes the callbacks for periodic sync callbacks such that multiple
applications can register callbacks, similar to the connection and
scan callbacks.
This change will make it easier to support the PAST feature, as
PA syncs make be created by the controller which then notifies
the host, and thus the application (if callback registered).
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.
Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
Generates a warning message when building with
CONFIG_TEST_RANDOM_GENERATOR. The purpose is inform that this is not
secure and should not used in production.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Both operands of an operator in the arithmetic conversions
performed shall have the same essential type category.
Changes are related to converting the integer constants to the
unsigned integer constants
Signed-off-by: Aastha Grover <aastha.grover@intel.com>
The scan callbacks may be NULL, which would cause an error if
e.g. the timeout callback wasn't set and the scan terminates after
a timeout.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Using zephyr's internals zsock_ calls make mqtt library more compatible,
now it does not depend on NET_SOCKETS_POSIX_NAMES.
Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
Remove code and associated tests and Kconfig related to
SETTINGS_USE_BASE64 that was deprecated in Zephyr 2.2
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
No real need to assert when the send timer is cancelled. Just
check if there is re-transmission going on and do nothing if
there is not.
Fixes#28758
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The local and accepted socket was not bound which caused the
local address to be set as NULL. This then caused issues when
zsock_getsockname() was called by the application.
Fixes#28735
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fix conditional compilation to allow building test shell
with Periodic Advertising Sync alone.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix controller implementation to cancel peripheral latency
when initiating new control procedures.
Fixes#28699.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add checks to abort connection radio event preparation and
start, if the connection terminates with a race condition
with new radio event being prepared or being in prepare
pipeline.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Since the info parameter is only read from and never written the const
in the function parameter should be present.
Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
Fix undeclared CONFIG_BT_CTLR_DATA_LENGTH_MAX when Force
MD bit automatic feature is enabled in nRF51 Series.
Fixes#28774.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit adds additional Kconfigs that allow for changing
configuration values for the Zephyr port in OpenThread.
Those values are:
- number of the internal OT message buffers
- number of the state change callbacks
- number of the EID-to-RLOC cache entries
- size of the NCP buffer
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Instead of directly checking the multicast IPv4 address, use
the net_ipv4_is_addr_mcast() utility function.
Fixes#26584
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
MQTT client state is protected using mutex. That mutex however is
temporarily unlocked when calling event callbacks. This means that in
client_disconnect() transport can already be disconnected, but without
marking it as such in client->internal.state.
When mutex is unlocked in event_notify() function, then there are two
possible paths of failure:
1) First possibility is when RX and TX are called from two separate
threads, so that the other thread gets resumed and functions like
verify_tx_state() (e.g. in mqtt_publish()) allow to continue
communication over disconnected medium.
2) Another possibility is that user calls mqtt_abort() or
mqtt_disconnect() in event handler.
In both cases MQTT library tries to send or receive data, possibly
followed by second close() of underlying file descriptor.
Prevent using disconnected transport by clearing MQTT client state right
after calling mqtt_transport_disconnect(), without releasing mutex, even
for a while.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
When compiling with CONFIG_NET_NATIVE=n and CONFIG_NET_OFFLOAD=n
then the following error is printed.
```
In file included from zephyr/subsys/net/ip/ net_if.c:23:0:
zephyr/subsys/net/ip/net_private.h: In function 'net_context_state':
zephyr/subsys/net/ip/net_private.h:58:27:
error: type of 'context' defaults to 'int' [-Werror=implicit-int]
static inline const char *net_context_state(context)
```
This add `struct net_context *` as type for context.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Depending on the Bluetooth features enabled, the HCI
packets can be 264 Bytes long. For HCI over USB the HCI packet
is handled in data stage of USB transfer. Buffer for the data
stage was too short and USB driver was STALLing the data stage
making it unable to complete. Extend the data stage buffer
to 266 Bytes if HCI USB is selected and BT_RX_BUF_LEN > 127
indicating that longer HCI packets are needed.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
Remove obsolete include of the shell_uart.h file.
It is sufficient to include the shell.h file.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
Since commit b3a1ede830 OpenThread uses the Zepyhr settings submodule
instead of writing to the flash directly. The flash.c file is not
compiled anymore, so let's just remove it. Also remove the
OT_PLAT_FLASH_PAGES_COUNT Kconfig option which was solely used by that
file.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Added automatic runtime calculation of Forced MD bit count
based on incoming Tx buffer throughput.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add Force MD bit feature wherein connection events can be
extended to match the rate at which applications provide
new Tx data. MD bit in Tx PDUs is forced on if there has
been CONFIG_BT_CTLR_TX_BUFFERS count number times Tx/Rx
happened in a connection event. The assumption here is,
if controller's tx buffers are full, it is probable that
the application would send more Tx data during the
connection event, and keeping the connection event alive
will help improve overall throughput.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add force Md bit feature wherein connection events can be
extended to match the rate at which applications provide
new Tx data.
Fixes#27981.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the check that decides to close a connection event,
which was missing a check on MD bit being set for empty PDU
to be Tx-ed out.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Optimize the Tx PDU preparation, empty PDU only needs MD bit
to be modified, other fields be initialised only at power up.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix premature connection event close due to the new Tx
buffers not being de-multiplexed and routed to connection's
Lower Link Layer context when they arrive while being
inside the connection's radio event.
Also, fix master prepare to demux and enqueue two Tx buffers
so that MD bit can be set correctly.
Relates to #27981.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Refactor ull_conn_tx_ack function as it no longer needs to
return the connection context back to caller.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>