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>
Defines a Kconfig variable which allows the user to specify
that any generated hex/bin/s19 file should not have filled gaps.
This is done to support building in a multi image context,
where several image files will be merged together.
Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
Update Kconfiglib and menuconfig to upstream revision e47d7eff1012e, to
add some small fixes/improvements/changes:
- Raise errors for extra trailing tokens anywhere. They were silently
ignored in some places:
* end{if,menu,choice} <extra tokens>
* {default,select,...} FOO <extra tokens> (though e.g.
'default FOO if' raised an error)
- Rephrase the warning when selecting a choice symbol to make it
clearer that select never has any effect on choice symbols.
- Display empty menus with '----' instead of '---> (empty)'. This
matches the C tools. It might be less confusing for symbols defined
with 'menuconfig', which is where you most often get empty menus
(when the symbol is n).
- Speed up parsing performance
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
System must not set the clock expiry via backdoor as it may
effect in unbound time drift of all scheduled timeouts.
Fixes: #11502
Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
The tests are modified to reflect the changed return values
the spi flash read and write APIs return.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Fixed the return values for read and write APIs for spin_nor.c
which were not inline with what the corresponding interfaces
were meant to return.
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
If transition time is not equal to Zero then & then only values
related to transition get calculated.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
If the first name is longer than HELLO_MAX sending would fail due to
there not being sufficient MIC space (or worse overrun the net_buf).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This code was still incorrectly causing corrupt strings to be
generated. Now it should be correct.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now if Gen. OnOff state set by client as '1' with some
transition time then value of Lightness will not jump to default
or last value instantly instead it would gradually increase during
that transition period.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Create independent function handlers for some Servers. This
would not initiate state binding if current state is equal to
Client requested state.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Inverse logic for onoff state while driving LED GPIO. For LED light on
GPIO pin is 0, 1 for LED light off.
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
Current implementation had fixed initial speed, this commit
fixes TWI and TWIM shims to use configuration from DTS.
Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
Coverity complains that packet_len can get assigned a negative value if
usb_dc_ep_mps() returns an error. This is correct, however it only
happens if the endpoint address is invalid, and in that case the value
is not used as the endpoint address is also validated in
usb_dc_ep_write().
Fix the issue by moving the assignment after the endpoint address
validation and by accessing the value directly instead of getting it
through usb_dc_ep_mps().
Fixes#11481
Coverity-CID: 189742
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>