Remove overly complicated logic to skip incoming data if we were
still waiting on a previous set of data to be read.
This fixes a bug where an error during data receive could end up
with the modem ignoring all incoming data.
Signed-off-by: Michael Scott <mike@foundries.io>
There were many platforms where this function was doing nothing. Just
merging its functionality with _PrepC function.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
C++ exception support needs to use the newlib C library in order to get
the abort function. C++ exceptions also do not work with the simple
malloc/free implementation provided by the Zephyr minimal C library.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
MQTT packet_length_encode function accepts NULL buf argument, therefore
it cannot be dereferenced without a check.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
mqtt_connect was not releasing mutex after successfull connection.
Reworked the code to have a single exit path with mutex unlock.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.
Found using Coccinelle.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
This script helps to remove bogus intermediate local variable
used in functions to store return value and instead return
directly while saving few bits of memory.
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
This commit defines a default log level at bluetooth subsystem
level when module log level is not defined.
Prior to this change, the bluetooth subsystem would use
the firmware default log level.
Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
"-machine type=pc-0.14" appears to be the option which leads to
broken PCI emulation in QEMU, where PCI enumeration reports one
IRQ number (11), while actually IRQ 10 is emulated by QEMU.
"-vga none" and "-display none" appear to be just subordinate of
"-machine type=pc-0.14" and are required to get qemu_x86 into
bootable state.
Fixes: #11706
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Commit messages should not start with literal "subsys:", instead, spell
out the actual subsystem name.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
net_udp_get_hdr() function returns NULL on failure. Therefore
handle its return value to avoid potential NULL dereference.
Fixes#11485
Coverity-CID: 189738
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
There is not an easy way to relate an application's user_data to a
connection. One way is to save a pointer to bt_conn in the
application's user_data array upon connection establishment.
Each connection related callback function will have to loop for all
user_data and compare the saved pointer to the passed bt_conn
pointer. This is inefficient if there are many callback activations
during the connection.
This change makes the internal bt_conn mapping function accessible to
applications in conn.h. The function name is changed to
bt_conn_index() to clearly indicate that the function returns an
index of an array.
Add an ASSERT to catch illegal parameter.
Signed-off-by: Kim Sekkelund <ksek@oticon.com>
Update menuconfig to upstream revision 38dff36b0f97b, to improve the
behavior for a case reported by Øyvind Rønningstad.
Upstream commit message:
menuconfig: Only list duplicated choice symbols once
When a Kconfig file defined a named choice and was included multiple
times, the choice symbols were listed multiple times in the
menuconfig as well (due to commit 17d7c1e ("menuconfig: Show all
symbols at each menu location for multi.def. choices")).
That's probably not what you want. Tweak it so that each symbol is
only shown once, with the prompt that was used for it at whatever
choice definition location is entered.
Also change how the choice selection is displayed before the choice
is entered, so that the prompt used for the selected symbol at that
particular location is used. Previously, the prompt at the first
definition location for the symbol was always used.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The _net_app_sprint_ipaddr() was calling log_strdup() when
creating the debug print string. This is not correct as
the log_strdup() can only be used when calling the logging macro
to print strings.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In Gen. OnOff Unack handler, gen_onoff_publisher(model) was
misplaced previously & now it is set to proper location.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Add a sample application for demonstrating automatic generation of
Character Framebuffer (CFB) font headers at build time.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Add script and cmake functions for automatically generating Character
Frame Buffer (CFB) font header files from image files, TrueType, or
OpenType font files.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
As per RFC1112 sec 6.2 "A host group address must never be
placed in the source address field or anywhere in a source
route or record route option of an outgoing IP datagram."
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If ARP Request with sender IP address set to localhost then drop
the request.
Fixes#11489
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If network stack found ARP entry for peer address, then it
tries to send pending IP packet. But it always keeps ptype
as ARP only. In this particular scenario it has to be IP
packet.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Networking stack sometimes try to find source address based
on destination address. If interface could not find best match
then it returns unspecified address (0.0.0.0). Host should not
send these packets.
IPv4 reply related issues fixed.
Fixes#11329
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
As C++ does not support designated initializers, including this file
in a c++ file caused a compilation error.
gcc allows them if they are ordered as the members appear in the
struct definition
I tested it with an application using mqtt and ethernet.
Signed-off-by: Alexander Polleti <metapsycholo@gmail.com>
Enable debug logging in the watchdog driver sample application to aid
in debugging watchdog drivers.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This commit fixes a bug in the ARMv7-M convenience macro that
evaluates write-ability of given access permissions attributes.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
When removing a peer from a CCC, it also needs to be removed from
the attribute `cfg`.
Not removing it would create a shortage of `cfg` that could
prevent new host to pair to the BLE device.
Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
Implementation taken from Nordic nrfx version 1.3.1 soc/nrfx_coredep.h,
modified to remove material from other series and to conform to Zephyr
coding standards.
Note that unlike standard k_busy_wait this is susceptible to
longer-than-intended delays due to the impact of interrupt handling.
Fixes#11626
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Use sys_put_le16() for unaligned access, this is refactored work of
PR #8495
PR #11432
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
CCC settings was not removed when unpairing all keys.
It means CCC settings were still present in flash and were
loading at bluetooth initialization time.
Loading these orphan CCC settings would fill `bt_gatt_ccc_cfg`
configurations and would prevent to add new CCC when pairing
with a new device.
Signed-off-by: Olivier Martin <olivier.martin@proglove.de>
Add API's to enable/disable System PM states so that an
an application can enable/disable system from entering
certain Low Power states.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
This is a follow-up to commit b45fcc6b9e.
The nrfx import is complemented with the file containing
a core-dependent delay function. The intention is to allow it
to be used in a custom k_busy_wait() implementation.
Origin: nrfx
License: BSD 3-Clause
URL: https://github.com/NordicSemiconductor/nrfx/tree/v1.3.1
commit: d4ebe15f58de1442e3eed93b40d13930e7785903
Purpose: Provide peripheral drivers for Nordic SoCs
Maintained-by: External
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>