Endianness bug fix in bt_uuid_create function.
Replaced bt_uuid_create_le with bt_uuid_create which
handles both UUID from air and internal varaiable.
Fixed bug with endianess in case of big endian targets.
Signed-off-by: Akshatha Harishchandra <akhr@oticon.com>
The LwM2M implementation for DNS resolving has checks which
configure hints based on whether IPv4 or IPv6 are enabled.
Neither of them need enabled if using NET_SOCKETS_OFFLOAD,
which then causes an error to be returned to due to
"hints.ai_family" not being set.
Also the offload API need to know when to free the allocated
"struct addrinfo" instead of calling free() generically,
thus let's use the freeaddrinfo() API for sockets which will
call into the offload API if needed.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/18765
Signed-off-by: Jun Qing Zou <jun.qing.zou@nordicsemi.no>
When an opcode doesn't have a handle that doesn't mean it is unknown
just that it will not be handle as it could have been disabled.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
SMP shall be considered internal TX notify callbacks so they are
allowed to be run from TX thread context like the others.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When CONFIG_BT_GATT_CLIENT is not set att_op_get_type would return
unkown operation instead of properly return the opcode.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Since bt_l2cap_create_pdu can return NULL when used under syswq context
the code should always check its result, this also changes the timeout
to have a specific value (RTX maximum timeout) so signalling PDUs still
wait for a buffer to become available.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
In certain cases there could be no buffer available which may lead to
NULL being returned by bt_l2cap_create_pdu so instead use
bt_l2cap_create_pdu_timeout to wait with a specific timeout.
Note that this should also ensure the SMP will not be waiting for a
buffer when the remote might have timed out already.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds bt_conn_create_pdu_timeout function which can be used
to provide a timeout when allocating a buffer.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Add a summary of 2.0 doc changes, and fix a misspelling.
Also, add the 2.0 release notes to the index page.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
This file was added after the mass status 'ok'->'okay' rename. This
rectifies the situation, in particular as 'ok' is not ok anymore.
Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
With CONFIG_POSIX_API enabled, these samples now build under Zephyr
with exactly the same source as e.g. Linux (or in general, other POSIX
systems). However, building without CONFIG_POSIX_API (i.e. with
CONFIG_NET_SOCKETS_POSIX_NAMES aux option) is retained for now.
Add testcase definitions to build these samples with CONFIG_POSIX_API
in CI.
Fixes: #17353
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Add a simple diagram on the device driver model.
Instead of saying "this device driver", spell out that the note
is for the random number generator driver, as the visual
presentation does not have clear distinction.
Also update some formatting.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add 'Shield' to the header to help distinguish the FRDM-KW41Z general
board docs from the shield docs.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
When the firmware_pull mechansim sends the callback to notify the
sample of a new firmware block, the user supplied buffer can be
smaller than the CoAP BLOCK_SIZE setting. To handle this case,
we loop through the payload and fill the user supplied buffer with
smaller chunks.
Unfortunately, the last_block calculation is done outside this loop
which causes several callbacks (while in this loop) to have
last_block true. Let's fix this by adding a small check to make
sure we're at the end of the current payload block before notifying
the user of a last_block.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16158
Signed-off-by: Michael Scott <mike@foundries.io>
If mDNS is enabled, then do the mDNS query always. Earlier we did
the query after we had received response to the normal DNS query.
Also there is no need to print DNS id for mDNS queries as the id
is always 0.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The mDNS packet receive had issues:
* The DNS id needs to be 0 for both sending and receiving, we did
not accepted 0 incoming id.
* The mDNS response does not have any questions in it so we just
need to skip the question count checks in response.
* Skip the Cache-Flush bit in Class field so that we can properly
parse CLASS_IN value.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In DNS server init, print information whether the DNS server
is mDNS or LLMNR one. This way we do not need to remember what
IP addresses are used either of them.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The source UDP port in all Multicast DNS responses MUST be 5353
as described in RFC 6762 chapter 6.
Fixes#18732
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Increase the length of the request buffer.
Current value is not enough for an average
device descriptor.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Mitigate the check of the request buffer length because
the host may not know the real length for some responds.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
this case isn't designed for SMP, setting CONFIG_MP_NUM_CPUS=1 to
run the full SMP kernel config, but with only one CPU available.
Fixes: #12478.
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
The MSI PLL mode has been disabled but can be used since LSE is
populated on disco_l475_iot1 board. This is requested to enable
USB device controller support.
Fixes#18717
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
If a stack is declared with K_THREAD_STACK_EXTERN first, analyze array
in elf_helper.py will ignore this declaration which will be referenced
by the actual instances via the tag DW_AT_specification, so that this
stack can't be detected by the kernel object detection mechanism, and
this will cause userspace not work.
Fixes: #16760.
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
As we have re-worked the test code, and the test-case can run
on Cortex-M platforms on any available and implemented NVIC
IRQ lines, we do not need to exclude these ARM boards anymore.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit re-works the test for the ARM architecture,
so that it can work with any available NVIC IRQ, not
bound to use the last 2 NVIC lines. It makes use of
the dynamic IRQ feature.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit makes it possible to infer Z_ARCH_EXCEPT()
calls in SVCs that escalate to HardFault due to being
invoked from priority level equal or higher to the
interrupt priority level of the SVC Handler.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
West v0.6.1 has been released. The main feature is that "west update"
now avoids communicating with the network by default when project
revisions have already been fetched.
This allows for offline operation and significantly speeds up the
command (it's 10 times faster on my machine and home network).
There are other miscellaneous changes as well; document them also.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
The ARM embedded toolchain has 2 newlib based libc build variants, one
that utilizes the "nano" configuration which is more in line with the
Zephyr SDK. Make the "nano" cfg the default if newlib is enabled to
match closer how the Zephyr SDK behaves.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Error checking was missing following call to
counter_set_channel_alarm.
This was reported in coverity report 203523.
Fixes#18374
Additionally remove unneeded err initialization in main function
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Make sure we use the IPv4 event command when checking IPv4 address
add or delete instead of event mask.
Coverity-CID: 203483
Fixes#18400
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Configure pins before enabling and after disabling UARTE through
power management functions.
Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
Fix reset of Encryption Procedure state on reception of
REJECT_IND and REJECT_EXT_IND.
This is a regression in commit 79cb615770 ("Bluetooth:
controller: split: Port Enc setup to be queueable")
Relates to #18578.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
commit 780324b8ed ("cleanup: rename fiber/task -> thread")
seems to be done by a script and in that particular case turned
menaingful sentence into nonsense. Alas, threads might be in all
four states.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Anas Nashif <anas.nashif@intel.com>
We manage IRQs in a quite a different way now since
commit f8d061faf7 ("arch: arc: add nested interrupt support")
so that comment not only makes no sense but also may fool a reader
as disabling of interrupts happens in the very beginning of
_rirq_exit() but not here.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
When val1 is 0, we need to handle a negative val2 value so that we
generate correct TLV value.
Example: val1 = 0, val2 = -500000 is equivalent to -0.5 decimal.
Currently we generate: 0.5 (losing the sign).
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16154
Signed-off-by: Michael Scott <mike@foundries.io>
Current JSON formatting for float32/64 is broken in a similar way as
plain text. Let's use the newly fixed logic for plain text to
generate the float32/64 values in the JSON string.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16154
Signed-off-by: Michael Scott <mike@foundries.io>
We can use the plain text float32/64 formatter for JSON as well, so
let's expose the put_float32/64 functions.
Signed-off-by: Michael Scott <mike@foundries.io>
Formatting a float32/64 value for plain text is broken.
Example for 32bit: val1=0 and val2=500000 is equivalent to 0.5
Current formatter was using %d.%d (%lld.%lld for 64bit) so
exported value was 0.500000 (or 0.5)
To fix this, for val2 use a zero-padded formatter for the maximum
length of each bit length (6 for 32bit and 9 for 64bit), and then
remove the zero characters at the end of the string.
Notes re: handling of val1/val2 signs:
- eliminate potential negative sign when converting val2 to avoid:
a value like: 0.-5
- use negative val2 when val1 is 0 to fix small negative handling
such as -0.5
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16154
Signed-off-by: Michael Scott <mike@foundries.io>