Commit graph

21541 commits

Author SHA1 Message Date
Robert Lubos
9b1f0e3da0 net: lwm2m: Add IPSO Accelerometer object in version 1.1
Update IPSO Accelerometer object implementation to support object model
version 1.1.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-29 13:42:11 -04:00
Robert Lubos
ca21c03e8c net: lwm2m: Add IPSO Pressure Sensor object in ver. 1.1
Update IPSO Pressure Sensor object implementation to support object
model version 1.1.

Add missing optional resources for the object model version 1.0.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-29 13:42:11 -04:00
Robert Lubos
7546c5bf29 net: lwm2m: Add IPSO Humidity Sensor object in ver. 1.1
Update IPSO Humidity Sensor object implementation to support object
model version 1.1.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-29 13:42:11 -04:00
Robert Lubos
1bd6e5bde3 net: lwm2m: Add IPSO Generic Sensor object in version 1.1
Update IPSO Generic Sensor object implementation to support object model
version 1.1.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-29 13:42:11 -04:00
Robert Lubos
c83fca2784 net: lwm2m: Add IPSO Temperature object in version 1.1
Update IPSO Temperature object implementation to support object model
version 1.1.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-29 13:42:11 -04:00
Robert Lubos
49b0e2cc76 net: lwm2m: Unify reusable resources creation
Some of the objects redefined reusable resources IDs, while others used
a common header which defines resource IDs. Unify the approach and use
the header in every object.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-29 13:42:11 -04:00
Robert Lubos
c9f5337a91 net: lwm2m: Add support for object versioning
Each object now have to specify the object version it implements.
Based on this information the LwM2M engine can decide whether it's
needed to report the object version during Registration/Discovery
operations or not.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-29 13:42:11 -04:00
Martí Bolívar
c3d3b3dbc8 Bluetooth: remove CONFIG_BT_CTLR_TO_HOST_UART_DEV_NAME
This is now unused.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-29 16:33:51 +02:00
Jukka Rissanen
97bf53fdcf net: if: Add locking when setting/getting hoplimit or ttl
Locking was missing when setting or getting IPv6 hop limit
or IPv4 time-to-live values.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
b07ba6db85 net: ipv4: Discard pkt if TTL is 0
If the TTL value in the IPv4 header is 0, then the packet needs to
be discarded.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
fafb1b82f4 net: context: Print network interface index with pointer value
Makes debugging easier if interface index is printed with
the pointer.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
362591810f net: config: Try to only use auto started interface
If the first network interface is down when the net config init
is run, then the IP addresses etc would be set to wrong network
interface. So when initializing the network, try to first find
a network interface that is auto started and use that to configure
IP addresses etc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
fd4928aedd net: shell: Print network interface index instead of pointer
When printing network interface information print index or
index + pointer, so that the output is more user friendly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
5c4bcf110d net: if: Mark IPv6 address valid for point2point links
As DAD is not done for point-to-point links, we can mark them
valid immediately. If this is not done, then the address will
never be picked as a source address to a sent packet.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
e291cddb31 net: shell: Print network interface flags values
Useful to know what flags are set for the network interface
so print them in the shell by the "net iface" command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
cf9edcd3b4 net: shell: Add command to show virtual interface information
Add "net virtual" to show virtual network interface information.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
10142ac99c net: virtual: ipip: Add IP tunneling driver
Add a IP-to-IP tunneling driver. It supports both IPv4 and IPv6.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
36be096c43 net: virtual: Add virtual network interface support
This can be used to implement tunneling, VPN etc. The virtual
interfaces can be chained together to support multilayer
network interfaces.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
3d34c5f4b7 net: ipv4: Add utility func to create IPv4 header
Add a function that allow caller to create IPv4 header with
possibility to set various fields in the header.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
897698bc78 net: if: Allow app to disable IPv4 or IPv6 for the interface
Application can disable IPv4 or IPv6 later if those are not
needed nor used for a given network interface.

Fixes #14581

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Morten Priess
96a13712ad Bluetooth: controller: Initial CIS peripheral establishment
LL_CIS_IND starts a ticker for the created CIG, using the event_counter
and offset provided. Ticker generates callbacks to
lll_peripheral_iso_prepare. Event done with ISO (extra) type is demuxed
and done handled for CIG including ticker update with drift
compensation.

