We have dependency on this module in code which is part of Zephyr. When
this module is split out of the tree we need to be able to build. Move
this Kconfig part to be part of zephyr and keep the external code in
ext/ with plan to split it out on the future.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
OpenThread commissioner feature has extra stack requirements, hence
increase it in this configuration.
Fixes#12455
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
1. Update shell documentation according to proposals in
PR #12437 (Extend shell meta keys).
2. Fix lines exceeding 80 characters limit.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
15.4 MHR is no longer set in net_buf pointed by net_pkt, but in a
separate net_buf, hence we need to check that net_buf now to
determine if we need to wait for ACK or not.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Two issues identified with 6lo fragmentation for ieee802154 that broke
the communication:
1) ieee802154_fragment_is_needed function did not take 15.4 FCS size
into account, hence taking wrong decision in some cases.
2) set_up_frag_hdr was writing with wrong offset, which resulted in 6lo
bytes being overwritten by 15.4 header.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This adds write-without-response-cb command which can be used to
confirm the transmission of the PDU using bt_gatt_write_without_rsp_cb.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds bt_gatt_write_response_cb works similarly to
bt_gatt_notify_cb which can take a callback to be called when the PDU
is considered transmitted over the air.
Note: This can also be used to disable the ATT flow control which would
blocks sending multiple commands without wainting their transmissions.
Fixes#11558
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Legacy shell removed in order to avoid maintaining two shells
systems.
All examples and tests have been migrated to the new shell.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
This patch enables the support for FLASH_PAGE_LAYOUT and
FLASH_MAP for the generic spin nor flash driver.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Each time a successfully TCP connection is done, the number of dropped
TCP packets increases by 2. This is happens because when receiving an
initial SYN packet, or an ACK packet following a SYN+ACK packet,
NET_DROP is returned even if there is no error.
Fix that by replacing the two corresponding "return NET_DROP" by
"net_pkt_unref(pkt)" followed by "return 0".
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit renames the nrf5_clock_control.h and
nrf5_clock_control.c files to nrf_clock_control.h and
nrf_clock_control.c, respectively, as they are used
in nRF9160 builds, as well.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit renames the CLOCK_CONTROL_NRF5 Kconfig symbol to
CLOCK_CONTROL_NRF. The change is required to aleviates confusion
when selecting the symbol in nRF9160 SOC definition.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The current stack consumption with the H4 driver on qemu_x86 is as
follows with a change from 256 to 512:
usage 396 / 512 (77 %)
Increase the default for this configuration, as well as other similar
configurations. Set the fallback default to a higher value as well.
Fixes#12429
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Added following meta-keys:
Ctrl-B - moves the cursor backward one character
Ctrl-D - deletes the character under the cursor
Ctrl-F - moves the cursor forward one character
Ctrl-K - deletes from the cursor to the end of the line
Alt-F - moves the cursor forward one word
Alt-B - moves the cursor backward one word
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
The msg->prev_addr is already stored in frnd->clear.frnd, so there's
no need to have an extra stack variable for this (in the form of
prev_addr).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Use fixed-width type instead of enum for field op in struct
ticker_user_op to avoid struct layout differences between
compilers. Also make check whether struct sizes match size definitions
build-time asserts.
Signed-off-by: Wolfgang Puffitsch <wopu@oticon.com>
Since `str` is the output buffer, `bt_hex_real` should limit its output
length according to the `str` size, not the `hex` size.
Signed-off-by: Jiahao Li <reg@ljh.me>
net_buf_linearize() used to clear the contents of output buffer,
just to fill it with data as the next step. The only effect that
would have is if less data was written to the output buffer. But
it's not reliable for a caller to rely on net_buf_linearize() for
that, instead callers should take care to handle any conditions
like that themselves. For example, a caller which wants to process
the data as zero-terminated string, must reserve a byte for it
in the output buffer explicitly (and set it to zero).
The only in-tree user which relied on clearing output buffer was
wncm14a2a.c. But either had buffer sizes calculated very precisely
to always accommodate extra trailing zero byte (without providing
code comments about this), or arguably could suffer from buffer
overruns (at least if data received from a modem was invalid and
filled up all destination buffer, leaving no space for trailing
zero).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Currently, when handling a Friend Request message with `prev_addr` set,
we look up existing friend entry using `prev_addr` as the address.
However, `prev_addr` is the address of the requesting node's previous
friend, NOT the address of the requesting node itself. Therefore, we
should always look up existing friend entry using `rx->ctx.addr` as the
address.
Signed-off-by: Jiahao Li <reg@ljh.me>
Connecting to a non-open port causes connect() to hang forever.
This patch releases connect() to return error to the caller.
Signed-off-by: Björn Stenberg <bjorn@haxx.se>
Adds documentation-commentary to some infrastructure used by the LL.
It is a long-term effort to better document the LL.
Notably ticker and mayfly require more documentation; this will be
done later.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
It may happen that panic occured while logger backend
was formatting output data. In that case output buffer
could get corrupted as logger assumes that processing
happens in one context only (panic is the only exception).
Added log output buffer flushing on entering panic state.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit adds Serial Wire Output (SWO) logger backend. SWO is an
extension of Serial Wire Debug (SWD) port developed by ARM.
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
The IRQ callback function of the USB CDC ACM driver can currently be
called from:
- the USB thread when a bulk in or a bulk out interrupt has been
triggered
- the thread calling cdc_acm_irq_rx_enable or cdc_acm_irq_tx_enable when
enabling the interrupt fires an irq (ie if there is data to read or if
there is no pending data to send)
This causes some issues with at least the shell uart backend, as the
IRQ callback function ends up being called twice concurrently in case a
USB driver sends the requested data almost instantaneously. This is the
case for example of the USB nRF driver which uses DMA. In turn this
cause ring_buf_item_get to be called concurrently, leading to data
corruption:
uart:~$ help
Please press the <Tab> button to see all available commandands.
You can also use the e <Tab> button to prompt or auto-coomplelete all
commands or its subcommands.
You can try toto call commands with <-h> or <--help> parameter for
more informatation.
uart:~$
Fix that by always calling the IRQ callback function through the system
work queue.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
While base64 encoding was enabled settings_val_get_len_cb() returned
encoded length instead of decoded value length.
This patches introduce procedure which calculates the value length
properly. For that additional read of the end of the encoded value is
required for checking how many form last 3 value bytes wear encoded.
fixes#12122
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Accepting broadcast echo request and replying to it could provide an
attack vector.
Fixes#12162
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Do not extra ref and then obscurely unref the packet inside
the statistics update function.
Actually, this extra ref/unref isn't needed here at all.
The packet is unreferenced only on a successful send, statistics
updating can be done before the unref in a clean and understandable way.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Try to catch the original caller of setup_gptp_frame() function
in order to see who is allocating buffers.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The NET_LOG_LEVEL is enabled also when allocation debugging is
enabled but when net_pkt debugging is not. Thus we need to use
the CONFIG_NET_PKT_LOG_LEVEL when printing normal debug log
prints.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
net_frag_linearize() is just a wrapper for net_buf_linearize(). As
the latter was refactored to never return error, and instead just
return actual copied length, update the former and its usages too.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Don't try to find "errors" in the values of dst_len and len params
passed to net_buf_linearize(). Instead, do what entails with the
common sense from the values passed in, specifically:
1. Never read more than dst_len (or it would lead to buffer
overflow).
2. It's absolutely ok to read than specified by "len" param, that's
why this function returns number of bytes read in the first place.
The motivation for this change is that it's not useful with its
current behavior. For example, a number of Ethernet drivers linearize
a packet to send, but each does it with its own duplicated adhoc
routine, because net_buf_linearize() would just return error for the
natural use of:
net_buf_linearize(buf, sizeof(buf), pkt->frags, 0, sizeof(buf));
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
No declar 'count',Enable CONFIG_NET_DEBUG_HTTP_CONN will build error.
Using http_monitor_count replace count.
Fixed#12329
Signed-off-by: Frank Li <lgl88911@163.com>
shell_fprintf() doesn't work in callback handlers.
To fix that, set shell state to SHELL_STATE_COMMAND before using it.
Fixed: #12347
Signed-off-by: Frank Li <lgl88911@163.com>
Changes to Bluetooth shell application related to the
controller split architecture preparation.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Preparation to introduce the Upper Link Layer (ULL) and
Lower Link Layer (LLL) split architecture.
- Move SoC dependent HAL to vendor specific folder.
- Preparation to split data structures into ULL and LLL
types.
- Added more role and state conditional compilations.
- Added some work-in-progress implementation of advertising
extensions, will be used as inspiration in the new split
architecture work.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This fixes usage of an uninitialized variable (to_store) as introduced
by commit bfad2a0.
Fixes#12314
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>