Refactor the Connection Parameter Request Procedure to be
separate from and not overlap the variables of the
Connection Update Procedure.
Also, added missing implementations to pass all Connection
Parameter Request Procedure related Conformance Tests.
Jira: ZEP-1918
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Implement the LE Read Channel Map HCI command, along with making the
reading of the multi-byte channel map value from the connection pointer
thread-safe in case the ISR triggers while we are reading the value.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Although the current BLE controller only supports a single TX power (0
dBm), the qualification tests require the 2 Read TX Power to be
present and supported in the controller, so implement them while
returning always 0 dBm.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
When the CONFIG_BT_CTLR_CONN_RSSI option is set, the connection RSSI is
available in the controller, and can be reported to the Host via the
Read RSSI command. Implement the command, which is required for
qualification.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Arguments are not needed and in some cases are being set as unused in
the same function. The test_main function is called from ztest main
routine without any arguments.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The boot banner is being printed after static threads have started, for
example this is visible with tests using ztest.
This puts the banner message before starting any threads.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We have a few systems with small amounts of flash that this test can't
fit into. For now I set the limit right above 32k, however that might
need to get bumped up if we have any systems with flash sizes between
32k and 64k.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The zedboard_pulpino has a small amount of flash so we should have that
in the yaml for any tests thats might filter on code size footprint.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The original commit 8ebaf29927 ("net: http: dont timeout
on HTTP requests w/o body") was intended to handle a case
where an HTTP response had been retrieved from the server but
the HTTP parser couldn't meet the criteria for calling
"on_message_complete". For example, a POST to a REST API
where the server doesn't return anything but an HTTP
status code.
It was a really bad idea to check a semaphore count. There
is a lot of kernel logic built into semaphores and how the
count is adjusted. The assumption that the value is 0
after the k_sem_give() is incorrect. It's STILL 0 if
something is pending with a k_sem_take(). By the time
k_sem_give() is done executing the other thread has now
been kicked and the count is back to 0.
This caused the original check to always pass and in turn
breakage was noticed in the http_client sample.
Let's do this the right way by setting a flag when
on_message_complete is called and if that flag is not set
by the time we reach recv_cb, let's give back the semaphore
to avoid a timeout.
Jira: ZEP-2561
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Masks for level- and edge-triggering levels are 0, so the following
check will be always true:
if ((flags & GPIO_INT_ACTIVE_LOW) == GPIO_INT_ACTIVE_LOW)
Invert the evaluation order, by checking the masks that are not 0
first.
Jira: ZEP-2557
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Adds an #elif for ESP32 boards. Connect a wire from pin IO2 to pin IO4
so that the test can be executed.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
patch add device tree support for develoement board of
quark_se_c1000. Previously pushed patch was flashing binary
at wrong address because of which UART was not working
Jira:ZEP-2459
test
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
The compilation of the i2c_ll_stm32 fails when we
enable the interrupt mode. The struct i2c_stm32_data
is needed to initialize the semaphore. This patch adds
the missing struct for interrupt mode.
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
BLE is the only networking interface on 96b_carbon, so if
CONFIG_NETWORKING is set, automatically use 6lowpan/BLE link
layer. This will allow to make networking apps work "out of the
box" on 96b_carbon, similar to e.g. qemu_x86 (which automatically
uses SLIP) or frdm_k64f (which automatically uses Ethernet).
This also enables NET_L2_BT_ZEP1656, because most 6LoWPAN/BLE samples
in Zephyr currently use that option, and it is required to achieve
working 6LoWPAN/BLE with Linux kernels currently widely accessible
to the end users. E.g. the latest Ubuntu LTS release, 16.04, ships
with 4.4 kernel, and can be upgraded with a special effort to HWE
kernel which is currently at 4.10. NET_L2_BT_ZEP1656 is needed for
both these kernels.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
When transmitting to the UART interface using polled mode, the ESP32
driver would return 0 regardless of the success state. Return the
character that has been transmitted to comply with the API.
Jira: ZEP-2552
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The HTTP header field pointers are saved for each HTTP request.
But the counter that saves the pointers was never reset to initial
value when the connection was dropped. This meant that the header
field values were only proper for first HTTP request.
Jira: ZEP-2463
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The size of the interrupt descriptor table is not really
relevant to this test.
If any driver enabled for the target board gets enabled and
has a priority level outside the IDT range, gen_idt.py is properly
reporting an error. The old C-based gen_idt seems to have allowed
this to slide by.
Issue: ZEP-2496
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The stack name was incorrectly specified in mqtt_publisher sample
application, this cause compilation error when certain Kconfig
options were specified.
Jira: ZEP-2566
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The server needs global enable/disable status instead of only being
able to enable or disable just the TLS server part.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we have specified AF_UNSPEC when initializing application
server local address, then we try to bind to both IPv4 and IPv6
addresses. The old code did not honor the port number in this
case but used some random value for port.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If user has specified a specific local address, then honor that
and do not try to bind IPv4 context if only IPv6 is defined,
and vice versa for IPv6.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Zeroing-out all bytes from a connection structure when it's
unregistered ensures all state from a previous connection is gone and
can't be mistakenly reused.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
If either a remote or a local address were supplied to the
net_conn_register() function, the IP stack would proceed to copy
sizeof(struct sockaddr) bytes from the respective remote_addr
or local_addr pointers, regardless of the actual size of the storage
these pointers point to.
Use the proper size depending on the socket address family.
Coverity-ID: 173630
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
There are 2 possible interpretations regarding the address to return in
response to the Read Peer RPA HCI Command:
1) The RPA that the local controller generates to be used in certain
packets it sends
2) The RPA generated and used by the peer device in its packets
We used to return 1) but our interpretation turned out to be incorrect
when reading the HCI test specification, so this commit switches to
returning 2).
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The :download: directive doesn't format well on output, and also
links to files that likely have linux line endings that don't
display well on Windows systems.
fixes: #1204
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
s_addr is actually an unsigned integer and it's not guaranteed to be
aligned on 4-byte boundary. In net_ipv4_addr_cmp(), accessing s_addr
directly might cause an unaligned exception on some platform
like xtensa. Use UNALIGNED_GET() to prevent unalgined exception.
Signed-off-by: Aska Wu <aska.wu@linaro.org>
If CONFIG_NET_DEBUG_APP was defined, but neither NET_APP_SERVER nor
NET_APP_CLIENT, build failed due to net_app_cb() haven't beeen
defined. So, define it to empty in this case.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
There're no "POSIX API support", of POSIX features, only subsets of
Pthreads and BSD Sockets APIs are implemented.
Also, mention HTTP client/server improvements.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
In the ll_rl_pdu_adv_update() function, the check to verify if we are
dealing with an item from the resolving list or else with a simple
standard non-privacy enabled device was left over from the previous
iteration, which used negative values. Replace that check with the
proper current one, using the size of the rl array as an indicator of
whether the index is valid.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
When we mask out the GPIO High impedance/Pull-up/Pull-down field we
should be shifting the mask file, not shifting the field. This is
because all the other defines already assume the shift.
Coverity-CID: 173640
Jira: ZEP-2538
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Due to varying remainder value, first interval will need to
consider the remainder value used in microsecond timing from
the start of the initiator window.
Also the tx chain delay and ready delay must be substract
after the window offset is calculated.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The Read Remote Version Information command is supported on the BLE
controller, enable the bit in Read Local Supported Commands to reflect
this.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The main reason is allowing to run on 6LoWPAN devices, though also to
demonstrate IPv6 support with BSD Sockets in general.
Tested on 96b_carbon.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Setting just IPv4 address as was allowed before isn't enough for
real-world usage (e.g. accessing DNS and outside servers in general).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Per LwM2M spec (7.3.2.4 Operation on Object):
"If the payload (New Value) conveys an Object Instance ID in conflict
with one already present in the LwM2M Client, the complete request
MUST be rejected and a "Bad Request" error code MUST be sent back."
Let's do that.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Per LwM2M specification 7.3.2.4, "Optional Resources MAY be conveyed
in the "New Value" parameter as well; the LwM2M Client MAY ignore the
optional resources it doesn't support."
Update TLV/JSON writer to ignore error when object fields are not
found (treated as optional resource). This will allow the resources
supported being written.
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
[michael.scott@linaro.org: re-worked patch post addition of CREATE
operation.]
Signed-off-by: Michael Scott <michael.scott@linaro.org>
Prior to this patch, a CREATE operation was handled as a WRITE operation
after the object instance was created. This becomes problematic when
handling of optional resources differs between these 2 operations.
Let's introduce an actual CREATE operation and use it later to create
these differences.
Signed-off-by: Michael Scott <michael.scott@linaro.org>
We are returning EINVAL from content format write ops when an object
field definition is not found (an optional field which is not
implemented). Instead, return ENOENT which lets the LwM2M engine
know to send ZOAP_RESPONSE_CODE_NOT_FOUND to the LwM2M server at the
end of handle_request().
NOTE: This behavior is not correct when we call the writer right after
a CREATE operation where the data is assigned to resources for the
first time. This case will be handled in a follow-up patch once we're
able to distinguish between a WRITE and a CREATE in the write op
handler.
Signed-off-by: Michael Scott <michael.scott@linaro.org>