TODO: Handle multiple CISes as well as pause/resume and scheduling
latency.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-03-27 08:57:03 -04:00
Morten Priess
a95ca4f3b7 Bluetooth: host: Reject CIS request if hci_le_accept_cis fails
Act on returned error code from hci_le_accept_cis, and reject CIS
request if failed.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-03-27 08:57:03 -04:00
Morten Priess
e0b8881622 Bluetooth: controller: Temporary LLCP CIS_REQ/CIS_IND handling
Implemented LL_CIS_REQ/RSP and LL_CIS_IND handling to allow a central
to establish a CIS connection. Implementation is temporary, for
test/development purpose and should be re-implemented in the new LLCP
framework when ready.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2021-03-27 08:57:03 -04:00
Emil Gydesen
8750b7c6f7 Bluetooth: audio: Changed VOCS to use ENOTSUP instead of EOPNOTSUPP
Changed to use ENOTSUP to be more consistent with the rest of the
bluetooth subsystem.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-26 15:32:43 -04:00
Jun Huang
03eb3778e0 Bluetooth: Host: Add a configuration for writable name
In the file gatt.c, GAP service contains the Device Name
characteristic. If writable, authentication and authorization may
be defined by a higher layer specification.It means that GATT
clients can write to device name GAP characteristic without
bonding. So we add a configuration for writable name without
bonding.

Signed-off-by: Jun Huang <huangjun6@xiaomi.com>
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-26 15:31:29 -04:00
Krzysztof Kopyściński
4c8605b003 bluetooth/smp: reject pairing in SC Only mode if insufficient keysize
This is required for GAP/SEC/SEM/BI-09-C and GAP/SEC/SEM/BI-10-C to pass
signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
2021-03-26 15:30:25 -04:00
Emil Gydesen
83599467ce Bluetooth: host: Add feature check for periodic adv functions
Adds a check for the BT_LE_FEAT_BIT_PER_ADV bit for each
function related to periodic advertising, including sync and
PAST transfer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-26 15:28:09 -04:00
Flavio Ceolin
11ea2766bc mgmt: hawkbit: Fix variable type
hwinfo_get_define_id returns and ssize_t with the size og the copied
id in case of success or negative value otherwise.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-03-26 07:13:13 -04:00
Flavio Ceolin
d665b06adf mgmt: updatehub: Fix variable type
hwinfo_get_define_id returns and ssize_t. Positive value with the
size of the copied id in success or a negative value in case
of error.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-03-26 07:13:13 -04:00
Emil Gydesen
f3e9c3eff1 Bluetooth: shell: Adds Periodic adv sync transfer shell command
Adds a command for tranferring a periodic adv sync to a PAST
receiver.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-26 07:10:15 -04:00
Flavio Ceolin
9fd4ea91b7 coccinelle: Remove extra semicolon
coccicheck --mode=patch --cocci=semicolon.cocci

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-03-25 11:35:30 -05:00
Joakim Andersson
eafc6c067f Bluetooth: host: Fix BT_LOG_SNIFFER_INFO option without BT_SMP enabled
Fix undefined reference to bt_key_foreach when BT_LOG_SNIFFER_INFO has
been enabled but BT_SMP is not enabled.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-25 07:23:52 -04:00
Eugeniy Paltsev
d7b8d798c0 testsuite: generalize timestamp_serialize for all ARC CPUs
Generalize timestamp_serialize defenition for all ARC CPUs
instead of ARCv2 only.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2021-03-25 07:23:02 -04:00
Pavel Vasilyev
8bcc85b38c Bluetooth: Mesh: Check response address in Configuration Client
The Configuration Client doesn't check the address in a received
response. This means that a response from any device will be accepted.

