Until now the OOB info and URI fields in unprovisioned beacons were
generally ignored by the implementation. Add fields for these to
bt_mesh_prov and make sure to take them into account when encoding
advertising data, both for PB-ADV and PB-GATT. For PB-ADV the URI goes
out in a separate beacon, whereas for PB-GATT it is placed in the scan
response data.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Currently, we always set the content-format as "plain/text" when
it is unrecognized. This is wrong for it's possible that payload
is actually something else.
For example, we don't support JSON as incoming format right now.
But if I send a PUT request to /1/0/1 (server objectinstance/lifetime
resource) with value 3200 in JSON format: {"e":[{"n":"","v":3200}]}.
The client will still handle the request and respond with changed (2.04)
except the lifetime resource is updated incorrectly due to parsing
error.
Correct the behavior by not setting a default format and respond with
content-format-not-support error code (4.15)
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Be consistent with the style of always having braces even if a compound
statement isn't required. Avoids some warnings from static analysis
tools.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Tests system call memory buffer read/write validation using the
k_pipe_get() and k_pipe_put() calls from a userspace thread.
Specifically, this tests _SYSCALL_MEMORY_READ/WRITE checks
by the system call handler by attempting to read/write to a
kernel object.
write_kobject_user_pipe() attempts to write over a kernel object
by using the kernel object's location as the buffer to place
the data read from the pipe.
read_kobject_user_pipe() attempts to read a kernel object by using
the kernel object's location as the location of data to be placed
into the pipe.
Tested on qemu_x86 and frdm_k64, passes on both.
Signed-off-by: Joshua Domagalski <jedomag@tycho.nsa.gov>
Added three tests for kernel objects focusing on 1) revoking
access to a k_object that the thread does not have
permissions to access, 2) accessing a k_object after
permissions to access it were revoked, and 3) trying to
revoke access to a k_object from a parent thread by a
child thread. Additionally, added a test for
k_thread_user_mode_enter().
revoke_noperms_object() tests by calling
k_object_access_revoke() on a semaphore (kernel object) that it
does not have access to (ksem).
access_after_revoke() tests ability to access a semaphore after
access has been revoked by itself.
revoke_other_thread() tests whether a thread can revoke access
for an object for which it has permissions from a thread for
which it does not have permissions.
user_mode_enter() tests whether k_thread_user_mode_enter()
truly enters user mode.
Tested on qemu_x86 and frdm_k64 with pr-4974 applied, passes
on qemu_x86 but requires small fix for ARM (will submit
separately).
Signed-off-by: Joshua Domagalski <jedomag@tycho.nsa.gov>
Fixes: 5958
Ninja by default will suppress command output and input. This is a
problem for the 'flash', 'debug', etc. targets, which may need to
interact with the user (and which display interactive output like
progress bars).
To fix this, add the USES_TERMINAL option to their target
definitions. This puts them in the console pool on Ninja, allowing the
commands to interact with the console.
References:
https://ninja-build.org/manual.html#_the_literal_console_literal_poolhttps://cmake.org/cmake/help/v3.8/command/add_custom_target.html
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
Added noprompt command to shell. It will disable printing
the prompt.
For the native port, when feeding commands from a file or
pipe the prompt reprinting after each command (without echoing)
just confuses the user.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Now the native console driver also handles stdin
so we can drive the shell from the command line,
a pipe or a file
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Added a new config variable with the recommended stack
size for threads which are only meant for the posix architecture
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
net_pkt_append() has been changed. If payload reached max value
of 'data_len' in net packet, net_pkt_append will not append.
So the caller has to create new packet and append remaining payload.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Unlinking of neighbor also needed after nbr_unref. Otherwise
neighbor id is still in use and can not be linked further.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
When a node receives DIO message from peer then node adds peer as
a neighbor (nbr with linklayer address). But when a node receives
DAO message from different peer (chances are peer selected
different route to reach this node), remove peer with previous
link layer address and add as a neighbor with new link layer address
with new route information. Now node can properly route packets to
peer from neighbor table or based on nexthop information from
routing table.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
When a node joins in DAG network, it chooses neighbor (node or border
router) as its parent. But if it receives DIO message from another
peer, it can only act as a neighbor, not as a parent. If peer rank
is better than current preferred parent rank then node will select
new peer as it's best parent.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
RPL prints lot of debug information which is difficult to track.
Minimized debugs in timer specific information and parsing of
DIO and DAO options. Also fixed alignment issues (no changes in
functionality)
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Do not even consider the push event if CONFIG_NET_MGMT_EVENT_INFO
enabled and info length is more than NET_EVENT_INFO_MAX_SIZE.
Print error message and ignore the event.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Driver is 'Busy' can be a warning message which can be enabled with
minimum debug level CONFIG_SYS_LOG_IEEE802154_DRIVER_LEVEL=2.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Current default value for NET_RPL_INIT_LINK_METRIC is 2, changing it
to 1.
e.g. NET_RPL_MIN_HOP_RANK_INC is 256 and NET_RPL_MC_ETX_DIVISOR is 256.
Rank calculation for nodes is
rank_increase = CONFIG_NET_RPL_INIT_LINK_METRIC *
NET_RPL_MC_ETX_DIVISOR;
Which gives 768 for first set of child nodes. It would be good if
CONFIG_NET_RPL_INIT_LINK_METRIC value is 1 and nodes ranks will be
245, 512, 768 based on the path they choose.
User can absolutely change their configuration to maintain proper ranks.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
When CONFIG_NET_RPL enabled, do not run DAD (duplicate address
detection) for global addresses. In RPL mesh network global addresses
for nodes are determined by prefix from Border Router. DAD is not
necessary in this case.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If CONFIG_NET_MGMT_EVENT_INFO is enabled then provide mgmt info
about the route, which is added or deleted.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If CONFIG_NET_MGMT_EVENT_INFO is enabled then provide mgmt info
about the neighbor, which is added or deleted.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Remove any routes with neighbor as a nexthop first and then remove
neighbor from neighbor table.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Provided separate event information structs based on events. This way
user will know what kind of information will be received to that
particular event.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
When net_ipv6_prepare_for_send() needs to route packets, it missed
updating of RPL header.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Doing neighbor discovery in RPL network is not necessary and
that can be disabled in RPL nodes. Unfortunately the border
router needs to have ND enabled as it has also non-RPL network
interfaces in use. So in this case, mark RPL node as always
reachable.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As this is very specialized info which is not normally needed,
do not print it by default.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Introduce CONFIG_NET_ROUTING option that allows the IP stack
to route IPv6 packets between multiple network interfaces.
No support for IPv4 routing is implemented by this commit.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Removes variable shadowing another declared
previously but does not change anything
functionally.
Signed-off-by: Juan Manuel Torres Palma <j.m.torrespalma@gmail.com>
Some mcu's have USART_PRESC_PRESCALER defined in the function call. Add
a prescaler of div1 to it.
Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
Fix HCI LE Set PHY command for invalid behavior testing for
invalid parameters and unsupported features.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix generation of redundant length update event when no
change in effective octets or time.
Fixes LL.TS.5.0.2 conformance tests:
LL/CON/MAS/BV-73-C [Master Data Length Update - Responding
to Data Length Update Procedure; LE 1M PHY]
LL/CON/MAS/BV-74-C [Master Data Length Update - Initiating
Data Length Update Procedure; LE 1M PHY]
LL/CON/MAS/BV-76-C [Master Data Length Update - Responding
to Data Length Update Procedure; LE 2M PHY]
LL/CON/MAS/BV-77-C [Master Data Length Update - Initiating
Data Length Update Procedure; LE 2M PHY]
LL/CON/SLA/BV-77-C [Slave Data Length Update - Responding
to Data Length Update Procedure; LE 1M PHY]
LL/CON/SLA/BV-78-C [Slave Data Length Update - Initiating
Data Length Update Procedure; LE 1M PHY]
LL/CON/SLA/BV-80-C [Slave Data Length Update - Responding
to Data Length Update Procedure; LE 2M PHY]
LL/CON/SLA/BV-81-C [Slave Data Length Update - Initiating
Data Length Update Procedure; LE 2M PHY]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The expected order for heading levels in our ReST documents is # for H1,
* for H2, = for H3, and - for H4. Some documents snuck in without
following this guideline.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Fixed implementation to use Connection Parameter Request
Procedure Preferred Periodicity value in calculating the new
connection interval used by the master role in Connection
Update Indication.
Fixes LL.TS.5.0.2 conformance tests:
LL/CON/MAS/BV-32-C [Accepting Connection Parameter Request –
Preferred_Periodicity]
LL/CON/MAS/BV-33-C [Accepting Connection Parameter Request –
Preferred_Periodicity and preferred anchor points]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
In case of split host & controller we may need to do ACL segmentation
of packets. Sending the composition data will already have allocated
three TX buffers, so trying to segment the first one further will
result in a deadlock. Increase the buffer count from the default (3)
to 4 to work around this risk.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Increasing the IPv6 multicast address count from 2 to 5 so that
tests will always run ok.
Fixes#4401
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
prepare_segment() returned NULL in case of any error, which then
net_context_send() translated into -EINVAL. That's highly confusing
though, because a common case of failure for prepare_segment() is
being unable to allocate data fragment(s) (for TCP header, etc.)
So, return output pkt by reference, and detailed error status as
a return value.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
The default PWM polarity was 'inversed', which is not aligned with the
other PWM drivers. Unfortunately there is not yet an API to define the
default polarity to be used by the driver, but assume that 'normal'
(signal starts high for the duration of the duty cycle) should be the
default.
Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>