As they are part of interrupt-driver API, they must be called from
an ISR. That means that calling it outside IST may not have a desired
effect, and vice-versa, not calling them from ISR can lead to issues.
The patch also eleborates/fixes description of uart_irq_rx_ready().
Jira: ZEP-2016
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
In console shell, add explicit, 'exit' command to leave the current
module. Currently this is being achieved by overloading select command
(without an argument).
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
64-bit types were not being handled properly and depending on the
calling convention could result in garbage values being printed.
We still truncate these to 32-bit values, the predominant use-case
is printing timestamp delta values which generally fit in a 32-bit
value. However we are no longer printing random stuff.
Test case for printk() updated appripriately to catch this regression.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This makes gatt-write-signed to reuse cmd_gatt_write_without_rsp since
it is quite similar and that adds the ability to send multiple octecs
instead of just a single byte.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This removes gatt-write-without-response-repeated and makes
gatt-write-without-response similar to gatt-write which was the
intention of gatt-write-without-response-repeated.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
All the files under shell subdir shall only be build if
CONFIG_BLUETOOTH_SHELL is selected.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
In order to properly queue request there need to be a bt_att_req
storage but none of the calls to gatt_write_ccc were using the params
causing gatt_send to use bt_att_send and not bt_att_req_send.
To fix this now all the callers of gatt_write_ccc do set the params
properly but this means that bt_gatt_unsubscribe has to wait for it
to be completed before the application can reuse the
bt_gatt_subscribe_params.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The code was so far requesting 5 ms refresh timer, however with a
default TICKS_PER_SECOND=100 this was always rounded up to 10 ms,
causing some flickering. The closest TICKS_PER_SECOND that will give
flicker-less display but also give optimal ms-to-ticks calculations is
250, so change the timer to match that. After this change any code
using the display is recommended to set 250 as ticks per second.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Print also network buffers that are allocated by the IPv6
fragment handler. This is very useful in debugging.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
These tests make sure that the IPv6 fragments are build correctly
when a large IPv6 packet is being sent.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the user really wants, it is possible to increase the
maximum size of the fragmented packet. According to RFC 2460
chapter 5, we do not need to accept larger than 1500 byte IPv6
packets, so the max pkt limit is set to 2. But if really needed
the limit can be raised by defining NET_IPV6_FRAGMENTS_MAX_PKT
to some new value. Currently there is no Kconfig option for
doing this as it is unlikely that this is needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The cancellation of reassembly did not work as expected because
K_WORK_INITIALIZER() did not setup the timeout function properly.
So do the timer initialization at runtime instead.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The IPv6 fragmentation was not working properly when the large
IPv6 packet was being sent. There is unit tests in next commit
that will test the IPv6 fragmentation sending.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the fragmented IPv6 packet was very large, we could run out
of resources. When that happened, we leaked the memory for the
pending fragments that were waiting reassembly.
Jira: ZEP-2166
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The previous default 60 seconds is way too long for our limited
amount of memory. It might be that the 5 sec is still too long
but that can be changed in the future.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
While returning 32-bit values from radio status interfaces,
explicitly compare radio h/w event registers to be non-zero,
dont just return the direct 32-bit h/w register content.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added extra assert checks to detect controller failure if
a role event preparation function was not followed by the
role event start function.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The state machine of the game assumes that the user needs to
explicitly re-select multiplayer game when disconnected. We need to
therefore make sure that advertising stays off as soon as the first
connection happens.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Occasionally the sound might stay enabled for the restart timeout (2
seconds) if the ball would hit the wall right before missing the
paddle. Ensure that it's disabled whenever the game ends.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Shell itself already have a help command, so instead of creating a net
specific help just fill the help description of each command.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Shell modules are registered at link time thus it makes no sense to
leave it behind net_shell_init.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
If the HTTPS connection is closed, then properly handle call to
HTTP parser init in case of error and also remove any pending
data that belong to old connection.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we receive unknown option in neighbor solicitation message,
then skip those properly. Old code did not check the length of
the extension options which could cause infinite loop.
Jira: ZEP-2174
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we could not split the packet properly, make sure that the
fragments that we managed to allocate are unreffed and marked
as NULL.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Print also the character when hexdumping a memory area.
This is useful so that one does not need to convert hex
values to characters in head. Unprintable chars are printed
as '.'
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This reverts commit 96def63f10.
This breaks building with xtools for some reason, removing for now while
we figure out what went wrong.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
For some write requests, such as CCC, the code doesn't use an ATT
request context but we still need to clear the request timeout when
the response comes. Move the k_delayed_work_cancel() call to the right
place and add some debug logs that helped pinpoint this issue.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Both scan on and scan passive performed passive scanning,
fixed scan on command to use active scanning.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The buttons on the microbit cause quite easily "ghost" key presses.
Add a simple filter that ignores button presses from the same button
that happen less than 100ms from each other.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The stuff that the GPIO button callback does (in particular the printk
calls) requires more stack space from the ISR stack. Increase it to 1k
from the default 640.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In commit c41d3edda when implementing the alternative
encryption setup implementation, the original fast
encryption setup implementation was broken. When host is
slow in responding to LTK request, the controller asserted
when fast encryption implementation is selected. This is
now fixed.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix the assert in the controller during connection setup
when peer does not support CSA#2 feature and free Rx buffer
queue does not have enough buffers to generate CSA event.
The assert was reproduced by turning on advertisement
indication and scan request notification features in the
controllers advanced features, and a peer that does not
support CSA#2 initiated a connection.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Since role support is fundamental to both the Host and the Controller,
move the role configuration options to the top-level file and rename
them to fit the GAP specification, avoiding confusion between GAP and LL
names.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Only include connection-related options when CONFIG_BLUETOOTH_CONN is
selected, since otherwise this can lead to inconsistencies between
features and supported commands.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This replaces the use of shell_register_prompt_handler with
SHELL_REGISTER_WITH_PROMPT which doesn't overwrite other modules
prompt.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This enables modules to define its own prompt handler instead of always
using the default_module_prompt.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>