This change ensures that the correct response will be accepted.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2021-03-25 07:09:47 -04:00
Jack Rosenthal
23ef49ba2e shell: fix tab in shell_log_backend.c
This is a trivial fix to add a tab to an under-indented line.

Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
2021-03-25 07:09:07 -04:00
Krzysztof Chruscinski
265e9dbb1b shell: uart: Fix init function
Init function can be called multiple times (after each shell
reinitialization). It was missing reseting ring buffers and tx_busy
flag. When called once proper state of those variable where handled
by ram sections initialization.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-25 07:08:40 -04:00
Krzysztof Chruscinski
0225ea7ab0 shell: Add callback to shell_uninit function
Shell uninitialization is not synchronous, it is deferred to shell
thread so resources used by the shell (e.g. transport resource like
uart) cannot be used until it is completed. Added callback which
notifies when all resources are released and shell is uninitialized.
Callback is called from shell thread just before it is aborted.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-25 07:08:40 -04:00
Dominik Ermel
0f9ce1ba8f dfu: mcuboot: Remove definitions available via bootutil_public.h
The bootutil_public.h, as a part of mcuboot interface, has been
providing the same definitions as mcuboot_priv.h
The commit removed the redundancy.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-25 07:08:01 -04:00
Kumar Gala
0bb4665df7 include: Move ptp_clock.h to drivers/ptp_clock.h
Move ptp_clock.h out of the top level include/ dir into
include/drivers/ptp_clock.h and deprecated the old location.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-25 10:09:33 +02:00
Krzysztof Chruscinski
68fd304d19 logging: Increase default CONFIG_LOG_STRDUP_MAX_STRING to 2
In modes where string duplication is not used, the code is
still compiled. On some compilers it was failing due to calling
strncpy which will do nothing because n is 0. Increase
CONFIG_LOG_STRDUP_MAX_STRING to 2 to ensure that n is 1 in that
case

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-24 21:42:10 -04:00
Pete Skeggs
75a74bfad2 shell: make flag modification atomic
Add Z_SHELL_SET_FLAG_ATOMIC macro to use technique from
shell_process() to atomically set and return the previous
value.

Change all void z_flag_*_set() functions to bool z_flag_*_set()
and use macro to return previous value after setting.

Modify shell_process() to use this modified z_flag_processing_set()
function.

Reorder flags to keep last_nl on byte boundary.

Add public setters for insert_mode, echo, and mode_delete for
completeness.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
2021-03-24 05:44:14 -04:00
Pete Skeggs
c36fc5c3f2 shell: add obscured input mode
Add flag to shell_flags to control echo as obscure
character (for passwords) or not. Add setter and getter
functions. Modify shell echo to use this flag if set.

Also add public setter for color mode and obscure mode.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
2021-03-24 05:44:14 -04:00
Jacob Siverskog
2954dcf4ed modbus: fix potential null pointer dereference
reorganize code so that null pointer check is done prior to accessing
element.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-03-24 10:56:06 +02:00
Joakim Andersson
a9b4cae019 Bluetooth: audio: Fix compilation issue with BT_AUDIO
Fix bluetooth audio compilation issue when BT_AUDIO is enabled but
no Bluetooth host services has been enabled.
This leads to an empty library file.
Instead of creating a new library for audio add the sources to the
parent library, similar to how bluetooth services are added.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-23 20:58:35 -05:00
Emil Gydesen
e1b840c4ab Bluetooth: Audio: VOCS add explicit ignore of notify return
Add casting to (void) to explicitely ignore the return value
of the notifi function calls.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-23 17:50:06 -04:00
Emil Gydesen
30edb5e52e Bluetooth: Audio: VOCS add missing check for offset in writes
VOCS does not support the write long procedure, and thus
should not accept any offset in write requests.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-23 17:50:06 -04:00
Emil Gydesen
04232fe1ef Bluetooth: Audio: Append bt_ for everything defined in vocs_internal
Was requested in the review for
ed2162c700 but was merged before it
could be fixed.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-23 17:50:06 -04:00
Luiz Augusto von Dentz
2a42ebc743 Bluetooth: ISO: Add function to access bt_conn_iso
This adds bt_conn_iso function to safely access the struct bt_conn_iso
within a bt_conn.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2021-03-23 17:49:08 -04:00
Luiz Augusto von Dentz
9d0fb5ec47 Bluetooth: ISO: Remove channel direction
Channel direction was actually a source of confusion since the spec does
actually define the data path direction from controller point of view
meaning input actually means transmit and output receive, also direction
can be configured with different QoS settings.

To make these APIs less confusing and allow QoS to be configured
independently they are now split into RX (receiving) and TX
(transmission) settings including its data path.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2021-03-23 17:49:08 -04:00
Luiz Augusto von Dentz
0eb4bfee3f Bluetooth: ISO: Fix not unbind if ACL has been disconnected
If ACL has been disconnected any ISO handle shall be considered invalid
as well.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2021-03-23 17:49:08 -04:00