Commit graph

5007 commits

Author SHA1 Message Date
Jan Van Winkel
2288d547ee samples: display: Migrate to new logging subsystem
Migrate from SYS_LOG to LOG logging mechanism.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-03 11:29:00 -07:00
Sebastian Bøe
8c791a999e cmake: openamp: Fixed a bug where the wrong BOARD was set
Fixed a bug in the OpenAMP sample's recursive build scripts, where it
would pass on the wrong board to it's second CMake invocation.

This fixes #10345

Fixed the same bug in ipm_mcux.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-03 08:24:46 -05:00
Jakub Rzeszutko
c471614cb6 subsys: shell: fix accept either CR or LF as as line delimiter
1. Shell will accept CR or LF as line delimiter.
2. Macro SHELL_DEFINE simplified - it no longer requires
   new line character.
3. Fixes: #10207.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 11:55:47 -07:00
David Leach
96e877a52e samples: buttons: Add GPIO_INT_EDGE to button configuration
Add GPIO_INT_EDGE triggering for the button push for boards where
the dts generates a SW0_GPIO_FLAGS.

Signed-off-by: David Leach <david.leach@nxp.com>
2018-10-02 11:27:30 -05:00
Jakub Rzeszutko
0eea1ef212 subsys: shell: add int ret_val to command handlers
1. Command handler can return command exectution status as int.
2. Existing command handlers rework.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 14:44:25 +02:00
Maureen Helm
eeb4411de7 drivers: boards: Merge HAS_DTS_GPIO_DEVICE with HAS_DTS_GPIO
Every board that uses dts-enabled gpio drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_GPIO_DEVICE and
HAS_DTS_GPIO.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
89ccead382 drivers: boards: Merge HAS_DTS_SPI_DEVICE with HAS_DTS_SPI
Every board that uses dts-enabled spi drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_SPI_DEVICE and
HAS_DTS_SPI.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
75bc6ba454 drivers: boards: Merge HAS_DTS_I2C_DEVICE with HAS_DTS_I2C
Every board that uses dts-enabled i2c drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_I2C_DEVICE and
HAS_DTS_I2C.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
9dea0315f7 samples: arduino_101: Add dts overlay and fixup to env sensing sample
Adds a board-specific dts overlay and fixup file to the arduino_101
environmental sensing sample, in preparation for making the sensor
drivers require dts.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Krzysztof Chruscinski
a15438e8f5 logging: add mechanism for handling transient strings
Extending logger to support logging transient strings (with %s).
With dedicated call (log_strdup), string is duplicated to a buffer
from internal logger pool. Logger implicitly manages the pool.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-01 15:26:14 -04:00
Sebastian Bøe
d6de4c7a99 cmake: Fall back to ZEPHYR_BASE when the board is not in BOARD_ROOT
It is very inconvenient to maintain an application that both runs on a
Zephyr board and an out-of-tree board.

It forces one to write build scripts like this in the app:

if(BOARD STREQUAL my_out_of_tree_board)
  set(BOARD_ROOT some/out/of/tree/board/path)
endif()

To avoid this we change the semantics of BOARD_ROOT. Instead of it
being a path to the board root it is now a prioritized list of board
root directories. Zephyr will append ZEPHYR_BASE to BOARD_ROOT.

This ensures that Zephyr boards can be used when the out-of-tree board
directory can not supply the requested board.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-01 09:46:46 -04:00
David B. Kinder
432562dd19 doc: fix doc misspellings
Fix misspellings missed during regular reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-29 22:55:14 -04:00
Maureen Helm
4e5a316bb8 samples: blinky: Remove platform whitelist
Removes the platform whitelist so we test this sample on more than just
the arduino_101 board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-28 11:43:41 -05:00
Alberto Escolar Piedras
3e41ac5f04 subsys: shell: Add missing dependency to SERIAL
The shell subsystem, as it is today, depends on having a UART,
therefore let's add the dependency explicitly in its Kconfig

Fixes #10190

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-27 17:24:34 +02:00
Anas Nashif
6d3fb8b4cf shell: kernel: add more thread data to threads command
Show thread and stack data all under one command and reformat output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
2f30c5dcb8 samples: synchronisation: set thread names
- Use new k_thread_name_set to set thread names.
- Use board name in sample instead of architecture.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
739fd90127 samples: synchronization: remove unused conf
prj_stack_guard.conf not related to this sample, we have tests other
samples for stack guard testing/demonstration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
46f7cd51dd shell: kernel: print thread name
Use new kernel API to display thread name when listing threads.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Sebastian Bøe
c0287695fb kconfig: Remove remnants of unimplemented BUILD_TIMESTAMP feature
The Kconfig option CONFIG_BUILD_TIMESTAMP became unused when
BUILD_VERSION was introduced, but it's option and parts of it's
implementation was not completely cleaned from the repository.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-26 22:18:29 +05:30
Robert Lubos
a6de97b3a4 samples: net: sockets: Update docs with TLS information
Update documentation of socket samples that support TLS with information
on how to enable it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-26 18:13:34 +03:00
Paul Sokolovsky
e4fa2f5db7 samples: sockets: echo_client/server: Build for minimal libc
With recent changes, sockets no longer depend on Newlib libc, so
let's have actual samples which demonstrate this. echo_client/
echo_server, which were ported from net_app samples, are converted.
The rest of socket samples are intended to be buildable on a
POSIX system (e.g. Linux), so they rather stay with more
full-fledged libc.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-09-26 18:11:24 +03:00
Robert Lubos
b4d856397e samples: net: sockets: Use TLS overlay config file
Unify method of enabling secure TLS sockets in samples by using TLS
overlay config file instead of standalone config files.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-25 15:20:58 +03:00
Robert Lubos
743e64992b samples: net: sockets: Put echo samples configuration into single file
Avoid having not-necessarily board specific configs in a separate file.
Instead, have a single project file with appropriate overlay configs.
Board specific configurations can be added in future if needed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-25 15:20:58 +03:00
Johan Hedberg
cf6f87f25b Bluetooth: samples/peripheral_sc_only: Improve logging
The periphreal_sc_only sample app wasn't very clearly logging
information about pairing failures and could give the false
impression that everything work when it doesn't. Enable some more
logging Kconfig features and take advantage of the pairing complete &
failed callbacks to give more information to the user.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-24 10:48:40 +03:00
Anas Nashif
b3829adc78 samples: shell: enable kernel shell
Enable kernel shell and adapt test data and remove limited whitelisting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-23 11:43:33 -04:00
Erwan Gouriou
7ee8b7a512 samples: Provide x-nucleo-iks01a1 shield sample
This sample is made to demonstrate use of shield x-nucleo-ik01a1.
It will display embedded sensor data endlessly.
It requires a board with Arduino i2c as minimum configuration

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 18:51:26 -04:00
Sebastian Bøe
72e7bfa680 cmake: Remove unnecessary KCONFIG_ROOT configuration
It is no longer necessary to set the KCONFIG_ROOT variable when the
KConfig file is in the application root directory.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-21 13:37:21 -04:00
Johann Fischer
59a6ec44b7 drivers: apds9960: use power management
Use power management

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-09-21 09:02:00 -05:00
Johann Fischer
cc56de7005 samples: apds9960: rework APDS9960 sample
Rework APDS9960 sample.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-09-21 09:02:00 -05:00
Spoorthi K
58542d8d6c samples: Include regex matching in samples
Add harness console and include regex for output
pattern matching to determine correctness of
sample execution.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-09-21 00:40:44 -04:00
Ramakrishna Pallala
7e273b28c8 samples: subsys: power_mgr: Add changes as per PM policy Kconfig
Enable the CPU Residency based PM policy Kconfig option for
the sample application.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-09-20 10:20:23 -04:00
Piotr Zięcik
9331064ff9 arch: nrf52: Remove ARM_MPU_NRF52X option.
The ARM_MPU_NRF52X option is just selecting ARM_MPU option,
which could be also controlled through menuconfig.

This commit removes the ARM_MPU_NRF52X option and replaces
its usage by ARM_MPU option.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-09-20 14:16:50 +02:00
Jukka Rissanen
27d99d16f8 samples: net: sockets: echo_server: Add VLAN support
If user enables VLAN support, then the sample application will
create two extra VLAN network interfaces for testing purposes.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen
b17b1609ec samples: net: sockets: echo-client: Add VLAN support
Add support for VLANs which are disabled by default.
The application can be configured to use the VLANs by setting
the IP addresses properly in config file. The VLAN support in
this sample application is only meant for testing multiple network
interface handling.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen
b9fa6d4b22 samples: net: echo-client: Add VLAN support
Add support for VLANs which are disabled by default.
The application can be configured to use the VLANs by setting
the IP addresses properly in config file. The VLAN support in
this sample application is only meant for testing multiple network
interface handling.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen
3d83601661 samples: net: echo_server: Add VLAN support
If user enables VLAN support, then the sample application will
create two extra VLAN network interfaces for testing purposes.

The application can be compiled like this for VLAN support:

  cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Daniel Leung
79e8f79498 boards/x86: up_squared: add sample app for GPIO
This adds a sample app to utilize GPIOs on the UP Squared
board.

Origin: Original

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-19 21:36:16 -04:00
Krzysztof Chruscinski
ba808d789e samples: subsys: shell: Port sample to new shell subsystem
Ported shell sample to use new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Krzysztof Chruscinski
527256501f shell: Rename shell to legacy_shell
New shell implementation is on the way. For now old one and all
references are kept to be gradually replaced by new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Maureen Helm
a0efbf3c9c samples: bme280: Disable i2c in spi project configuration
The spi project configuration was incorrectly enabling i2c, which causes
a cmake failure if a board supports spi but not i2c. Found by CI when
adding spi support to the mimxrt1050_evk board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-19 09:15:29 -04:00
Johannes Hutter
8c8de70f6e samples: blink_led: add support for nRF boards
Add support for nRF boards by using the software-based PWM driver. The
prescaler has to be configured so that the clock runs slower in order to
make the on-board LED blink in the way it is described in the Readme.

Signed-off-by: Johannes Hutter <johannes@proglove.de>
2018-09-19 09:15:11 -04:00
Anas Nashif
006ca97006 samples: openamp: build with ninja
Fixed building with ninja adding BUILD_BYPRODUCTS based on suggestion
from @SebastianBoe in issue #7760.

Fixes #7760

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-18 23:14:38 -04:00
Alberto Escolar Piedras
169cab0902 sample: subys: logging: fix for posix arch
In the POSIX arch, time does not pass inside infinite loops.
=> Add a small delay in each iteration of those loops
when compiled for it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-18 14:56:10 +02:00
Anas Nashif
e36c7f5b2b samples: hello world: print board name
Use CONFIG_BOARD instead of CONFIG_ARCH.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:46:24 -04:00
Anas Nashif
47c20d6ece sample: we have dedicated test for single thread
No need for this here in this sample.
Remove CONFIG_SCHED_MULTIQ which was added by mistake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:46:24 -04:00
Aurelien Jarno
8ec537dc40 samples: nvs: improve one output message, fix another one
Fix the Id of the longarray message.

Also change the display of the "Address" entry to use "Id" instead of
"Entry" to be consistent the other displayed entries.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Kumar Gala
236a2d6f13 dts: arm: nrf: Remove use of CONFIG_SOC_* from Nordic dts files
To move forward and remove use of Kconfig in dts files lets just create
SoC specific dtsi files that the boards can include.  This lets us
remove:

CONFIG_SOC_NRF51822_QFAA
CONFIG_SOC_NRF51822_QFAB
CONFIG_SOC_NRF51822_QFAC
CONFIG_SOC_NRF52810_QFAA
CONFIG_SOC_NRF52832_QFAA
CONFIG_SOC_NRF52832_CIAA
CONFIG_SOC_NRF52832_QFAB
CONFIG_SOC_NRF52840_QIAA

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-15 15:33:43 -05:00
Flavio Ceolin
da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Krzysztof Chruscinski
4add83c5e2 samples: subsys: logging: example of kconfig.log_template usage
Logger sample extended to use template for configuration of
sample module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-14 12:32:56 -04:00
Anas Nashif
81b272119a docs: fixed documenation pointers
Fixed URL to documentation, now latest docs are under /latest/..
Fixes #9932

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-12 12:03:18 -04:00
Carles Cufi
ef7a2318bb samples: shared_mem: Reduce CMake required version to 3.8.2
There is no reason why this sample should have a higher version required
of CMake in order to build.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-09-12 09:45:19 -04:00
Vikrant More
ccade20ccf samples: mesh: nrf52: corrected Range status response
As per PTS, IUT is expected to return success for the
Range Get messages (Light Lightness Range Get for
MMDL/SR/LLNS/BI-01-C, Light CTL Temperature Range Get
for MMDL/SR/LCTLS/BI-01-C). This commit take care of
this issue.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
09e2cf3db0 samples: mesh: nrf52: corrected state Binding for Delta Level
Now if transition (instantaneous or non-instantaneous) is due
to delta level, then state binding would be as per it.

This is as per 3.3.2.2.3 of Bluetooth Mesh Model
Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
be27afb705 samples: mesh: nrf52: corrected spelling
Corrected spelling mistakes for content of enum defined in
transition.h & renamed some functions. Corrected comments
in main.c

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
864ebaaba6 samples: mesh: nrf52: revised status resp. behaviour & TT calculation
With this it is possible to get proper target value & remaining
time in status response from Servers when transition in progress.
If transition is not in progress then those things would not
get integrate into status response. This is as per Bluetooth
Mesh Model specification.

It is inspired concept from Bluetooth Mesh Developer study
Guide.

Also updated Transition Time (TT) related parameter calculation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
6858cb417d samples: mesh: nrf52: corrected conditional compilation
Corrected conditional compilation directives defined in
publisher.c

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
c805beeaaa samples: mesh: nrf52: initialized dev_uuid to some arbitrary value
Initialized dev_uuid defined in ble_mesh.c to some arbitrary value.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
89f00e6426 samples: mesh: nrf52: upgrade README.rst
Added Generic Default Transition Time Server & Client
Models names in list of Models supported by this App.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Paweł Zadrożniak
7c2197f2d8 boards: nrf: uart: Moved UART pin configuration to DTS (nRF boards)
UART pins (TX, RX, RTS, CTS) are now configured in DTS files.
RTS and CTS definitions are optional. If flow control is enabled
and RTS/CTS pins are not defined, then compiler will issue
an error message.

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2018-09-11 23:29:50 -05:00
Ulf Magnusson
d713033d5c Kconfig: Use new preprocessor syntax for env. variables
With the new Kconfig preprocessor (described in
https://github.com/torvalds/linux/blob/master/Documentation/kbuild/
kconfig-macro-language.txt), the syntax for expanding environment
variables is $(FOO) rather than $FOO.

$(FOO) is a general preprocessor variable expansion, which falls back to
environment variables if the variable isn't set (like in Make). It can
also be used in prompts, 'comment's, etc.

The old syntax will probably be supported forever in Kconfiglib for
backwards compatibility, but might as well make it consistent now that
people might start using the preprocessor more.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 19:17:25 -04:00
Daniel Leung
7a1ec635d0 doc: convert internal http links to references
This converts the http links within the Zephyr document
into references. This allows the links within the PDF file
to jump to the correct sections instead of going to
the Internet.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-11 14:55:43 -04:00
Kumar Gala
4fede8dd0b log: make name param explicit
Rather than having some implied name for the logging name, explicitly
pass it in the macros LOG_MODULE_REGISTER & LOG_MODULE_DECLARE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-11 13:25:55 -05:00
Emanuele Di Santo
ea4f8b7d6c samples: nrf52: power_mgr: use dts-generated defines
This commit updates the power_mgr sample to use the dts-generated
defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Emanuele Di Santo
0a15793830 samples: nrf52: onoff-app: use dts-generated defines
This commit updates the onoff-app sample to use the dts-generated
defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Emanuele Di Santo
7fb051bc72 samples: nrf52: onoff_level_lightning_vnd_app: use dts-generated defines
This commit updates the onoff_level_lightning_vnd_app sample
to use the dts-generated defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Emanuele Di Santo
53cd7c2496 samples: basic: button: use dts-generated defines
This commit updates the button sample to use the dts-generated
define to configure the button pull-up when the custom define
is not present.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Gil Pitney
844e6f5a2e samples: net: sockets: echo: enable socket offload for cc3220sf_launchxl
Add a prj conf file for the TI cc3220sf_launchxl board
to enable socket offload to the simplelink WiFi driver.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-09-11 18:42:34 +03:00
Shawn Mosley
26c51c43d0 userspace: sample app domain applications
Added a sample using the app_memory submodule to protect memory
used by three threads.

Signed-off-by: Shawn Mosley <smmosle@tycho.nsa.gov>
2018-09-11 09:17:37 -04:00
Filip Kubicz
5c3992f34f dts: update I2C bindings for nRF chips
Change 'nRF5' family names to 'nRF' in I2C DTS.

Signed-off-by: Filip Kubicz <filip.kubicz@nordicsemi.no>
2018-09-11 11:41:37 +02:00
Andrei Emeltchenko
e02dcf2545 samples: lldp: Add simple parsing to sample
Add simple parsing using LLDP RX API

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-09-11 10:55:01 +03:00
Jukka Rissanen
c4cc8a5f3e net: if: Refactor IPv6 address lifetime timer
Refactor IPv6 address lifetime timer setting in net_if_addr to support
longer lifetime than 24 days.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-11 10:53:30 +03:00
Flavio Ceolin
f6210cf430 samples: drivers: crypto: Fix minimum values for mbedTLS
The latest mbedTLS (2.12) release increased resources requirements on
Zephyr, so it was required increasing the minimum SRAM to run this test
and the main stack size.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-06 21:11:31 -04:00
Flavio Ceolin
8b70ace563 crypto: tests: Change crypto tests to use Kconfig defined header
While it's possible to define which mbedTLS config header to use, our
samples should use config-tls-generic.h as default because this header
is configurable through Kconfig.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-06 21:11:31 -04:00
Daniel Leung
0340d66847 samples: grove: re-add Quark D2000 to sample.yaml
Since we now have a working ADC driver for Quark D2000,
add the whitelist back.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-05 18:38:57 -04:00
Ravi kumar Veeramally
42c19497b6 samples: net: coap: Remove apps using raw mbedtls APIs
This removes these network sample applications
  samples/net/coaps_client
  samples/net/coaps_server

as they are using low level mbedtls APIs. You should use
preferably socket based or net-app based applications.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-09-04 16:17:37 -04:00
Ravi kumar Veeramally
9c605c1711 samples: net: Fix out-of-bound access
Payload variable can hold max 64 bytes but value of size can be more
than that. Memsetting using value of size can overrun payload array.
Fixes coverity issue.

Coverity-CID: 187823
Fixes: #9638

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-09-04 08:10:18 -04:00
Jukka Rissanen
385345218d samples: net: mbedtls: Remove apps using raw mbedtls APIs
This removes these network sample applications

  samples/net/mbedtls_sslclient
  samples/net/mbedtls_dtlsserver
  samples/net/mbedtls_dtlsclient

as they are using low level mbedtls APIs. You should use
preferably the samples/net/sockets/echo_[server|client] applications
instead, or as a last option use net-app based applications
in samples/net/echo_[server|client] if needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-30 14:27:33 -04:00
Luiz Augusto von Dentz
4e208b24bd Bluetooth: IPSP: Fix pointing to invalid file
sample/net/README no longer exists so this removes its mention since
it is already described how to use echo-client at the end of the
document. Also state that CONFIG_BT_6LOWPAN shall be set in order to
use Bluetooth 6LoWPAN module with Linux.

Fixes #9727

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-08-30 09:25:30 -04:00
Punit Vara
108b5398e4 tests: adc_api: Remove sample width test scenario
Remove unnecessary sample width scenario.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
094531bf9f samples: grove_temperature: Use device name from Kconfig
Use Kconfig to get device name. Make LIBC conditional to get
output.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
52339f4b1d samples: grove_light: Provide device name from Kconfig
check return value for sample fetch. Conditional printk
added to print adc value.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Diego Sueiro
9255bf5f7f gpio: Use GPIO_FLAGS instead of GPIO_INT_CONF
Rename GPIO_INT_CONF to GPIO_FLAGS in order to be able to use
the definition generated by the devicetree, eliminating the need
for definition in the board.h file

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-29 08:49:29 -04:00
David B. Kinder
1d1a4b321b doc: fix misspellings in reST files
Fix misspellings missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-28 13:59:38 -04:00
Michael Scott
3b80998ff2 net: lwm2m: correct Copyright to Foundries.io
Due to a change in the company name, the LwM2M copyrights need
to be changed from "Open Source Foundries Limited" ->
"Foundries.io".

Signed-off-by: Michael Scott <mike@foundries.io>
2018-08-27 19:29:16 -04:00
Maureen Helm
42c5d519b1 samples: mpu_stack_guard_test: Update console output in README
The fault dump text has changed since this sample was originally
written, so update the README accordingly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-27 16:24:48 -04:00
Maureen Helm
3ef2cc66c0 samples: mpu_stack_guard_test: Fix yaml regexes
The mpu_stack_guard sample was failing in both configurations on arm
platforms. Fix the regexes in sample.yaml so they work on multiple
architectures.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-27 16:24:48 -04:00
Maureen Helm
7976d2b564 samples: nvs: Use flash erase block size from dts
The nvs sample assumed a 1 KB flash erase block size, which caused the
sample to fail on frdm_k64f because its erase block size is 4 KB. Get
the erase block size from dts instead.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-27 12:49:32 -04:00
Maureen Helm
9039d6fd6e samples: nvs: Use depends_on to select platforms
Removes the platform whitelist, leaving just the depends_on/supported
pattern to select which platforms the sample can run on.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-25 07:13:56 -07:00
Maureen Helm
f2662acd90 samples: nvs: Allow mpu flash write
Make this sample work on mpu-enabled platforms by configuring the mpu to
allow flash writes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-25 07:13:56 -07:00
Radoslaw Koppel
0d0b221efa samples: bluetooth: peripheral_hids: Add settings module
This commit adds settings module to the peripheral_hids that makes
bonding persistent.
Now it is possible to connect with previously bonded device.

Fixes #9580

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-08-23 15:29:46 +03:00
Gil Pitney
a4cc88ad30 samples: net: sockets: echo-client: fix sock fd test, allow zero.
Per: http://pubs.opengroup.org/onlinepubs/009695399/functions/socket.html
"Upon successful completion, socket() shall return a non-negative
integer, the socket file descriptor."

The test in prepare_fds() however fails if socket fd is
zero (non-negative), which should be a valid value.

This was found while testing the SimpleLink socket offload driver,
which can return a zero-valued socket fd, per the POSIX spec.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-08-22 15:37:15 -07:00
Ramakrishna Pallala
b69d286180 samples: subsys: Add sample app to demo OS managed PM
Add a sample application to demonstrate OS managed
Power Management framework.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-08-22 08:07:14 -07:00
Michael Hennerich
84c352d0f3 samples: sensor: adxl372: Add ADXL372 sample application
This sample application produces slightly different outputs based on
the chosen driver configuration mode. In Measuring Mode with trigger
support, the acceleration on all three axis is printed in m/s^2 at
the sampling rate (ODR). In polled Measuring Mode the instantaneous
acceleration is polled every 2 seconds. In most high-g applications,
a single (3-axis) acceleration sample at the peak of an impact event
contains sufficient information about the event, and the full
acceleration history is not required.
In this Max Peak Detect Mode the device returns only the over
threshold peak acceleration between two consecutive sample fetches or
trigger events. Instead of printing the acceleration on all three axis,
the sample application calculates the vector magnitude
(root sum squared) and displays the result in g rather than in m/s^2,
together with an bar graph.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
2018-08-21 20:19:44 -05:00
Diego Sueiro
22b61c7f43 sensors: add WaRP7 board listing for fxos8700 and fxas21002
Update yaml files to include warp7_m4 board in the platform_whitelist
for fxos8700 and fxas21002 sensors.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-21 18:54:41 -05:00
Anas Nashif
aa81a92213 tests: build philosophers sample with systemview
Build sample with sysview enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Anas Nashif
a2248782a2 kernel: event_logger: remove kernel_event_logger
Move to more generic tracing hooks that can be implemented in different
ways and do not interfere with the kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Anas Nashif
457fc799ba samples: debug: remove sysview sample
We will implement this as a core feature using tracing points and make
it available to any application.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Anas Nashif
3f02e0d5d3 samples: remove kernel_event_logger sample
We are replacing kernel_event_logger with a more generic tracing API.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Karol Lasończyk
c9e3c938e6 tests/samples: watchdog: Update projects' configuration
WDT_NRFX is now enabling by default. Its configuration from proj.conf
files was removed.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2018-08-20 06:38:02 -07:00
Karol Lasończyk
6c669ace6e samples: watchdog: Update watchdog example to new API
Watchdog example is updated to use new watchdog API.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2018-08-20 06:38:02 -07:00
Ulf Magnusson
bd01344aa0 samples/net/lldp/Kconfig: Get rid of leftover 'option env'
'option env' is no longer required. Kconfiglib expands references to
environment variables directly.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-18 07:54:20 -07:00
Johann Fischer
c9c8bbf255 samples: apds9960: whitelist reel board
Whitelist reel board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-08-17 13:19:20 -07:00
Johann Fischer
1f19078ebf samples: apds9960: whitelist arduino_101_sss
Whitelist arduino_101_sss.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-08-17 13:19:20 -07:00
Mieszko Mierunski
4f6aac1a67 dts: nrf5: Changed GPIO and GPIOTE define names
Changed names using nrf5 to nrf for consistency with other drivers.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-08-17 07:29:14 -07:00
Mieszko Mierunski
15813d343c boards: nrf: Changed GPIO default driver to NRFX shim
I removed GPIO configuration from board files and enabled them
as default in driver Kconfig file. All boards had GPIO ports
enabled that is why I decided to enable it by default.

Power management example was changed to use new driver.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2018-08-17 07:29:14 -07:00
Robert Lubos
d529aef9f2 net: tls: Apply DTLS review fixes
This commit contains several fixes for DTLS implementation, proposed in
a post-merge review of #9338.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-08-17 15:10:00 +03:00
Jukka Rissanen
eeabc2ba3d net: if: Lower ram usage for IP address lifetime handling
Instead of having one delayed_work struct / IP address, use
only one delayed_work struct for lifetime timer. This saves
over 20 bytes / allocated address struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-17 13:36:59 +03:00
Anas Nashif
5d9e818994 samples: hello_world: remove single thread variant
This now has a dedicatd test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-16 13:20:53 -07:00
Johan Hedberg
f5026a11c9 samples/mesh: Fix dev_uuid initialization from identity address
With the recent changes to identity address handling the local
identity address is only guaranteed to be available once
settings_load() has been called. Move the initialization of dev_uuid
to the appropriate place.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-16 22:39:36 +03:00
Anas Nashif
36ef19217f samples: led_lp5562: cmake_minimum_required added
Add missing cmake_minimum_required()

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-16 08:39:55 -07:00
Johannes Hutter
f8d53e5d20 samples: drivers: Add sample application for LP5562
Add a sample application to show the LP5562 driver. The three RGB
channels are used to set multiple colors after each other under the
assumption that accordingly colored LEDs are connected. Blinking is also
shown in multiple colors.

Signed-off-by: Johannes Hutter <johannes@proglove.de>
2018-08-16 06:28:53 -07:00
Vikrant More
0aafcd6453 samples: mesh: nrf52 : to solve remaining PTS issues
Fixed coding style issues. Corrected conditional compilation
using pre-processor directives at proper location.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-08-15 21:28:49 +03:00
Kumar Gala
ebc3ce3a0e Revert "log: make name param explicit"
This reverts commit 2cb17a0332.  It
doesn't handle the dynamic logging case and thus breaks things.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-08-15 11:19:46 -05:00
Kumar Gala
2cb17a0332 log: make name param explicit
Rather than having some implied name for the logging name, explicitly
pass it in the macros LOG_MODULE_REGISTER & LOG_MODULE_DECLARE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-08-15 09:41:02 -05:00
Sebastian Bøe
55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
Vikrant More
993c349a8a samples: mesh: nrf52: Transition Time support, Coding Style
Added transition time support. Now if NODE received optional
parameters then they would get entertained by it.

Added two new models that is Generic Default Transition Time
Server & Client resp. to complete overall architecture to
support newly introduced architecture.

With this it was possible to implement
gen_move_set/gen_move_set_unack message handlers.

Removed redundancy from App & revised overall implementation.
Fixed Bugs. Upgraded coding style. Added & replaced comments to
improve code readability. Improved printk messages.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-08-15 09:09:29 +03:00
Vikrant More
6efb173edb samples: mesh: nrf52: Time filtering, Coding style & others
Added time stamp based message filtering as per Bluetooth Mesh
Developer study guide for each Server. Now even if message
source address & TID is same even after 6 seconds then
that will get proceed otherwise will get ignored.

Coding style improvements.

If particular Server model receive Prohibited values as per
Mesh Model Specification then that message will not get entertained.

Now proper status code will get send if user upgrade
light_lightness_range_state & light_ctl_temperature_range_state.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-08-15 09:09:29 +03:00
Vikrant More
26322d651b samples: mesh: nrf52: upgrade state binding
Upgraded state binding algorithm & created separated
file for it. Moved light_default_status_init() from
device_composition.c to main.c. Shorten variables names
defined in struct light_lightness_state.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-08-15 09:09:29 +03:00
Krzysztof Chruscinski
3c63d05dfc logging: Add metadata to hexdump
Extended hexdump API with a raw string attached to the data.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-08-14 07:14:34 -07:00
Jukka Rissanen
38323783f0 samples: net: echo-server: Handle net_buf out-of-mem gracefully
Do not wait forever for network buffers when receiving data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-14 12:17:00 +03:00
Jukka Rissanen
b8b230f2e8 samples: net: echo-client: Handle net_buf out-of-mem gracefully
Do not wait forever for network buffers when receiving data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-14 12:17:00 +03:00
Subramanian Meenakshi Sundaram
df20ebd64a samples: boards: Fix incorrect min max range validation
Fixing the min max range validation where condtions on
upper and lower bound are logically 'ANDed'. Fixing it
by logical ORing the result.

CID: 18325, 18326
Fixes Issue #9289
Fixes Issue #9290

Signed-off-by: Subramanian Meenakshi Sundaram <subbu147@gmail.com>
2018-08-13 19:35:13 -07:00
Paul Sokolovsky
028aae1ec9 net: config: Rename Kconfig options to correspond to library name
This finishes refactor of splitting off net_config library name from
net_app library, started in c60df1311, c89a06dbc. This commit makes
sure that Kconfig options are prefixed with CONFIG_NET_CONFIG_
instead of CONFIG_NET_APP_, and propagates these changes thru the
app configs in the tree.

Also, minor dependency, etc. tweaks are made.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-13 18:42:31 -07:00
Johan Hedberg
5708f1e8b1 Bluetooth: Add infrastructure to handle multiple identities
Make it possible to have multiple identity addresses as an LE
peripheral. For central role only the default identity is supported
for now. This also extends the flash storage in a backward compatible
way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-13 19:53:22 +03:00
Robert Lubos
b7c254fc40 samples: net: Add DTLS support to socket echo_client/echo_server
Add DTLS support to socket echo_client and echo_server samples.

Additionally, move TLS-related configs to overlay-tls.conf config file,
to align with other examples.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-08-13 15:24:34 +03:00
ravishankar karkala Mallikarjunayya
d71a1dfefd samples/driver/gpio : Updated gpio support
Updated gpio configuration for all boards

Signed-off-by: ravishankar karkala Mallikarjunayya <ravix.shankar.km@intel.com>
2018-08-12 06:57:55 -07:00
Laczen JMS
7d2e59813f subsys: fs/nvs: Rewrite for improved robustness
On flash NVS was stored one entry after another including the metadata
of each entry. This has the disadvantage that when an incomplete write
is performed (e.g. due to power failure) the complete sector had to be
rewritten to get a completely functional system.

The present rewrite changed the storage in flash of the data. For each
sector the data is now written as follows: the data itself at the
beginning of the sector (one after the other), the metadata (id, length,
data offset in the sector, and a crc of the metadata) is written from
the end of the sector. The metadata is of fixed size (8 byte) and for
a sector that is completely occupied a metadata entry of all zeros is
used.

Writing data to flash always is done by:
1. Writing the data,
2. Writing the metadata.

If an incomplete write is done NVS will ignore this incomplete write.

At the same time the following improvements were done:
1. NVS now support 65536 sectors of each 65536 byte.
2. The sector size no longer requires to be a power of 2 (but it
still needs to be a multiple of the flash erase page size).
3. NVS now also keeps track of the free space available.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2018-08-10 14:16:06 -07:00
Laczen JMS
b9dead0a42 subsys: fs/nvs: Improved nvs for larger blocksizes
The nvs module has some disadvantages for larger block size. The data
header and slot are taking up to much space. A rewrite is proposed that
reduces the used storage space for systems with write block size > 4.

The data storage in flash is now one unit consisting of: data_length,
data_id, data and data_length again in a multiple of the write block
size. The data_length at the end is used to validate the correctness of
the flash write and also allows to travel backwards in the filesystem.

As a comparison, on a system with block size 8 byte, a 32 bit values
now fits 1 block including the metadata (length and id). This used to
be 3 blocks.

The data_length will occupy 1 byte if the data length is less than 128
byte, it will occupy 2 byte if the data length is 128 byte or more. The
data length is limited to 16383 byte.

Each write to flash is verified by a read back of the data.

The read performance is improved because reading is done backwards so
the latest items are found first.

When the filesystem is locked it can be unlocked by calling
reinit(), this will clear flash and setup everything for storage.

add sample documentation - README.rst

Update dtsi to include erase_block_size, use erase_block_size in sample

Update prj.conf to include CONFIG_MPU_ALLOW_FLASH_WRITE

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2018-08-10 14:16:06 -07:00
Ulf Magnusson
a8aba2f8d0 Kconfig: Include Kconfig.zephyr last in sample Kconfig files
This will make adding properties to symbols in the base Zephyr Kconfig
files work the same as before.

I didn't actually spot any such cases, so this is just to play it safe.
It also makes the sample Kconfig symbols appear at the top in the
menuconfig interface, which might be nice.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-10 12:38:28 -07:00
Ulf Magnusson
3ed9328d33 Kconfig: Get rid of some leftover 'option env's
These are no longer required. Kconfiglib expands references to
environment variables directly.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-10 12:38:28 -07:00
Sebastian Bøe
b9e8cd1133 cmake: Refactor usage of target_link_libraries on Zephyr libraries
CMake has several prototypes/signatures for the function
'target_link_libraries'. This commit migrates the usage of
'target_link_libraries' on Zephyr CMake libraries from the old 'plain'
signature to the new '<PRIVATE|PUBLIC|INTERFACE>' signature.

For technical reasons the two signatures can not be mixed. Each
library must exclusively use either the old or new signature.

The 'old' plain signature is equivalent to using the PUBLIC
signature. Migrating to use 'PUBLIC' is therefore expected to be a
safe change.

After the migration it will be possible to use the PRIVATE and
INTERFACE signatures on Zephyr CMake libraries. This is useful for
instance to fix issue 8438.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-09 14:03:10 +02:00
Carles Cufi
957262e37d build: Replace GCC ARM Embedded with GNU Arm Embedded
The old GCC ARM Embedded website on launchpad
(https://launchpad.net/gcc-arm-embedded) has been superseeded by the new
GNU Arm Embedded one
(https://developer.arm.com/open-source/gnu-toolchain/gnu-rm).

This also means a change of name from "GCC" to "GNU". Reflect this in
the enviroment variables so that the proper term is used henceforth.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-08-09 13:57:55 +02:00
David B. Kinder
2300a5929f doc: fix errors in ipv4_autoconf sample doc
Some reST syntax errors and doc edits got missed during the review
of PR #561 causing problems in the generated HTML.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-09 09:53:15 +03:00
Andrzej Puzdrowski
a564e640e3 samples: subsys: mgmt: mcumgr: smp_svr: documentation update
This patch aligns documentation to changes in imagetool.py released
in mcuboot 1.2 (latest release).

Also adds note about workaround for possible timeout while erasing
image-slot on some devices (like nRF52840 SoC)

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-08-08 10:12:28 +02:00
Jukka Rissanen
c162bad3af samples: net: lldp: Sample application that enables LLDP support
The application does nothing useful, it just enables Link Layer
Discovery Protocol support which starts to send LLDP network packets
to ethernet network interface. Note that the LLDP packets are only
sent to those network interfaces that claim to support LLDP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-08 09:53:24 +03:00
David B. Kinder
6750b8d2e8 doc: fix misspellings in docs
Occasional scan for misspellings missed during normal doc reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-08 01:49:14 -05:00
Michael Scott
0b0122571c samples: net: lwm2m: cleanup prj.conf
- Remove NET_LOG / NET_BUF_LOG settings, instead just enable SYS_LOG
- Simplify by also removing SYS_LOG_SHOW_COLOR, INIT_STACKS and
  NET_STATISTICS.  These can be enabled by user if wanted/needed.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-08-07 14:41:48 +03:00
Jukka Rissanen
b4e36133c2 drivers: eth: native_posix: Exec program after creating zeth
Allow user to configure a program that is executed after the
network interface is created and IP address is setup.
This can be used e.g., to start wireshark to capture
the network traffic of the interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-06 14:20:51 +03:00
Ravi kumar Veeramally
3e27187e00 samples: net: coaps_client: Increase IPv6 mcast table size
Default value 2 was not enough for mcast addresses table.
Core stack adding mcast addresses on various reasons. Also
coaps_client trying to create mcast context for some purpose.
mcast address is not in lookup table, so binding fails. Add
CoAP sample related mcast address to table and then bind the
context.

Fixes #9131

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-08-06 12:42:57 +03:00
Michael Scott
926c341c78 samples: net: lwm2m: add wnc-m14a2a overlay .conf file
Let's add an overlay file to enable using the WNC-M14A2A LTE-M
modem with the LwM2M client.

Also, update documentation for it's use.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-08-06 10:43:46 +03:00
Szymon Janc
504584a998 Bluetooth: att: Add option to disable GATT writable name
This allow to set name at runtime while leaving GAP name characteristic
read only.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2018-08-03 10:41:01 +02:00
Lars Knudsen
70a35e2346 samples: sensors: mma8451q: Add accelerometer sample
Prints accelerometer data from MMA8451Q every 500ms

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
2018-07-31 09:07:54 -05:00
Jukka Rissanen
fd1fec8ad6 samples: net: IPv4 autoconf sample application
Adding IPv4 autoconf sample application that can be used to
test IPv4 autoconf functionality.

Signed-off-by: Matthias Boesl <matthias.boesl@gmail.com>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-31 16:34:28 +03:00
Johan Hedberg
c761002e30 samples: net/mqtt_publisher: Explicitly disable BT_TINYCRYPT_ECC
This app will not fit in the 96b_nitrogen board with ECC enabled.
"real-ld: region `SRAM' overflowed by 68 bytes". Disable the feature
explicitly since a subsequent patch will auto-enable it for all
combined Bluetooth Host-Controller builds.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-31 13:55:40 +03:00
Robert Lubos
9f817c8c1c samples: net: Allow to register more adresses for OpenThread
Thread registers multiple unicast and multicast adresses by default. As
they are exchanged with Zephyr interface, we need enough buffers to
store them all.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-31 11:13:04 +03:00
Anas Nashif
87de383c66 tests: CONFIG_ARC_INIT is n by default
CONFIG_ARC_INIT is set to 'n' by default, no need to set this in the
prj.conf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-30 15:17:51 -04:00
Anas Nashif
00dd90efc7 samples: ipm: improve sample metadata
Improve meta-data and whitelist for Quark SE c1000 only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-30 15:17:51 -04:00
Armando Visconti
aa609faab3 samples: board: 96b_argonkey: remove led blinking
The LED part is taking too much time. Let's skip the
led blinking part.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-07-30 09:20:00 -05:00
Jukka Rissanen
9834b551c9 samples: net: gptp: Add support for Atmel SAM E70 Xplained board
Enable PTP clock for GMAC driver if compiled for SAM E70 board.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-27 20:29:15 +03:00
Robert Lubos
29b65859b1 net: samples: Add TLS support to socket echo_client/echo_server
This commit adds TLS support to socket echo_client/echo_server samples.

Credentials used are the same as in the non-socket versions of these
samples, therefore they can be easily tested with net-tools utils.

Maximum payload size for the client was sligtly reduced to fit the
encrypted data within 1280 bytes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-26 12:13:15 -04:00
Robert Lubos
50631b3501 net: samples: Add CA certificates to http_get and big_http_download
Add CA certificates to http_get and big_http_download samples. Use
socket options to configure TLS connection - TLS certificates are now
validated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-26 12:13:15 -04:00
Johan Hedberg
8c1c1641fe Bluetooth: Mesh: Improve outgoing segment count configuration
The Mesh specification doesn't support more than 32 transport layer
segments, the way the number was so far derived from the advertising
buffer count could result in a highre numbe than 32, thereby wasting
memory. Make the number of supported segments build-time configurable
through a new BT_MESH_TX_SEG_MAX configuration option.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-25 18:16:45 +03:00
Johan Hedberg
d26e482dab Bluetooth: Mesh: Use more reasonable advertising buffer counts
The number of buffres influences e.g. the maximum SDU size, which in
turn influences call stack consumption. Use lower values where a high
number of buffers isn't necessary, and use the default (6) where it's
sufficient.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-07-25 18:16:45 +03:00
Ramakrishna Pallala
9a68fea98c samples: boards: quark_se_c1000: Do not enter LPS states on test exit
Do not enter Low Power states once the test execution is done. This
is needed to avoid the flashing issues which were seen when system
is in deep sleep states.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-07-25 07:21:17 -04:00
Jukka Rissanen
a1594472f2 samples: net: echo-client: Add overlay config support
Refactor the prj*conf files so that there is only one master
prj.conf and several overlay conf files that add / change
only minor subset of functionality.

Use the overlay files like so:
    cmake -DBOARD=nrf52840_pca10056 \
          -DOVERLAY_CONFIG=overlay-ot.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-25 12:42:36 +03:00
Robert Lubos
6c30f5955e samples: net: Fix incorrect error check in echo_server
The logic for error checking after net_pkt_pull was inverted -
build_pkt_reply would exit in case net_pkt_pull succeeded. In result no
responses were sent by echo_server.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-24 17:26:54 +03:00
Jukka Rissanen
af34779510 samples: net: tp: Avoid compiler warning
If -fno-strict-overflow compiler flag is disabled, then this warning
is printed:

samples/net/throughput_server/src/server.c:157:6: \
  error: assuming signed overflow does not occur when assuming \
  that (X + c) >= X is always true [-Werror=strict-overflow]
     if (new_print > curr) {

Fixes #8924

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-24 09:20:46 -04:00
Jukka Rissanen
c5095797b9 samples: net: Add promiscuous mode application
Simple application that sets all the network interfaces into
promiscuous mode.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-24 15:12:37 +03:00
Jukka Rissanen
72f75e52e1 samples: net: echo-server: Add overlay config support
Refactor the prj*conf files so that there is only one master
prj.conf and several overlay conf files that add / change
only minor subset of functionality.

Use the overlay files like so:
    cmake -DBOARD=nrf52840_pca10056 \
          -DOVERLAY_CONFIG=overlay-ot.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-24 15:11:09 +03:00
Ravi kumar Veeramally
2807e5c1c6 samples: net: echo_server: Fix building of echo replies
If echo-server receives a IPv6 packet with large header (e.g HBHO)
build_reply_pkt() function failed to remove IPv6 header. Reason is
net_buf_pull() doesn't work if header length is more than one
fragment. net_pkt_pull() solves the issue.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-07-23 15:01:09 +03:00
Luiz Augusto von Dentz
a8688fc587 Bluetooth: peripheral: Set CONFIG_BT_DEVICE_NAME_MAX
This force CONFIG_BT_DEVICE_NAME_MAX to be set even in boards where
CONFIG_BT_SETTINGS won't be defined so it exercise such configuration.

In addition to that set a long name that would not fix in the
ScanData.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-23 14:45:58 +03:00
Luiz Augusto von Dentz
2e2f122d51 Bluetooth: samples: Make use of BT_LE_ADV_OPT_USE_NAME
Use BT_LE_ADV_OPT_USE_NAME whenver possible since it does properly
track updates.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-07-23 14:45:58 +03:00
Subramanian Meenakshi Sundaram
7479cc2ee8 samples: net: Fix incorrect use of ipv4 in ipv6 branch
Fixing copy paste error, where ipv4 member of
the structure is used in ipv6 branch.

CID: 187074
Fixes Issue #8992

Signed-off-by: Subramanian Meenakshi Sundaram <subbu147@gmail.com>
2018-07-20 12:06:11 +03:00
Piotr Zięcik
2fe998cdef kernel: Deprecate sys_clock_us_per_tick variable.
On some architectures tick time cannot be expressed as integer
number of microseconds, introducing error in calculations using
sys_clock_us_per_tick variable.

This commit deprecates the sys_clock_us_per_tick variable and
replaces its usage by more precise calculations based on
sys_clock_hw_cycles_per_sec and sys_clock_ticks_per_sec.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-07-20 00:03:52 -04:00
Krzysztof Chruscinski
86b5edc4d0 logging: Internal processing thread enabled by default
Enabling internal processing thread allows implicit initialization
and processing log messages in case mutlithreading is enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-19 09:50:18 -04:00
Robert Lubos
7b8b09bde4 samples: net: Explicitly ignore socket close return value
Fixes #8994

Coverity ID :187072

Explicitly ignore return value of socket close.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-18 19:51:17 +03:00
Anas Nashif
4208642a53 samples: fix u32_t type usage
We have been mixing u32_t and uint32_t. Using u32_t when the API expects
something else.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-18 12:32:23 -04:00
Andrei Emeltchenko
29a757a814 samples: wpanusb: Remove old dead code
Remove old unused code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-18 08:23:00 -04:00
Jukka Rissanen
e30c3096b2 samples: net: gptp: Add support for FRDM-K64F board
Enable PTP clock for MCUX driver if compiled for FRDM-K64F board.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-18 07:37:41 -04:00
Diego Sueiro
d370391e2e samples: Add colibri_imx7d_m4 config in blink_led
Adds the appropriated configuration for colibri_imx7d_m4 board in
blink_led sample app.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-07-17 16:08:22 -05:00
Michael Scott
8fe9f5b4f8 samples: net: wpanusb: fix sanitycheck
With the change to the configuration files, we can now compile
this sample for any platform that uses only the default prj.conf file:
nrf52840_pca10056
nrf52840_pca10059
usb_kw24d512

Update the sample.yaml file to remove the excludes.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Michael Scott
7df65c15d6 samples: usb: wpanusb: update README to rst format
Let's rename README to README.rst and add:
- Some nice formatting for existing content
- Requirements section (including handy links)
- Build and Running section (including multiple overlay options)

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Michael Scott
15d46ddb87 samples: usb: wpanusb: add MCR20A overlay config
Add support for NXP MCR20A 802.15.4 module as an overlay config file.

Use this file like so:
cmake -DBOARD=usb_kw24d512 \
      -DOVERLAY_CONFIG=overlay-mcr20a.conf ..

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Michael Scott
bfcc1cfb87 samples: net: wpanusb: add TI CC1200 overlay config
Add support for TI CC1200 802.15.4 module as an overlay config file.

Use this file like so:
cmake -DBOARD=quark_se_c1000_devboard \
      -DOVERLAY_CONFIG=overlay-cc1200.conf ..

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Michael Scott
38590a9a4c samples: net: wpanusb: split cc2520 settings from prj.conf
When the CC2520-specific configs are removed from the prj.conf
file, the sample can be built for hardware that supports
802.15.4 natively w/o any changes to the prj.conf like so:
cmake -DBOARD=nrf52840_pca10056 ..
cmake -DBOARD=usb_kw24d512 ..

The CC2520-specific settings now live in overlay-cc2520.conf
which can be used like so when building for devices that can
use it:
cmake -DBOARD=quark_se_c1000_devboard \
  -DOVERLAY_CONFIG=overlay-cc2520.conf ..

Later, support for other optional HW like CC1200 and MCR20A
can be added in a similar way.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-07-17 11:13:16 +02:00
Andrei Emeltchenko
3612802b95 samples: webusb: Change webusb app repository name
Following stripping CDC ACM code from webusb change also webapp.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-16 19:21:43 -04:00
Andrei Emeltchenko
354e138f01 samples: webusb: Reformat README txt to rst
Reformat README to rst standard fixing minor details.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-16 19:21:43 -04:00
Anas Nashif
c8b114f25d samples: exclude socket samples on esp32
ESP32 does not like newlib, exclude for now to get a clean sanitycheck
run. We have issues about this already.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-07-16 19:00:32 -04:00
Krzysztof Chruscinski
46db70ac4c doc: subsys: logging: internal thread and thread wake up
Documenting new logger features: waking up processing thread
and internal logger processing thread.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-16 11:12:16 -04:00
Krzysztof Chruscinski
000aaf96fb logging: Add internal thread for log processing
When enabled, logger is creating own thread which processes buffered
logs. When no logs to process, thread sleeps for configurable period.
Thread can be waken up if number of buffered log messages exceeds
configured threshold. Logging sample aligned to use new feature.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-16 11:12:16 -04:00
Kumar Gala
8b8198b58f samples: mesh_demo: Fix Fix warning when building with newlib
If we use newlib the isdigit (and other similar functions) return an
error as char can possibly be viewed as signed:

usr/include/ctype.h:57:54: error: array subscript has type ‘char’ [-Werror=char-subscripts]
 #define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])

Explicity cast to unsigned char so we deal with both this warning and
possible warning when -Wpointer-sign is enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-16 11:06:20 -04:00
Ramakrishna Pallala
afad09dba6 samples: boards: nrf52: Refactor power_mgr app code
Removed redundant and unused config options from conf files.

Added separate files for handing power management and device
handling functions.

Added the PM policy based on the next timeout event instead of
simply advancing to the next power state.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-07-15 22:48:34 -04:00
Krzysztof Chruscinski
6b01c89935 logging: Add log initialization to system startup
Log API can be used before user can explicitly initialize the logger.
In order to ensure that logger core is ready to buffer log messages
it must be initialize as early as possible. Initialization does not
include initialization of default backend since driver may not be
ready and backend is needed only when log messages are processed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-07-14 08:32:44 -04:00
Robert Lubos
f25baebf27 net: samples: Add TLS support to http_get and big_http_download samples
Add config file that enables to run http_get and big_http_download
samples with TLS enabled and receive the data through HTTPS.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-13 15:03:45 -04:00
Kumar Gala
cfd5c9b43d samples: nats: Fix warning when building with newlib
If we use newlib the isdigit (and other similar functions) return an
error as char can possibly be viewed as signed:

usr/include/ctype.h:57:54: error: array subscript has type ‘char’ [-Werror=char-subscripts]
 #define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)])

Explicity cast to unsigned char so we deal with both this warning and
possible warning when -Wpointer-sign is enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-07-13 09:42:14 -05:00
Niranjhana N
ed72015dbe samples: console: add print statements for user
Add print statements to let user know what kind
of input the test is waiting for.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-07-13 08:48:40 -04:00
Vikrant More
b8b94280b9 samples: mesh: boards: nrf52: avoid responding to wrong messages
If temperature value are out of range which is from 0x0320
to 0x4E20 then no relevant get message handler will execute.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More
460c585406 samples: mesh: boards: nrf52: edit struct for gen. level
Edit data types defined in struct for gen. level.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More
00cd491ffe samples: mesh: boards: nrf52: modifications as per 3.3.2.2.3
Added extra case under state binding's switch statement for
Lightness i.e DELTA_LEVEL. Also upgrade binding between

1. root element's LEVEL state & Light Lightness Actual state.
2. Light Lightness Linear state & Light Lightness Actual state.
3. Light CTL lightness state & Light Lightness Actual state

This is as per Bluetooth Mesh Model Specification 3.3.2.2.3.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More
2708ce561d samples: mesh: boards: nrf52: randomize publishers TID on boot
Now on reboot, NODE as client do not start message publishing
with TID = 1. Instead of that it would start with any random value
from 0 to 255.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More
06f69b5c64 samples: mesh: improved code readability & remove redudancy
Improved code readability by declaring some pre-processor
definitions in device_composition.c

Remove model_instance variable from some structures define in
device_composition.h & its relevant code.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More
c58f102c90 samples: mesh: boards: nrf52: improved vendor model
Update Vendor model message handlers & make it to work as per
TID like other Models defined by SIG. Removed union based data
extraction mechanism.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Vikrant More
170ca38b75 samples: mesh: boards: nrf52: upgrade to pass PTS test
Updated state Binding as per PTS test requirements. Now if
gen_onoff_server & gen_onpowerup_server received Prohibited values
then they will not react on it further. Plus make necessary changes
wherever required for message handlers as per Mesh Model
Specification which is mostly regarding to default & range values.
Now right Status code would get publish in response to set lightness
& temperature range. Also upgrade Message handler
gen_delta_set_unack() algorithm as per PTS requirements.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-13 15:48:16 +03:00
Robert Lubos
13b160b0f5 samples: net: Make echo_client/echo_server use generic mbedTLS config
Use the new, default mbedTLS config file in TLS configuration of
echo_client and echo_server.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-13 10:56:40 +02:00
Andrei Emeltchenko
a3fb48c5fd usb: webusb: Use struct string_desc instead of char array
Use proper structures for dealing with MS OS v1 string descriptors.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-07-12 23:10:22 -04:00
Michael Hennerich
92c1c2a24b samples: sensor: adt7420: Add ADT7420 sample application
This simple application periodically prints the ambient temperature.
Optional support for threshold triggers is provided.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
2018-07-12 13:03:24 -05:00
Robert Lubos
ff0950a940 samples: net: Fix echo_client/echo_server TLS config files
Current config files for TLS qemu_x86 contain unrecognized
`CONFIG_RAM_SIZE`, which causes cmake to fail during project generation.
They  should not be needed anyway, as qemu_x86 defaults to 8 MB of RAM.
Additionaly, echo_client crashes in this configuration with default main
stack size, hence increase it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-07-11 15:44:46 +03:00
Jukka Rissanen
0068151280 samples: net: gptp: Documentation fixes
Clarify the gPTP sample application documentation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-06 19:19:26 -04:00
Johann Fischer
25b0212fc3 subsys: usb: class: add loopback function
Add loopback function. This function can be used to test
USB device drivers and device stack connected to linux host
and has the similar interface as "Gadget Zero" [1] of the Linux
kernel.

Use modprobe usbtest to load the module, see also [2] for the
description of the tests and for Vendor and Product ID of the
"Gadget Zero". The userspace tool testusb [3] is needed to start
the tests.

[1] linux/drivers/usb/gadget/function/f_loopback.c
[2] linux/drivers/usb/misc/usbtest.c
[3] linux/tools/usb/testusb.c

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-07-06 11:56:16 -05:00
Jukka Rissanen
16f31f1d3c drivers: eth: native_posix: Enable gPTP support
Allow gPTP code to be run as a linux process and communicate
with gPTP daemon running in linux host.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-05 12:53:37 +03:00
Vikrant More
c789662f77 samples: mesh/onoff_level_lighting_vnd_app: improved state binding
Removed redundancy from state binding & make it simplified.
Avoid partial state binding in case of state_binding() function
get called with invalid or IGNORE arguments.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-04 17:57:19 +03:00
Vikrant More
31cf5672dc samples: mesh/onoff_level_lighting_vnd_app: corrected printk message
Corrected printk messgae for GET handler for Generic Power OnOff
server.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-04 17:57:19 +03:00
Vikrant More
182be3b49a samples: mesh/onoff_level_lighting_vnd_app: fix buffers length
Changes buffer length for all GET handlers as per patter of
 < 2 + parameters length (in bytes) + 4 >

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-04 17:57:19 +03:00
Vikrant More
0febf03dc8 samples: mesh/onoff_level_lighting_vnd_app: Vendor Model upgrade
This patched improved architecture of already implemented Vendor
Model. Now there are 4 separate opcodes for Vendor viz;
get, set, set_unack & status. This helps to setup
<command + response> mechanism.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-04 17:57:19 +03:00
Andy Ross
dd33b37eff tests/sched/scheduler_api: samples/philosophers: Use SCHED_SCALABLE
These two tests ask for lots of priority levels, more than the 32
maximum allowed by SCHED_MULTIQ (which is by design: if you have
requirements like that DUMB or SCALABLE are better choices due to the
RAM overhead of MULTIQ), so the build will fail on boards that defined
MULTIQ as default.

Don't let the platform choose the scheduler backend, ask for SCALABLE
explicitly.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-07-03 17:09:15 -04:00
Andy Ross
9f06a35450 kernel: Add the old "multi queue" scheduler algorithm as an option
Zephyr 1.12 removed the old scheduler and replaced it with the choice
of a "dumb" list or a balanced tree.  But the old multi-queue
algorithm is still useful in the space between these two (applications
with large-ish numbers of runnable threads, but that don't need fancy
features like EDF or SMP affinity).  So add it as a
CONFIG_SCHED_MULTIQ option.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-07-03 17:09:15 -04:00
Jukka Rissanen
ad150569b6 samples: net: gptp: Allow running gPTP over VLAN
By default gPTP is not run over VLAN but if needed that can be
done by setting CONFIG_NET_GPTP_VLAN and CONFIG_NET_GPTP_VLAN_TAG
options.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-03 20:26:31 +03:00
Jukka Rissanen
e9228a3964 net: gptp: Allow gPTP to run over VLAN
Allow this setup as Linux supports this too.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-07-03 20:26:31 +03:00
Armando Visconti
2ad2d07ce8 samples: board: 96b_argonkey: Add testing of 12 on-board leds
Enable the TI LP3943 led controller and test the 12 on-board leds.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-07-03 12:20:51 -05:00
Piotr Zięcik
a7e2c58af5 samples: sysview: Update memory requirements
When we enabled SEGGER support on the nRF51 series SoCs, this sample
started to fail due to small amount of memory avaiable on some nRF51
SoCs. This commit updates the min_ram property in order to exclude
failing boards from the build.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-07-03 17:51:50 +02:00
Sebastien Bourdelin
2ef1e72607 samples: drivers: Add sample application for PCA9633
Add sample application for NXP PCA9633 LED driver. This application
test the 4 LEDs by doing the following:
 - turn on LEDs
 - turn off LEDs
 - set the brightness to 50%
 - turn off LEDs
 - blink the LEDs
 - turn off LEDs

The application is based on the stm32373_eval board and expects to have
a PCA9633 LED driver on the bus I2C-1 at the address 0x62.

Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
2018-07-02 10:25:47 -05:00
Vikrant More
e8ddd6def8 samples: mesh/onoff_level_lighting_vnd_app: edited message handlers
Removed TID implementations wherever it is not required as per
Bluetooth SIG Mesh Model Specification. Removed unnecessary
comments. Add status code value to get publish along with
Light Lightness range status message.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More
34d475ff4e samples: mesh/onoff_level_lighting_vnd_app: fix bug in state binding
Fixed bug in binding of Light Lightness Actual state & Generic Level
state of Root Element.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More
54df5b519a samples: mesh/onoff_level_lighting_vnd_app: update handlers mapping
Update message handlers & correct nubmber of bytes that every
handlers should fetch for their further processing as per
Bluetooth SIG Mesh Model Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Vikrant More
b3e7a8f67b samples: mesh/onoff_level_lighting_vnd_app: update publication context
Update models publication parameter lengths as per Mesh Model
Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-07-02 13:47:44 +03:00
Kumar Gala
8fe9f432d2 samples: sysview: limit to systems with enough ram
When we enabled SEGGER support on the ST SoCs we now how some systems
with really small amounts of memory that the sample can't be built for.
Set a min_ram to exclude such systems.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-06-29 10:39:07 -05:00
Jukka Rissanen
f8c6894f15 samples: net: dns: Cross reference mDNS config option
Set CONFIG_MDNS_RESOLVER to get a cross reference to the config
option documentation

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Jukka Rissanen
b833d010eb net: llmnr: Add LLMNR responder support
This allows zephyr to listen LLMNR DNS queries sent by Windows
and respond to them. See RFC 4795 for details.

The feature requires that hostname is set properly to the
zephyr device and LLMNR is configured properly.

Typically following config options are enough for this support:

CONFIG_NET_HOSTNAME_ENABLE=y
CONFIG_NET_HOSTNAME="zephyr-device"
CONFIG_DNS_RESOLVER=y
CONFIG_LLMNR_RESPONDER=y

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Jukka Rissanen
f47151513c samples: net: dns: Add LLMNR client support to DNS resolver
By default the LLMNR is disabled in this sample. You can enable
it by setting CONFIG_LLMNR_RESOLVER=y

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-29 13:11:18 +03:00
Krzysztof Chruściński
3a7d4ef4cb samples: subsys: logging: Add logger example
Simple example demonstrating various logger capabilities.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2018-06-29 10:16:45 +02:00
Jukka Rissanen
67b4c5d5d4 samples: net: gptp: Sample application for gPTP support
The application does not do much, it just registers to a callback
in order to get information about gPTP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-28 16:50:50 +03:00
Robert Lubos
b813502077 samples: net: Socket based echo_server
Echo server sample running on top of network sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-06-28 15:18:42 +03:00
Robert Lubos
f01b81731b samples: net: Socket based echo_client
Echo client sample running on top of network sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-06-28 15:18:42 +03:00
Mariusz Skamra
3c6eb7d024 samples: smp_svr: Disable GATT Multiple Read
This feature is not used by mcu_mgr.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-06-27 12:50:24 +03:00
Mariusz Skamra
4e6495c832 Bluetooth: mesh_demo: Enable missing options in configuration file
This enables missing Observer and Brodcaster roles in configuration
file.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-06-27 12:50:24 +03:00
Johan Hedberg
d41d9bd112 Bluetooth: Convert sample code to use the new bt_data_parse() API
Convert the shell and central_hr sample apps to use the newly
introduced bt_data_parse() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-06-26 19:34:57 +03:00
Sebastian Bøe
2bcfb88aed cmake: Remove duplicate invocations of target_link_libraries on app
It is not necessary to link 'app' with mbedTLS because mbedTLS is
covered by the 'APP_LINK_WITH_MBEDTLS' mechanism that automatically
links 'app' with mbedTLS.

This patch removes the redundant target_link_libraries invocations.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-26 15:53:32 +02:00
Vikrant More
11cb462df5 samples: mesh/onoff_level_lighting_vnd_app: States binding corrections
Make corrections in state binding of Servers as per Mesh Model
Specifications. Previously, when OnPowerUp state equal to 0x02,
then Light Lightness actual state was not assign to last power
down value. Plus when Generic OnOff state changes by client,
then Light Lightness Actual state value get assigned as Light
Lightness Last value instead of default one.
All these issues has fixed here.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-06-25 22:52:16 +03:00
Vikrant More
938f12e99d Bluetooth: Mesh: Gen. OnOff, Gen. Level, Lighting & Vendor Models
This is a application demonstrating a Bluetooth mesh node in
which Root element has following models

- Generic OnOff Server
- Generic OnOff Client
- Generic Level Server
- Generic Level Client
- Generic Power OnOff Server
- Generic Power OnOff Setup Server
- Generic Power OnOff Client
- Light Lightness Server
- Light Lightness Setup Server
- Light Lightness Client
- Light CTL Server
- Light CTL Setup Server
- Light CTL Client
- Vendor Model

And Secondary element has following models

- Generic OnOff Server
- Generic OnOff Client
- Generic Level Server
- Generic Level Client
- Light CTL Temperature Server

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-06-23 22:42:45 +02:00
Andrei Emeltchenko
48ff11752c usb: webusb: Strip CDC ACM function from the code
CDC ACM is not needed in webusb, communication is going through Bulk
endpoints. Endpoint numbers stay the same only Interface number
changed, so basically only this change is needed:

-        .then(() => this.device_.claimInterface(2))
+        .then(() => this.device_.claimInterface(0))

this.device_.claimInterface({2,0}) apart from removing serial port
commands.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-22 12:29:45 -04:00
Paul Sokolovsky
f6d8ab8289 subsys: console: Factor out fifo-based console input abstraction
Console subsystem is intended to be a layer between console drivers
and console clients, like e.g. shell. This change factors out code
from shell which dealed with individial console drivers and moves it
to console subsystem, under the name console_register_line_input().

To accommodate for this change, older console subsys Kconfig symbol
is changed from CONFIG_CONSOLE_PULL to CONFIG_CONSOLE_SUBSYS
(CONFIG_CONSOLE is already used by console drivers). This signifies
that console subsystem is intended to deal with all of console
aspects in Zephyr (existing and new), not just provide some "new"
functionality on top of raw console drivers, like it initially
started.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-20 15:59:12 -04:00
Andrei Emeltchenko
0d895c8aa3 usb: webusb: Refactor WebUSB using BOS API
Refactor USB sample WebUSB using new BOS API.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Andrei Emeltchenko
7eb05cd113 usb: webusb: Correct total length
Calculate correct length

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-06-20 15:47:00 -04:00
Satya Bhattacharya
af70e8f7f0 samples: net: Check the return value of close()
Check the return value of close() in socket_dumb_http.c
If non-zero, print the error code

Fixes #8413.

Signed-off-by: Satya Bhattacharya <satyacube@gmail.com>
2018-06-18 10:47:24 +03:00
Johann Fischer
085a8b75c5 usb: hid: fix write to interrupt IN endpoint
A HID application can no longer write to the default
interrupt IN endpoint because the addresses are assigned
dynamically. Add hid_int_ep_write() function  and leave
it to the hid-core to call the usb_write() with the correct
endpoint address.

fixes: #8424

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-06-16 11:46:56 +02:00
Gil Pitney
984657022f samples: net: wifi: Add a cc3220sf_launchxl conf file
This enables testing of the scan, connect, and disconnect
wifi_mgmt functions of the wifi shell module for
the cc3220sf_launchxl.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-06-15 10:01:21 -04:00
Vikrant More
1bbfdf1d1a samples: mesh/onoff-app: Enable persistent storage support
Enable persistent storage support in
samples/boards/nrf52/mesh/onoff-app.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-06-15 15:47:27 +02:00
Leandro Pereira
c16bce7a6a samples, subsys, tests: Use ARRAY_SIZE() whenever possible
The ARRAY_SIZE() utility macro will actually test the parameter types,
and ensure that it is only called with arrays, and not arrays decayed
to pointers.

Changes were performed with a simple Coccinelle script.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-14 19:12:51 -04:00
Marc Reilly
6c60abb03b drivers: gpio: add dts support for nrf52 gpio
This adds basic support for declaring gpio nodes in dts for nrf52.
The dts.fixup provides mapping for the generated defines to the config
defines currently used by the nrf gpio driver.

Existing boards that use nrf52 are updated.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
2018-06-14 15:56:39 +02:00
Henrik Brix Andersen
e5b5f85c1a samples: servo_motor: Add support for the BBC micro:bit
Add support for the BBC micro:bit to the servo_motor sample
application.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-06-13 18:55:22 +02:00
Sebastian Bøe
8f3fea300a cmake: bluetooth: Don't #include gatt files from src files
Due to a bug in KBuild, bluetooth samples needed to #include the gatt
sources to re-use code between samples. This bug was not ported to
CMake so we can stop applying this workaround.

gatt source files are now directly added to the 'app' library instead
of having adapter source files in the app's src directory that
\#include's the gatt files.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-06-13 15:14:40 +02:00
Ulf Magnusson
7a073bf9f5 samples: bluetooth: Fix microbit/nrf5 UART flow control assignments
The UART_NRFX_FLOW_CONTROL Kconfig symbol was renamed to
UART_0_NRF_FLOW_CONTROL in commit 3f99eefe5a ("drivers: uart: Rename
nrf5 namings to nrfx").

The assignments in samples/bluetooth/hci_uart/microbit.conf and
samples/bluetooth/hci_uart/nrf5.conf were updated in the same commit,
but to the wrong name. Change them to use the correct name.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-12 20:18:14 -04:00
Jakub Rzeszutko
3f99eefe5a drivers: uart: Rename nrf5 namings to nrfx
UART driver renamed to keep the same convention as SPI and TWI drivers.
All substrings: "UART_NRF5" in defines renamed to  "UART_NRFX_UART".

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-06-12 13:21:18 +02:00
Jukka Rissanen
416614e26a samples: net: echo-client: Increase buf count for frdm-k64f
Increasing the network buffer count for frdm-k64f so that the
device will not run out of memory so easily.

Fixes #7678

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-06-11 20:16:37 -04:00
Leandro Pereira
fb4227bd97 samples: mbedtls_sslclient: Use entropy driver to kickstart RNG
If an entropy driver is available during build, use it to gather
entropy rather than relying on sys_rand32_get(), which provides no
guarantees that the provided numbers will be good enough from an
encryption standpoint.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-11 17:43:04 -04:00
Robert Lubos
30c4aae948 net: samples: increase main stack size for echo_client
Default stack size was too small for main thread in qemu_x86
configuration and resulted in stack overflow during initialization.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-06-11 17:33:17 -04:00
Paul Sokolovsky
59309c1a2d samples: sockets: dumb_http_server: Use consistent logging settings
Use logging settings consistent with other samples/net/sockets/ apps
(which includes error logging enabled by default).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-06-11 17:24:54 -04:00
Anas Nashif
10d8e711be samples: move grove samples to sensors and display
No need to have a category for grove, instead moved the samples to both
sensors and display based on what the sample does.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-11 17:11:18 -04:00
Anas Nashif
f37287bbca samples: cleanup sample test naming
Cleanup test names and make them suitable for import into test
management system.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-11 17:11:18 -04:00
Anas Nashif
3f8352f2e6 samples: remove sample.tc
This is not used by Zephyr directly and comes from a test framework. We
do matching in the sample.yaml file now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-11 17:11:18 -04:00
Anas Nashif
57f6790335 samples: can: move CAN sample under drivers
Move CAN driver sample under samples/drivers and add a sample.yaml.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-11 17:11:18 -04:00
Luiz Augusto von Dentz
68de9d5d66 Bluetooth: Use Characteristic attribute whenever possible
With updates to bt_gatt_notify and bt_gatt_indicate it is now possible
to pass the Characteristic attribute instead of its value which makes
the code able to verify if attribute properties are set correctly.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-06-11 14:41:19 -04:00
Leandro Pereira
7cfd5a4184 samples: net: hrpl_border_router: Fix NULL pointer dereference
Null-checking `pkt` before making a call to net_pkt_unref() suggests
that it might be NULL, but the pointer is dereferenced before it's
checked.  Perform the check at the beginning of the function and
dereference and drop its reference unconditionally afterwards.

Coverity-ID: 178789
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-08 13:07:19 -05:00
Leandro Pereira
b7ad50b473 samples: net: rpl_border_router: Fix out-of-bounds write
While printing debugging information, an out of bounds write could
happen while trying to write out the NUL byte in the url array.

Coverity-ID: 178790
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-08 13:07:19 -05:00
Leandro Pereira
e7a3d01dc5 samples: net: dumb_http_server: Handle recv() errors
The recv() call can return errors, so handle them before reading the
received byte.  Unrecoverable errors will just trigger the client
socket to be closed as usual.

Coverity-ID: 182778
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-08 13:07:19 -05:00
Satya Bhattacharya
fd561dd596 samples: net: Check the return value of nats_publish
Check and handle the return value of nats_publish() in main.c

Fixes #6258.

Signed-off-by: Satya Bhattacharya <satyacube@gmail.com>
2018-06-06 16:06:39 -05:00
Andrew Boie
2dd91eca0e kernel: move thread monitor init to common code
The original implementation of CONFIG_THREAD_MONITOR would
try to leverage a thread's initial stack layout to provide
the entry function with arguments for any given thread.

This is problematic:

- Some arches do not have a initial stack layout suitable for
this
- Some arches never enabled this at all (riscv32, nios2)
- Some arches did not enable this properly
- Dropping to user mode would erase or provide incorrect
information.

Just spend a few extra bytes to store this stuff directly
in the k_thread struct and get rid of all the arch-specific
code for this.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-06-06 14:26:45 -04:00
Anas Nashif
d05442ee9c samples: crypto: adapt harness
Adapt console harness to new changes in sample output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira
d06eecbe29 samples: drivers: crypto: Update expected sample output
Some changes were made in the sample implementation that made the test
fail due to differences in the expected output.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira
858cd199ed samples: drivers: crypto: Do not show colors in logs
Showing colors in logs make it harder to write test expectations.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira
cf3da3c6c4 samples: crypto: Ensure cap_flags is always initialized
Find the device and query its capabilities just once at boot, then
go through a list of tests to perform.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira
a026b9eaca tests: crypto: Fully initialize variables using named initializers
This should get rid of Valgrind warnings in #7478.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-05 10:26:59 -04:00
Paras Jain
61f91f8fec samples: sensor : mcp9808: check return value
Check the return value while setting sensor trigger

Coverity-CID: 186196

Signed-off-by: Paras Jain <parasjain2000@gmail.com>
2018-06-01 14:41:42 -05:00
Alexander Wachter
b97dd472fb drivers: can: Move bit timing and clock to device tree
This commit moves the bit timing (PROP, BS1, BS2 segments and SWJ)
from Kconfig to the device-tree and fixes issue #7933

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2018-06-01 12:59:42 -05:00
Paul Sokolovsky
659c241e3a samples: net: big_http_download: Ignore close() return value.
We aren't interested in doing error handling for close(), close()
is itself on error handling path, and its purpose if to free
socket resources.

Coverity-CID: 186062
Fixes: #7713

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-29 16:23:46 -04:00
Ulf Magnusson
337832d193 samples: hci_uart: Remove CONFIG_UART_NRF5_BAUD_RATE assignment
This symbol was removed in commit 748f724d82 ("serial: dts: remove
!HAS_DTS related Kconfig"). The setting should come from DTS now.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-29 21:27:40 +03:00
Ulf Magnusson
5405f68878 kconfig: Remove remaining 'option env' bounce symbols
These are no longer needed since commit 4dc9e5b2de ("kconfig: Get rid
of 'option env' bounce symbols"). The C tools are likely to get rid of
them soon too.

The APPLICATION_BASE symbol (option env="PROJECT_BASE") triggered a
compatibility warning, because 'option env' symbols now need to have the
same name as the environment variables they reference to be compatible
with Kconfiglib. APPLICATION_BASE is unused, so just remove it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-28 17:21:11 -04:00
Ulf Magnusson
c5fda14358 samples: Quote BOARD value in custom board definition
Gets rid of a warning added in commit 6eabea3a7e ("Kconfiglib: Warn
for unquoted string defaults"), which will soon be an error (because a
simple warning whitelist will be used).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-28 11:04:50 -04:00
Kumar Gala
b0ffe06f7a samples: openamp: add some comments to the code
Add some comments about what the associated files are trying to
accomplish in the code.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-28 10:22:34 -04:00
Kumar Gala
7d01bf8cb5 samples: openamp: Update docs
Update doc to clarify that the sample is currently specific to the
LPC54114 SoC.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-28 10:22:34 -04:00
Andrei Emeltchenko
ee4a417586 samples: echo_server: Remove conflicting option from conf file
Remove conflicting option CONFIG_NET_IPV6 since it got selected due to
CONFIG_NET_APP_NEED_IPV6 in netusb configuration file.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-05-26 08:27:16 -04:00
Ulf Magnusson
544f827173 samples: mbedTLS server: Remove CONFIG_NET_SLIP_TAP assignment
Was written as "CONFIG_NET_SLIP", which doesn't exist.

Jukka Rissanen indicated in
https://github.com/zephyrproject-rtos/zephyr/pull/7810 that
CONFIG_NET_SLIP_TAP doesn't need to be enabled here ("I prefer we remove
the line completely as the TAP is enabled automatically for qemu_x86"),
so remove the assignment rather than fixing it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 17:21:31 -04:00
Ulf Magnusson
cbdfdf9e77 samples: bmm150: Remove assignment to missing CONFIG_BMM150_SET_ATTR
This symbol never existed, and has some dead code associated with it:
https://github.com/zephyrproject-rtos/zephyr/issues/7848

Just remove the assignment to the undefined Kconfig symbol for now. The
associated code could be removed separately if it isn't needed anymore.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 14:21:21 -05:00
Ulf Magnusson
2facf33f28 net: ieee802154: Remove old cc2520 AUTO_ACK assignments
CONFIG_IEEE802154_CC2520_AUTO_ACK started out as
CONFIG_TI_CC2520_AUTO_ACK, which was removed in commit 6b43821f20
("net: Remove legacy Contiki based uIP stack"). The assignments were
later renamed in commit 573774a9bf ("drivers/net/ieee802154: Change
configuration prefix").

Remove them.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:20:37 -04:00
Ulf Magnusson
31c5a83e7f samples: hci_uart: Remove NRF5 Kconfig baud rate setting
The UART_NRF5_BAUD_RATE Kconfig symbol was removed in commit
748f724d82 ("serial: dts: remove !HAS_DTS related Kconfig"). Looks
like this has been moved to DTS.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-25 11:19:59 -04:00
Kumar Gala
8e41572774 drivers: spi: remove dead references to CONFIG_SPI_QMSI{_SS}
During the spi rework we removed the qmsi spi drivers so we no longer
have Kconfig symbols or drivers related to CONFIG_SPI_QMSI{_SS}.  There
are a few references still around that we should remove

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 21:09:32 -04:00
Kumar Gala
40777af71e samples: openamp: Cleanup CMakeLists.txt files
Cleanup some whitespace/formatting in the CMakeLists.txt files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 10:17:56 -05:00
Kumar Gala
4e8438bc0e ext: open-amp: Change build integration so its not recursive
With recent changes to open-amp we can now include and build it directly
as a zephyr library rather than doing a recursive make.  We remove
ext/lib/ipc/open-amp.cmake as part of this change and introduce a
Kconfig option for open-amp.

Fixes: #7673

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 09:18:47 -05:00
Kumar Gala
6a86b02642 ext: open-amp: move open-amp down one dir
Move open-amp to be in ext/lib/ipc/open-amp/open-amp.  This allows us to
be Zephyr specific files and config like README (for import),
CMakeLists.txt file, Kconfig, etc in ext/lib/ipc/open-amp/ that don't
conflict with any files that might have the same name in
ext/lib/ipc/open-amp/open-amp.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 09:18:47 -05:00
Kumar Gala
f6fb8b8aee ext: libmetal: Change build integration so its not recursive
With recent changes to libmetal we can now include and build it directly
as a zephyr library rather than doing a recursive make.  We remove
ext/hal/libmetal.cmake as part of this change and introduce a Kconfig
option for libmetal.

This is a partial fix for issue #7673.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-24 09:18:47 -05:00
Ulf Magnusson
9a06d119a8 samples: mcp9808: Fix CONFIG_MCP9808_TRIGGER_GLOBAL_THREAD assignment
CONFIG_MCP9808_TRIGGER_GLOBAL never existed. Looks like a typo.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-24 09:21:32 -04:00
Ulf Magnusson
d154060a64 samples: grove: Fix CONFIG_GROVE_TEMPERATURE_SENSOR_V1_X assignment
CONFIG_GROVE_TEMPERATURE_SENSOR_V1_1 never existed.
CONFIG_GROVE_TEMPERATURE_SENSOR_V1_X has help text "Version 1.1 or 1.2".

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-24 08:06:35 -04:00
Ulf Magnusson
f346c7aeaf samples: grove: Remove CONFIG_GROVE_LCD_RGB_INIT_PRIORITY assignment
This symbol was removed in commit 33118f9212 ("sensor: grove: use
global sensor init priority"), which switched over to using
CONFIG_APPLICATION_INIT_PRIORITY.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-24 08:05:42 -04:00
Jukka Rissanen
2dbde4a1fa samples: net: zperf: Remove config files for Galileo board
The support for Galileo board is bitrotted as the config file
contains obsolete values. As testing this old board is difficult
lets remove the config files. These can be re-introduced with
proper and tested settings if needed.

Fixes #7814

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-24 08:02:04 -04:00
Kumar Gala
27f05e3929 samples: board: 96b_argonkey: Remove dead code
CONFIG_ILS29035 isn't defined anywhere, so remove code associated with
it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-23 17:57:06 -04:00
Kumar Gala
91d80445f9 samples: net: zperf: Remove dead Kconfig symbol from galileo conf
CONFIG_DEBUG_IP_BUFS was commented out but specified in galileo
specific conf files.  The Kconfig symbol doesn't exist so lets remove
it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-23 17:57:06 -04:00
Kumar Gala
7bb6eb62f2 samples: wifi: remove dead Kconfig symbol
CONFIG_SPI_LEGACY_API symbols has been removed so don't try to set it in
a conf file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-23 17:57:06 -04:00
Johan Hedberg
8d1f67c605 Bluetooth: Remove references to non-existing Kconfig symbols
Remove non-existent Kconfig symbol references. An additional (but
related) change is the removal of all persistent storage symbols from
the Arduino 101 Bluetooth shell app, since BT_STORAGE no longer
exists.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-23 16:57:59 -04:00
David B. Kinder
6c6cf23d4d doc: fix misspellings in docs
Caught some misspellings missed by the normal review process.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-05-23 16:57:33 -04:00
Ulf Magnusson
1a7ae583af samples: net: mqtt: Remove CONFIG_BT_MAX_CMD_LEN assignment
This symbol started out as CONFIG_BLUETOOTH_MAX_CMD_LEN, which was
removed in commit 50678b03cb ("Bluetooth: Reuse HCI command buffers
for the command response").

The non-existing symbol in the assignment was then renamed to
CONFIG_BT_MAX_CMD_LEN by commit 2975ca0754 ("Bluetooth: Kconfig:
Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*").

Remove the assignment.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-23 13:10:26 -04:00
Jukka Rissanen
e7468fb583 samples: net: Fix VLAN tag name in prj.conf file
The prj.conf file was using wrong VLAN tag option names.
The correct names are CONFIG_SAMPLE_VLAN_TAG and
CONFIG_SAMPLE_VLAN_TAG_2 as defined in Kconfig file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-23 12:47:49 -04:00
Ulf Magnusson
4a54005e7b samples: net: Remove undefined references to CONFIG_NET_LOG_ENABLED
Maybe CONFIG_NET_LOG=y was intended, but both files already set it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-23 12:10:38 -04:00
Ulf Magnusson
02d9cc171c samples: subsys: debug: Remove CONFIG_SEGGER_RTT assignment
This symbol does not exist. Not sure what was intended.

There's HAS_SEGER_RTT, but that symbol has no prompt, meaning .config
values have no effect on it. It is 'select'ed by the SoCs.

Remove the assignment, which is a no-op.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-05-23 08:19:31 -04:00
Kumar Gala
e0e188d3d3 samples: xtensa_asm2: Cleanup stray IS_TEST reference
We removed IS_TEST a while ago.  Remove this stray reference

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-22 12:36:58 -04:00
Ravi kumar Veeramally
d5df64722b samples: net: rpl_br: Fix coverity issues
Fixes: #7717
Fixes: #7720
Fixes: #7730

Coverity-CID: 186041
Coverity-CID: 186053
Coverity-CID: 186057

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-22 09:54:11 -04:00
Ravi kumar Veeramally
2c305d2cc5 samples: net: Remove unwanted code from coap-server
Probably left over from old ZOAP library. Stripping of headers
not required now.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-22 08:54:54 -04:00
Ravi kumar Veeramally
55680f884a samples: net: Fix coap-client sample
Removed unwanted code, fine tuned a bit. Original use case of
sample (verify CoAP GET, PUT and POST methods) against coap-server
not changed.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-22 08:54:54 -04:00
Ravi kumar Veeramally
ac3c6ba990 samples: net: Fix coap-server sample
If client removes observer then it reply with RESET message for
further observer notifications. That means coap-server should stop
sending further notifications to the client.

Current sample unref the packet as soon as it finds pending message
and doesn't bother about message type.

Fixes: #6534

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-22 08:54:54 -04:00
Alexander Wachter
2de9f2f8fd samples: can: Add example code for CAN driver
This adds example and testing code for CAN driver.
Tested on stm32f072b disco.
Examples are given for:
- can_configure
- can_attach_isr
- can_attach_msgq
- can_send

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2018-05-19 20:19:30 +02:00
Kristian Klomsten Skordal
5eb882980d sample: add OpenAMP sample application
This commit adds a sample application using OpenAMP for remote procedure
calls on the LPCXpresso54114. It is adapted from the RPMsg-Lite sample
application added in PR #5960, and uses the IPM driver to provide
interprocessor interrupts.

Signed-off-by: Kristian Klomsten Skordal <kristian.skordal@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-19 12:56:36 -05:00
Armando Visconti
02bb83bec2 samples/boards: Add ArgonKey test
Test ArgonKey board. It provides an example of how to test
all the sensors on-board. It currently enables by default
following sensors:

   LPS22HB pressure/temp
   HTS221 humidity
   LSM6DSL accel/gyro plus LIS2MDL magn connected to it.
   VL53L0x proximity

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-05-18 13:10:33 -05:00
Jan Van Winkel
05234e352f driver: sample: ILI9340 sample application
Sample application showing how to use the ILI9340 LCD display driver.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-05-18 20:21:45 +03:00
Jan Van Winkel
ca16779d9e driver: ILI9340 LCD display driver
Minimal driver for ILI9340 LCD display driver including support
for adafruit 2.2" LCD display (1480)

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-05-18 20:21:45 +03:00
Paul Sokolovsky
0b76b12837 samples: sockets: big_http_download: Update for DHCPv4 support.
Enable CONFIG_NET_DHCPV4, while keeping static IP configuration,
which allows the app to work both with static IP (e.g. when
connected to a workstation without DHCP server) and with DHCP (e.g.
when connected to a router). When using DHCP, getting an address
may take some time, during which getaddrinfo() may fail due to a
timeout. So, add retries for this call.

Tested with qemu_x86 (non-DHCP) and frdm_k64f (both DHCP and
non-DHCP).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-18 13:03:44 +03:00
Stanislav Poboril
37b7caa6bb sample: Add MCUX IPM sample application
Add MCUX IPM sample application. It can be run on lpcxpresso54114
board at the moment.

We first build the slave core image out of the remote/ dir than the
primary core image is build which includes the slave core image.

Origin: Original

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-05-17 15:07:48 -05:00
Ravi kumar Veeramally
26ebb918f7 samples: net: rpl: Add observer support to node application
If coap-client(e.g. RPL BR) wants to get notifications from
coap-server(RPL-node) about parent status, client has to register
observer for notifications.

RPL node application modified to toggle the LED. Do not maintain any
ON/OFF states. Also removed Sparrow (contiki border router) related
patch.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-17 16:25:49 +03:00
Ravi kumar Veeramally
2ef5044277 samples: net: rpl: Enhance RPL border router application
Add CoAP client to RPL BR application. Which can be used to
control leds and get rpl related information from leaf nodes
though CoAP messages. Build toplogy matrics and send it to
Web UI.

Enhanced Web UI components (Interfaces, RPL, Neighbors, Routes
and Topology tabs). Added buttons to control leds on lead nodes.

Added JSON support to handle led on/off requests from UI.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-17 16:25:49 +03:00
Jukka Rissanen
08795cf27d samples: net: rpl: Simple RPL border router application
This is a very simple RPL border router sample application.
It provides HTTP(S) and net-shell interface for getting admin
information about neighbors and routes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-17 16:25:49 +03:00
Tomasz Bursztyka
49bd1e9c6f ieee802154: Add support for filtering source short/ieee addresses
L2 could take advantage of such hardware capability, when supported by
the device. This is also required for OpenThread.

Fixes #5714

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-17 16:18:53 +03:00
Johann Fischer
36eb4dd021 tests: samples: exclude usb_kw24d512 from wpanusb sample
Exclude usb_kw24d512 from wpanusb sample until the the sample
has been reworked and is more generic.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-05-17 07:00:49 -05:00
Tomasz Bursztyka
554999d320 samples/net: Add a simple sample to run wifi shell module
Enabling relevant hardware, currently only winc1500 on
quark_se_c1000_devboard. But it could be easily extended to other
drivers/boards.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-17 10:46:26 +03:00
Marti Bolivar
7588680afb samples: olimex_stm32_e407: ccm: trivial README.rst fix
Use zephyr-app-commands for portability instead of assuming Make and
Unix, and add a missing "run" goal.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-17 07:41:56 +03:00
Marti Bolivar
bdfbbfee3f samples: sensor: vl53l0x: trivial README.rst fix
Use zephyr-app-commands for portability instead of assuming Make on
Unix, also adding a missing "flash" invocation.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-05-17 07:41:56 +03:00
Leandro Pereira
9c113d29f5 samples: drivers: crypto: Print output length for all operations
Printing the output length for all encryption/decryption operation will
make it easier to know if a particular crypto driver shim provides this
information.  TinyCript and mbedTLS were not providing this, making the
out_len field useless.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-05-16 23:30:11 +03:00
Anas Nashif
ddc30c8e40 samples: leds_demo: depend on netif and gpio
Do not build on unrelated hardware.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-16 23:10:30 +03:00
Carles Cufi
5ebf1a2c14 samples: smp_svr: Add sample.yaml
Add a sample.yaml file for Nordic platforms (QEMU is not supported due
to the lack of flash partitions), both nRF51 and nRF52.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-05-16 17:01:52 +02:00
Carles Cufi
b2fa9ada5e samples: smp_svr: Rename conf file
Rename the conf file so that extensions is preserved correctly.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-05-16 17:01:52 +02:00
Ravi kumar Veeramally
6cadd380b7 samples: net: Fix echo_server reply packet preparation
If the incoming packet fragments doesn't have any link layer
header then build_reply_pkt() will set reply packet fragment's link
layer header space to zero. Which is causing issue in case of IPv4.
ARP layer is trying to fill Ethernet headers, but fragments
ll header length is set to zero.

Just use net_pkt_copy_all() to copy payload. That should be enough.

Fixes #6564

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-05-16 16:40:27 +03:00
Paul Sokolovsky
092f716020 samples: sockets: dumb_http_server: Disable TIME_WAIT delay
This is required to test the server with ab (ApacheBench), which
itself is an important integration test for the IP stack.

Fixes: #7377

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-16 11:03:49 +03:00
Michael Scott
1290139626 net: lwm2m: mark OPTIONAL resources for LwM2M Device
Using OMA Technical Specification LwM2M Enabler 1.0.2 dated
Feb. 9, 2018, let's mark the OPTIONAL resources for an LwM2M
Device object (Section E.4 "LwM2M Object: Device")

As a result, the Device object no longer configures the default
buffers for data storage of several optional resources.
The LwM2M client sample is also changed to to setup these read-only
buffers instead.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-05-16 10:56:07 +03:00
Andrei Emeltchenko
7fa8537d22 usb: webusb: Trivial cleanup
Fix indentation

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-05-15 18:56:32 +02:00
Andrei Emeltchenko
df5e0e008e usb: webusb: Use sizeof instead of magic numbers
Use proper sizeof()

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-05-15 18:56:32 +02:00
Andrei Emeltchenko
931630ca2b usb: webusb: Define and use MS descriptor structures
Define MS OS descriptors structures

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-05-15 18:56:32 +02:00
Iván Sánchez Ortega
6164c60ce2 samples: usb: webusb: Add MS OS v1.0 descriptors too
This adds the "old" (pre-windows8) way of doing microsoft-
specific USB descriptors, alongside the v2.0 way of doing
the same.

Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
2018-05-15 18:56:32 +02:00
Iván Sánchez Ortega
3b8c6c70e6 samples: usb: webusb: Add MS-OS descriptors for compatible IDs
This adds some vendor-specific microsoft USB descriptors, which
makes the win8/win10 enumeration process to report a "WINUSB"
capability, which in turn automatically binds a WinUSB.sys driver
to a specific set of interfaces. This, in theory, makes userspace
drivers easier to handle in win32/win64 platforms.

Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
2018-05-15 18:56:32 +02:00
Paul Sokolovsky
b56b1436ed samples: sockets: Make more errors fatal
In samples, using CHECK() helper macro, make it exist in case of
error. This makes sure that negative value (error indicator) can't
be passed as argument to other function and fixes Coverity reports.

Coverity-CID: 183062
Fixes: #6101

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-15 18:14:07 +03:00
Paul Sokolovsky
16a8a309a3 samples: sockets: dumb_http_server: Improve error handling
Check socket function return codes to address Coverity issues.

Coverity-CID: 182771
Fixes: #6100

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-05-15 17:21:08 +03:00
Jukka Rissanen
d257b946e3 samples: net: mbedtls_sslclient: Fix prj.conf file
The application started to send data before it had any IP
address configured. This prevents communication to the server.

Fixes #7502

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-15 17:11:56 +03:00
Ramakrishna Pallala
ef4cb15f04 samples: subsys: debug: sysview: Adapt k_thread_foreach API
Use k_thread_foreach() API instead of iterating over the
_kernel.threads list.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-05-15 13:43:00 +03:00
Ramakrishna Pallala
769c3a8bf2 samples: boards: Remove deprcated k_call_stacks_analyze API
Replace deprecated k_call_stacks_analyze() API with
k_thread_foreach() API.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-05-15 13:43:00 +03:00
Laczen JMS
b1e45b413e subsys: fs: Add Non Volatile Storage (NVS) for zephyr
Zephyr supports fatfs, nffs and fcb as storage layer. fatfs and nffs
are less suited for application in memory restricted IC's. fcb has a
smaller footprint but has a complex api.

The proposed module is a module with a even smaller footprint compared
to fcb and a simple interface for reading and writing entries. The
module provides wear levelling of flash. This allows the module to be
used not only to store configuration settings but to store device state
(e.g. state of a light switch over reboots) of a zephyr device.

Fixes buffer overflow by introducing maximum read length in nvs_read()
and nvs_read_hist().

Fixes nvs_write() not to reflash the same data. Allows the user to do
call nvs_write() for all defined entries without worries about flash
wear.

Fixes garbage collection error where wrong data could be copied.

Add nvs_delete() to allow deleting a stored entry. A deleted entry will
not be copied to a new flash sector

Include flash wear information in the README.md documentation

0/25 Update module after reviewers remarks, added documentation to
nvs.h, removed README.md by nvs.rst in doc/subsystems folder

04/26 Update module after reviewers remarks, updated nvs.rst, added more
documentation to samples/subsys/nvs/src/main.c, updated doxygen info
in nvs.h (hope this time it works).

04/26 Update subsystems.rst to include nvs.restart

04/27 Updated nvs.c and nvs.h to avoid a possible flash deletion loop
when the file system is full.

04/29 Updated nvs_write to detect and ignore deletes of non-existing
items

05/06 Update NVS module to return standard error codes, removed low
level API, added configuration options. NVS now uses the board dts to
determine the flash storage location (FLASH_AREA_STORAGE_OFFSET).

05/06 Update nvs.rst. Updated intendation and added intermediate
variables in nvs.c to make the code easier to read.

05/06 Update nvs.rst.

05/07 Update nvs.rst

05/08 Changed the API to a more standard file system API.

05/08 Removed cnt_max from nvs_read() as it is not used.

05/08 Removed #ifdef(CONFIG_NVS_LOG) from nvs_priv.h, now the module can
be build with debugging off.

05/09 Removed configuration options for SECTOR_SIZE, SECTOR_COUNT and
MAX_ELEM_SIZE. It is now easy to support multiple NVS filesystems on
one or multiple devices. Changed logging to support newlib systems.
Thanks to Olivier Martin for reporting and proposed changes.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2018-05-15 10:29:16 +02:00
Michael Scott
677262e9f6 samples: net: lwm2m: adjust BT RX buffer count /sizes for BT
Due to higher traffic demands when using 6lowpan, we should raise
the default BT RX buffer counts and sizes.

This avoids the following error on some HW:
[net/buf] [WRN] net_buf_alloc_len_debug: bt_buf_get_rx():4985:
Pool 0x20009424 low on buffers.
[net/buf] [WRN] net_buf_alloc_len_debug: bt_buf_get_rx():4985:
Pool 0x20009424 blocked for 0 secs

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-05-15 10:16:08 +02:00
Jukka Rissanen
3df9201ef3 samples: net: dns_resolver: Add config options for tests
Make sure that we compile sanity checked application with
more config options in order to catch compile issues faster.
In this case DHCPv4 + debugging options are enabled for
sanity checker.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-14 17:22:27 -04:00
Jukka Rissanen
994be4dc4b samples: net: dns: Fix compile error
If DHCPv4 was enabled, then there was compile error as the code
was still using wrong variables.

Fixes #7342

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-14 17:22:27 -04:00
Luiz Augusto von Dentz
1b038f2941 Bluetooth: GATT: Make BT_GATT_CHARACTERISTIC declare its value
This ensures the every characteristic has a value attribute declared
with the same UUID since the old macro did not declare the value the
application would normally have to declare one itself using a different
UUID which is not allowed.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-05-14 18:51:22 +03:00
Johan Hedberg
88dfd399f4 Bluetooth: Mesh: Remove sequence number from bt_mesh_provision()
The sequence number was acting as a stop-gap for missing persistent
storage. Now that we have the settings support in place it's no longer
needed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-11 16:44:43 +03:00
Johan Hedberg
da82976eb6 Bluetooth: samples/mesh_demo: Add support for settings-based storage
Enable BT_SETTINGS and remove any custom flash access used for the
sequence number. We do settings_load() before bt_mesh_provision() and
use the return value from the latter to identity that settings_load()
had recoved a full configuration.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-11 16:44:43 +03:00
Johan Hedberg
8703ffad23 Bluetooth: Mesh: Redesign element and storage info for models
Keeping the model struct same sized, change the element pointer to two
indexes, and add a flags member that will be used to track pending
storage actions.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-11 16:44:43 +03:00
Johan Hedberg
9e2189c4c1 Bluetooth: Mesh: Introduce generic storage timer
Instead of having an RPL-specific storage timer, introduce a generic
one that'll eventually be used for all persistent storage.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-11 16:44:43 +03:00
David Leach
d536ffa694 samples/echo_server: Increased stack sizes for testing OT on kw41z
Something in the workqueue code path pushed the queue usage past
the end of stack.

Fixes #7107

Signed-off-by: David Leach <david.leach@nxp.com>
2018-05-11 16:39:47 +03:00
Tomasz Bursztyka
7d9631e62a samples/net: Fix echo_client for cc2520
NET_APP settings was missing the device name and enabling the net shell
is nice to verify runtime configuration as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-05-09 13:18:14 -04:00
Johan Hedberg
9540f7d52d Bluetooth: Mesh: Add skeleton for persistent storage
Add initial skeleton for doing settings-based persistent storage for
the mesh network state. This patch only includes restoring some core
network state such as IV Index, Sequence number, Net Keys, App Keys
and the Replay Protection list. The remaining state, and actually
storing the state, is left for follow-up patches.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-09 12:36:32 +03:00
Andrzej Puzdrowski
c913c6710d smaples/mgmt/mcumgr/smp_svr: fix missing nffs.h header
Header was missing after merging PR #6970
`Add support for File System multiple instances`

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-05-09 11:01:23 +02:00
Ramakrishna Pallala
9413682942 samples: subsys: usb: Set disk name Kconfig option
Assign the appropriate disk name Kconfig option to the
usb mass storage sample test.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-05-08 08:53:01 -04:00
Anas Nashif
fa0a670dea tests: integration: do not run test on hw
This is is just sample for integration tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-07 12:27:07 -04:00
Johan Hedberg
b997a283f7 Bluetooth: Introduce skeleton for settings-based storage
Introduce a basic skeleton for peristent storage based on the settings
subsystem. Also enable support for this to the peripheral sample
application, so the new code gets exersized by CI. For now, the
implementation provides the same level support as the bt_storage API
ever did, i.e. for the identity address and the IRK.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-05-04 17:26:05 -04:00
Andrzej Puzdrowski
4954fe06f2 subsys: fs: fix generic storage partition selection
FS_FLASH_MAP_STORAGE keyword enables the storage partition,
but it was depend on flash_map module which is unused by
NFFS. This patch makes it independent thanks
to it is possible to enable the storage partition
without flash_map module.

FS_FLASH_MAP_STORAGE was renamed to
CONFIG_FS_FLASH_STORAGE_PARTITION
as it is independent for flash_map.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-05-04 10:14:01 -04:00
Jukka Rissanen
33eb03a8d9 samples: net: https-client: Increasing main stack size
The main stack size was too small for this sample application
when TLS was enabled. Increasing it to 1504 bytes.

Fixes #7269

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-05-03 08:55:58 +03:00
Anas Nashif
00c26d24b2 samples: remove stray config
CONFIG_BUILD_OUTPUT_STRIPPED was added by mistake into this sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-02 00:23:31 -04:00
Anas Nashif
b3275d651c tests/samples: add hw dependencies
Add hardware dependencies and filters to make sure we do not explode if
for example we try to build a sample/test using rtc when the platform
does not support that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 19:10:27 -04:00
Johann Fischer
b2ca5ee5bc subsys: usb: rework USB DFU class driver
This patch moves USB DFU class driver to subsys/usb/class.

For the first the USB DFU class driver depends on DFU image
manager and partition layout and is limited to use as an
application for the bootloader. The driver fetches the
information about the flash, erase block size, write block
size and partitions offset from the DT now. The driver has
two interfaces associated with the two partitions "SLOT-0"
and "SLOT-1". The "SLOT-0" can only be read.

In the following work the class driver can be extended so
that it can be used from the bootloader and update a flash
region directly from the bootloader.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-04-30 17:42:40 -04:00
Anas Nashif
a6eee02c00 samples: enhance integration sample and document it
Document the integration test sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 17:15:29 -04:00
Henrik Brix Andersen
2d1c5241bf samples: flash_shell: Use correct flash write block size
Change the flash_shell sample from using FLASH_WRITE_BLOCK_SIZE
definition to using the flash_get_write_block_size() api for the
selected flash_device.

This fixes the flash_shell sample when using multiple flash devices
with different write block sizes.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-04-30 17:05:06 -04:00
Henrik Brix Andersen
b27d96850f samples: bluetooth: Add Apple iBeacon demo application
Add a simple demo implementation of an Apple iBeacon BLE broadcaster.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-04-28 10:55:19 +03:00
Manivannan Sadhasivam
1572594b53 samples: drivers: Add sample application for LP3943
Add sample application for TI LP3943 LED driver. This application
displays a continuous pattern that turns on 16 LEDs at 1s one by
one until it reaches the end and turns off LEDs in reverse order.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-27 10:46:53 -05:00
Ravi kumar Veeramally
6c70aa28d2 samples: net: Fix CoAP server payload dump function
Payload dump function not adopted to multi fragments CoAP packet. Still
assumes whole payload exists in single packet. Also does not handle all
return cases of coap_packet_get_payload() function, which is causing
coverity failures.

Coverity-CID: 185277
Coverity-CID: 185278

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-04-27 13:28:25 +03:00
Johan Hedberg
9968cda453 fs: Convert NFFS partition to a generic one
The NFFS partition at the end of flash is also useful for any other
file system or even the Flash Circular Buffer (FCB). Rename the
partition from 'nffs_partition' to 'storage_partition' and make it
depend on a new hidden Kconfig entry which the relevant users will
select (such as NFFS and FCB).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-04-26 16:06:55 +05:30
Jukka Rissanen
f59a68b6d8 samples: net: http: Add TLS compilation test
Make sure that TLS configuration is valid by adding a compilation
test for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-26 12:35:05 +03:00
Michael Scott
970b0a9916 samples: lwm2m: update README with use of overlay files
Update the LwM2M client sample documentation with usage examples
of the newly introduced overlay-*.conf fragments.  Remove the
references to prj_dtls.conf.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-04-26 07:59:32 +03:00
Michael Scott
5df33d67fd samples: lwm2m: add overlay conf to support BT networking
The file overlay-bt.conf contains only the needed CONFIG items to
support Bluetooth networking.

For example, DTLS-enabled BLENano2 HW can be supported with the
following build:
cmake -GNinja -DBOARD=nrf52_blenano2 \
  -DCONF_FILE="prj.conf overlay-bt.conf overlay-dtls.conf" ..

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-04-26 07:59:32 +03:00
Michael Scott
30c3461e9b samples: lwm2m: replace prj_dtls.conf with overlay fragment
Instead of maintaining a nearly identical copy of prj.conf to support
DTLS, let's replace it with an overlay-dtls.conf file containing only
the CONFIG settings needed to support DTLS.  This can be used via the
-DCONF_FILE command line argument when configuring the sample:
Non-DTLS-enabled build:
cmake -GNinja -DBOARD=qemu_x86 ..
DTLS-enabled build:
cmake -GNinja -DBOARD=qemu_x86 \
  -DCONF_FILE="prj.conf overlay-dtls.conf" ..

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-04-26 07:59:32 +03:00
Andrei Emeltchenko
190e8d961c usb: wpanusb: Fix setting wrong length
During introduction of RAW channel pkt length was set to wrong value.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
24cc5cc4ab usb: wpanusb: Make generic interface to raw 802.15.4 channel
Reuse CONFIG_NET_APP_IEEE802154_DEV_NAME option.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
2b47d35839 usb: wpanusb: Fix regression with putting LQI to wrong place
Fix regression introduced by commit b52c0f24a6

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
acb0f0990e samples: echo_server: Update prj_cc2520 configuration
Fix missing CONFIG_NET_APP_IEEE802154_DEV_NAME option, etc

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
7337f4a069 usb: wpanusb: Code cleanup
Trivial code cleanup and doc update

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
74d08efbf2 usb: wpanusb: Correct protocol description
Notice about Vendor type.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
a5e7a8deec usb: wpanusb: Remove unused packet handlers
Remove class and custom handlers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
c8e2387402 usb: wpanusb: Remove unused headers
Remove old headers

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
9e753f0c20 usb: wpanusb: Clean up code
Remove unused code

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
10ec019a30 usb: wpanusb: Replace local hexdump() with net_hexdump()
Use standard helper from networking code

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Andrei Emeltchenko
a9d377e08d usb: wpanusb: Replace char array with structs for descriptor table
Use more readable format for descriptors.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-25 07:17:42 +05:30
Diego Sueiro
140daa2f27 sanitycheck: add min_flash option for 32K devices
Following tests were failing on a microcontroller with 32KB flash:
    test-mbedtls
    kernel.common

The min_flash option has been added in the test case yaml files.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-04-21 06:57:38 -07:00
Iván Sánchez Ortega
b35274a4e9 samples: usb: webusb: Prettify binary object store descriptor
This is a simple cosmetic change. Each field in the BOS (Binary
Object Store) descriptor has a comment, to understand it better.

Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
2018-04-20 21:06:11 -07:00
Andrei Emeltchenko
d665e12833 usb: hci_usb: Correct README
Correct README file

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-20 21:04:42 -07:00
Andrei Emeltchenko
fc5134b03f usb: hci_usb: Fix test name
Correct test name

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-20 21:04:42 -07:00
Andrei Emeltchenko
d38116cb03 usb: Use new USB Device interface for Bluetooth over USB sample
Use new interface for the sample.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-20 21:04:42 -07:00
Maureen Helm
4e8f29f319 gpio: Refactor the mcux gpio driver to use dts
Get the driver name, base address, irq number, and irq priority from
dts.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-04-20 08:54:11 -05:00
Erwan Gouriou
162b6e4b35 samples: Allow use of "CONTROLLER" postfix for LED and GPIO
Rework samples using LED and GPIO to enforce use of "CONTROLLER"
as LED and PGIO postifx.
Change impact all samples that could be run by boards yet moved to
GPIO node generations, which is only STM32 for now

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-04-19 09:32:39 -05:00
Ismael Fillonneau
28724732e7 doc: fix mgmt sample path
mgmt sample path in the documentation was incorrect

Signed-off-by: Ismael Fillonneau <ismael.fillonneau@stimio.fr>
2018-04-18 17:54:05 +02:00
Tarun Kumar Agarwal
3aa3e97675 samples: net: coap: Solved the payload issue in coap GET Method
In sample application of COAP there is no need of payload
for GET method & it is only applicable to put
and post methods are modified in coap-client.c

Signed-off-by: Tarun Kumar Agarwal <tarun.kumar.agarwal@intel.com>
2018-04-16 10:36:57 +03:00
Jukka Rissanen
79c4a5b4bf samples: net: coap_client: Fix compile error
The mgmt_event is undeclared so we need to remove this piece of
code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-12 15:10:19 +03:00
Marti Bolivar
023ae27d25 samples: telnet: fix net mgmt event handler
This is missing a mandatory check against the actual event.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-04-12 10:35:10 +03:00
Marti Bolivar
cd6a3f0457 samples: coap_client: fix net mgmt event handler
This is missing a mandatory check against the actual event.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-04-12 10:35:10 +03:00
David Leach
292033c1d0 openthread: kw41z: Adding echo/server project config files for KW41Z OT
- Added example OpenThread projects for KW41Z in echo/server samples
- Added projects to sample.yaml for sanity testing

Signed-off-by: David Leach <david.leach@nxp.com>
2018-04-11 16:57:12 +03:00
Jukka Rissanen
435d173870 samples: net: stats: Print ethernet statistics
If ethernet statistics collection is enabled, then print it
to the user.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-11 16:49:48 +03:00
Tomasz Bursztyka
f9159ab6bd samples/telnet: Fix accessing iface ipv4 config
A left over from commit 47dafffb67

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-11 16:28:16 +03:00
Andrei Emeltchenko
e295836b3a usb: dfu: Use USB Device defined VID / PID
Remove hardcoded DFU_VENDOR_ID and DFU_PRODUCT_ID and use
configuration values.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Andrei Emeltchenko
b6d912abf6 Bluetooth: hci_usb: Use USB Device defined VID / PID
Remove hardcoded INTEL_VENDOR_ID and PRODUCT_ID and use configuration
values.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Andrei Emeltchenko
a68a177cc7 wpanusb: Use DEBUG syslog level
Remove magic number

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Andrei Emeltchenko
32e089d2f0 wpanusb: Remove old hardcoded VID / PID
Use values defined in USB Device configuration

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Andrei Emeltchenko
c925bf5175 wpanusb: Remove unneeded configuration option
Remove unneeded configuration option reported during build.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Andrei Emeltchenko
05893ec51c wpanusb: Assign USB Product ID to 802.15.4 over USB
Assign special Product ID (0x101) to wpanusb protocol exporting
IEEE802.15.4 over USB.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-11 08:30:39 -04:00
Jukka Rissanen
15ccd9cc0d sample: net: stats: Example how to use net_mgmt for statistics
Simple application that queries network statistics periodically
via net_mgmt interface.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-10 13:29:39 +03:00
Anas Nashif
65600d4723 samples: power_mgr: add harnesss configuration
This test prints out to the console, when testing on real hardware,
parse output and compare to what we are expecting to avoid timeouts.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Anas Nashif
55ce5510f5 tests: cleanup subsystem tests meta-data
Cleanup testnames, tagging and filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Anas Nashif
156091fba6 samples: sample.yaml cleanup
Cleanup test names and filtering and add console harness support where
needed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Anas Nashif
016b21a463 tests: mbedtls_sslclient: fix filtering and default conf
Remove galileo as the only board to build for and cleanup the filtering.
Also, remove arduino 101 conf, this is not a networking platform we want
to tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-09 22:55:20 -04:00
Loic Poulain
7c5c222ca0 samples: net: Add test cases for USB EEM
Add test for zperf and http_server apps.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2018-04-06 06:50:34 -04:00
David B. Kinder
e48b64d1be doc: fix doc misspellings in doc, boards, samples
Occasional spelling-check scan found some misspellings.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-04-05 19:17:01 -04:00
Carles Cufi
bd583ed92d samples: mgmt: Expand smp_svr sample documentation
Expand the contents of the smp_svr sample documentation so that it
covers all steps needed to perform DFU over BLE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-04-05 16:56:46 +02:00
Carles Cufi
81d211f3c8 samples: hci_uart: Add references to sections
Add a couple of references so that we can link to those from other
documentation sections.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-04-05 16:56:46 +02:00
Jukka Rissanen
73b43e0024 drivers: eth: native_posix: Add VLAN support
Support also virtual LAN (VLAN) with native_posix ethernet driver.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-05 08:54:19 -04:00
Jukka Rissanen
5fbd48077b samples: net: vlan: Simple app for setting virtual lan settings
This application just enables VLAN tag for ethernet interface.
Set CONFIG_SAMPLE_VLAN_TAG option to define the desired VLAN tag.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-05 08:54:19 -04:00
Jukka Rissanen
a0df4f6698 samples: net: Fix sanitycheck for sam_e70_xplained board
Some of the sanitycheck tests were having too small limit for
network buffers when compiling for sam_e70_xplained board.
Increase the buffer limits when testing this for this board.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-05 08:25:49 -04:00
Alberto Escolar Piedras
2d926f3594 native: doc eth TAP: can only be compiled in Unix
Minor change in eth tap interface, as it can only be compiled
in Unix

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-04-04 15:30:07 -04:00
Tomasz Bursztyka
3f4cffc302 spi: Remove SPI legacy API
No drivers nor samples are using it anymore.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka
e7de85b534 samples/bluetooth: Move hci_spi to new SPI API
Removing old API usage.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka
308f4df91d samples/drivers: Switch Fujistu FRAM sample to new SPI API
Replacing legacy API calls by news ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka
eb7af5527d drivers/sensors: Switch bmi160 driver to new SPI API
Replacing legacy API calls by news ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka
244c2af154 drivers/sensors: Switch bme280 driver to new SPI API
Replacing legacy API calls by news ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka
324265420b api/spi: Disable legacy API by default
Let's start deprecation work of the SPI legacy API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Armando Visconti
87d6c50e47 sensors: Add separation between ambient and die temperature
Some device include a temperature sensor, usually used as a
companion for helping in drift compensation, that measure the
die temperature. This temperature IS NOT related to the the
ambient temperature, hence a clean separation between the two
is required.

This commit introduces a clean separation between the two
types of temperature leaving the old deprecated definition
still there.

The list of current drivers that read the die (and not the ambient)
temperature is the following:

 - adxl362
 - bma280
 - bmg160
 - bmi160
 - fxos8700
 - lis3mdl
 - lsm6ds0
 - lsm6dsl
 - lsm9ds0
 - mpu6050

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-04-03 22:29:11 -04:00
Andrei Emeltchenko
842ab93f6e usb: Add multifunction composite build test
Add multifunction composite test for building USB device with HID and
MSC functions.

Fixes: #2613

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-03 15:58:33 -04:00
Andrei Emeltchenko
0a39c15839 usb: sample: Add support for composite configuration for HID
The current problem with HID is that we need to "patch" static
descriptor table with the size of report descriptor defined in the
user application.

The proposed solution is to have composite_pre_init() defined with
priority CONFIG_KERNEL_INIT_PRIORITY_DEVICE which should run before
composite_init() defined with priority
CONFIG_APPLICATION_INIT_PRIORITY.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-03 15:58:33 -04:00
Andrei Emeltchenko
3bf9b05b13 tests: Add USB HID composite test
Test also composite configuration

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-03 15:58:33 -04:00
Andrei Emeltchenko
0dfeb32a31 usb: Remove USB VID / PID for sanity check builds
We can use default values of CONFIG_USB_DEVICE_VID and
CONFIG_USB_DEVICE_PID for sanity check builds.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-03 15:58:33 -04:00
Andrei Emeltchenko
6f979c39eb Bluetooth: hci_usb: Simplify write function
Use net_buf primitives

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-03 15:04:18 +03:00
Anas Nashif
e9cc4ac3db samples: fix sample yaml file syntax
Add test definition correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-31 11:23:49 -04:00
Jukka Rissanen
217c0edddd samples: net: http_server: Send final chunk
The final ending chunk was not sent after the request was served.
This caused the remote client to constantly send the same request
to the server.

Fixes #6356

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-29 16:54:04 +03:00
Tarun Kumar Agarwal
17234a9f59 samples: net: add put and post methods to coap
In sample application of COAP put and post
methods are implemented in coap-server.c
and coap-client.c

Signed-off-by: Tarun Kumar Agarwal <tarun.kumar.agarwal@intel.com>
2018-03-29 09:30:45 -04:00
qianfan Zhao
b2570d2a55 samples: usb: add usb hid mouse sample
this sample expect there has a button in you board, that was
the mouse's left button, tested in linux by using evtest.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-03-28 10:44:58 -04:00
Jukka Rissanen
9626cba0cb sample: net: echo-server: Cleanup config files
Combine several generic config file into prj.conf that can be
used by several boards and configurations.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-28 09:41:05 +03:00
Jukka Rissanen
ba3c0bb123 samples: net: Add traffic class sample application
This demostrates how to classify the network traffic when sending
data. The application will create similar functionality as
echo-client so user can use echo-server running in remote host to
test this sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
ca8b00a3cc net: if: Make interface IP configuration more flexible
Instead of always allocating both IPv6 and IPv4 address information
to every network interface, allow more fine grained address
configuration. So it is possible to have IPv6 or IPv4 only network
interfaces.

This commit introduces two new config options:
CONFIG_NET_IF_MAX_IPV4_COUNT and CONFIG_NET_IF_MAX_IPV6_COUNT
which tell how many IP address information structs are allocated
statically. At runtime when network interface is setup, it is then
possible to attach this IP address info struct to a specific
network interface. This can save considerable amount of memory
as the IP address information struct can be quite large (depends
on how many IP addresses user configures in the system).

Note that the value of CONFIG_NET_IF_MAX_IPV4_COUNT and
CONFIG_NET_IF_MAX_IPV6_COUNT should reflect the estimated number of
network interfaces in the system. So if if CONFIG_NET_IF_MAX_IPV6_COUNT
is set to 1 and there are two network interfaces that need IPv6
addresses, then the system will not be able to setup IPv6 addresses to
the second network interface in this case. This scenario might be
just fine if the second network interface is IPv4 only. The net_if.c
will print a warning during startup if mismatch about the counts and
the actual number of network interface is detected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Jukka Rissanen
47dafffb67 net: if: Separate IP address configuration from net_if
Move IP address settings from net_if to separate structs.
This is needed for VLAN support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-27 10:06:54 -04:00
Sebastian Bøe
bdc5c72498 samples: Add sample that demonstrates a custom board definition
Add a sample that demonstrates a custom board definition. This proves
that BOARD_ROOT works and can be a useful reference when creating a
custom board definition.

Instead of spending time making up a board, the nrf52840_pca10056
board has been copied as-is. And the hello world sample has been used
as the basis for the application.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-27 09:35:35 -04:00
Sebastian Bøe
38f8e849b5 doc: Introduce the sample category app. dev. to the docs
There are currently two samples in the
~/zephyr/samples/application_development/ directory. This commit
allows them to be visible in the documentation.

It is not clear why this has not been done already.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-03-27 09:35:35 -04:00
Carles Cufi
82f85c6565 doc: samples: hci_uart: Expand instructions for the Controller
Cover the required steps to use the Controller with Linux's BlueZ and
QEMU, and link to the relevant sections in the subsystem developer
guide.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-27 09:45:08 +02:00
Carles Cufi
9ba007e878 doc; bluetooth: Rework and expand the Bluetooth doc
In order to avoid duplication, move all information relating to QEMU and
BlueZ from samples to subsystems, and expand to cover BlueZ installation
and usage of Controllers with BlueZ and QEMU in detail.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-27 09:45:08 +02:00
Anas Nashif
993c350b92 cleanup: replace old jira numbers with GH issues
Replace all references to old JIRA issues (ZEP) with the corrosponding
Github issue ID.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-26 13:13:04 -04:00
Carles Cufi
8761bf05d1 samples: mgmt: Remove unnecessary mbedTLS reference
Since the base64 encoding and decoding functionalit is now provided by a
separate library, remove the line in the CMakeLists.txt file that refers
to it.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-26 16:29:27 +02:00
Carles Cufi
ab2d3e70c6 samples: mgmt: Remove unneeded DTC overlay
With the new CONFIG_BOOTLOADER_MCUBOOT option there is no longer a need
to define custom overlays in order for a project to be bootable by
MCUboot. Remove therefore those unnecessary complications in the sample.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-26 16:29:27 +02:00
Jukka Rissanen
4402fbcdd6 samples: net: websocket_console: Do not copy pass end of string
We might access too long string when copying URL.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-26 13:00:11 +03:00
Anas Nashif
66d60d2941 boards: delete arduino_101_ble board
This board is the same as curie_ble, so remove duplication and have only
one board definition.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-23 16:21:16 -04:00
Jukka Rissanen
6170ae5e2e net: websocket: Use system provided base64 function
Instead of using mbedtls_base64, use system provided base64 encoding
function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-23 08:30:26 -04:00
Iván Sánchez Ortega
eaaab7771b samples: usb: Make each sample have its own USB product string
Each USB sample, when compiled, will provide a different
USB product string. A "nice to have" feature when trying
out the USB samples (they will show up differently in
`lsusb` or `dmesg`), and also illustrates how to set up
custom USB constants in the config files.

Requires #6589.

Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
2018-03-22 12:41:40 +01:00
4d6d04d3ea hid: change the API table to const.
A minor change to put the API function table into flash.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-03-21 19:45:11 -04:00
Carles Cufi
8aa9a37902 drivers: flash: nrf: Rename nrf5 to nrf
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.

Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 20:07:09 +01:00
Adithya Baglody
3a6d72ecde kernel: mem_domain: k_mem_partition is now placed in kernel memory.
The k_mem_partition structs need to be placed in the kernel memory.
This patch ensures that these structs are placed correctly.
Also when a struct k_mem_domain is declared it is advised to add
__kernel.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-03-20 09:19:59 -07:00
Jukka Rissanen
44eb83624f tests: net: websocket: Fix null pointer dereference
Network packet cannot be NULL so no need to check its value.

Coverity-CID: 183063
Fixes #6669

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-20 12:19:13 -04:00
Carles Cufi
f49150cab6 arch: arm: nrf: Rename nrf5 SoC Family to nrf
Upcoming Nordic ICs that share many of the peripherals and architecture
with the currently supported nRF5x ones are no longer part of the nRF5
family. In order to accomodate that, rename the SoC family from nrf5 to
nrf, so that it can contain all of the members of the wider Nordic
family.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 11:57:14 +01:00
Anas Nashif
e5f1b51f01 debug: fix RTT console Kconfig
Use HAS_ Kconfig option as intended, those are invisible option that
signify support of a certain feature that can be selected by a hardware
or platform.

For RTT and system view this was not dont in an inconsistent way.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-19 15:37:26 -04:00
Jukka Rissanen
e4212306cd samples: net: eth_native_posix: Sample for native networking
This application just enables native host networking and net-shell
which allows connectivity from zephyr to host system via tap device.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-18 20:47:36 -04:00
Paul Sokolovsky
e82578919a mbedtls: Replace COAP-specific max len setting with generic
Instead of CONFIG_COAP_MBEDTLS_SSL_MAX_CONTENT_LEN, use recently
introduced CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-03-18 09:38:22 -07:00
Paul Sokolovsky
7558ce8cdb mbedtls: Add CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN
This value allows to set max payload length of a TLS protocol
message, and passed thru to mbedTLS as MBEDTLS_SSL_MAX_CONTENT_LEN
setting. The only safe value is 16384, which translates to 32KB
of RAM required just for mbedTLS input/output buffers. Any other
value can be configured *only* per a particular application
(e.g. knowing that it won't pass more than spefific amount of
data at once and/or won't connect to a server with a long cert
chain). Previosuly, we had quite an adhoc and inflexible config
with random values for that setting, based on protocol.

Note that while the safe value is 16384, "backward compatible"
default of 1500 is used (good for DTLS on the other hand).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-03-18 09:38:22 -07:00
Loic Poulain
175dd9600e net: samples: Reduce net pkt RAM usage
There are 174 RX/TX net pkt reserved, this make build fail
with some boards due to ram overflow (e.g quark_se_c1000).
Fix this by reducing NET_PKT RX/TX reserve to 100, which
seems fair enough for this use case. Moreover, don't think
there is any reason to have more NET_PKT than NET_BUF.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2018-03-16 14:45:24 -07:00
Andrei Emeltchenko
4304b4c38b usb: cdc_acm: yield in the waiting loop
Add k_yield() when waiting for data to be transmitted

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-03-15 15:58:02 -07:00
Andrei Emeltchenko
756c50aa53 usb: cdc_acm: Fix write when USB writes only chunk
Current implementation of cdc_acm writes 4 bytes for quark_se at a time
and current code misses remaining data chunks. Make sense to check
written bytes for other platforms as well.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-03-15 15:58:02 -07:00
Kumar Gala
0fea45aa4f samples/tests: net: websocket: Fix yaml files
The yaml files had a '-' before test: which was causing an error
relating to trying to load the yaml

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-03-15 16:29:01 -05:00
Jukka Rissanen
2abba3582d samples: net: syslog: Remote syslog service example
The sample application will send syslog messages to remote
syslog server.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-15 15:19:46 +02:00
Jukka Rissanen
2f4fa71b87 samples: net: websocket: Add console sample application
This sample application implements a web service that provides
zephyr console over websocket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-15 15:17:36 +02:00
Jukka Rissanen
1e6ed0335a samples: net: websocket echo-server application
This is a http(s) server that supports also websocket.
It sends back any data sent to it over a websocket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-03-15 15:17:36 +02:00
Sundar Subramaniyan
2114da018a tests: samples: Exclude nrf52840_pca10056 from wpanusb sample
With usb_device support added to nrf52840_pca10056 board, sanity
check script compiles the sample net/wpanusb and it fails with
undefined reference for symbol cc2520_configure_gpios.

First of all cc2520 shouldn't be compiled at all for nrf52840
since it has its own ieee802154 radio. The prj.conf under the
sample samples/net/wpanusb simply hard codes the config
CONFIG_IEEE802154_CC2520=y and is causing the ieee80211_cc2520.c
file to be compiled. If it's removed from the configuration file
we get other errors. So it is not straight forward.

For now, as a workaround, exclude the nrf52840_pca10056 platform
until there's a proper fix.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-15 12:39:53 +01:00
Sundar Subramaniyan
4a90d97588 tests: samples: Add nrf52840_pca10056 board to USB test cases
Add nrf52840_pca10056 to platform whitelist for hci_usb and cdc_acm
samples.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-15 12:39:53 +01:00
Andrzej Puzdrowski
ca6ebbdf74 samples: subsys: mgmt: mcumgr: Fix FS part of smp_svr example
After introducing of Virtual File System Switch (#6318)
it i required to mount file system in order to use it.
This patch add to the example code which mounts NFFS
file system in the example.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-03-14 17:40:18 +01:00
Iván Sánchez Ortega
fa57ebd5b7 usb: Rename unicode into UTF16LE
In order to avoid confusion between "Unicode", UTF8, UTF16, UTF32,
and endianess of these encodings, rename all instances of "Unicode"
in the USB subsystem and samples into "UTF16LE".

Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
2018-03-14 13:40:59 +01:00
Sundar Subramaniyan
3b857e1869 Bluetooth: hci_usb: Read the whole USB EPOUT buffer at once
btusb_bulk_out() reads the EPOUT buffer in multiple of 4 bytes because
of Quark's USB FIFO size limitation. But this has later been taken care
internally in the DW driver making it redundant in hci_usb.

Remove Quark specific handling and read the whole EPOUT buffer at once.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-09 21:46:59 -05:00
Sundar Subramaniyan
5c162dfe78 Bluetooth: hci_usb: Write large packets to USB in multiple chunks
try_write() writes the whole net buffer to USB which sometimes is larger
than the maximum packet size of an endpoint.

Use the ret_bytes param to know how much has been written to the USB bus
and write the remaining chunks in the subsequent calls.

Usually the USB driver write doesn't happen immediately in cases where
the usb_write() is not synchronous. In such cases, USB driver returns
-EAGAIN.

If driver returns -EAGAIN, yield so as to give other threads a chance
to run while waiting for previous USB write to complete.

Signed-off-by: Sundar Subramaniyan <sundar.subramaniyan@gmail.com>
2018-03-09 21:46:59 -05:00
Stig Bjørlykke
a7e01f4d40 samples: net: Remove references to ZoAP
Rename variable zpkt to cpkt to complete the move from ZoAP to CoAP.

Remove unused tests/net/lib/zoap/CMakeLists.txt file.

Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
2018-03-09 20:25:37 -05:00
Johan Hedberg
b9588d8eb6 Bluetooth: Mesh: Switch to using Linux Foundation Company ID
The Linux Foundation now has an assigned Company Identifier, so switch
to using that.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-03-05 19:54:21 -05:00
Johan Hedberg
67b321eec9 samples: bluetooth: mesh: Add basic documentation
Add documentation for the mesh and mesh_demo sample applications.

Fixes #6279

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-03-05 19:53:48 -05:00
Kumar Gala
2f4e987945 samples: sensor: ccs811: Add dummy dts.fixup so we can always build
Not all boards are going to have the ccs811 on them, and thus not in the
device tree.  We need a dts.fixup stub to dummy out the CONFIG_CCS811_*
defines that the driver expects.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-03-05 14:16:46 -06:00
Ravi kumar Veeramally
ebc81bdf8d net: http: Provide destination address in http replies
net_app_ctx maintains multiple net contexts(net_ctx). But when http
api's wants to reply or send some data, its always choose the first
net_context in the array, which is not correct always.

net_app_get_net_pkt_with_dst() api will select proper context
based on destination address. So with the help of new api in
net_app, http can select proper context and send packets. To
achieve this, desination address is provided in http_recv_cb_t
and http_connect_cb_t callbacks. Also chaged relevant API's to
provide destination address in http message preparation methods.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-03-05 10:23:17 +01:00
Johan Hedberg
dd9f5e2a1d samples: led_strip: Extend ws2812 sample with ws2812b_sw support
Add support for building the WS2812 LED strip driver sample against
the new ws2812b_sw driver. Currently a configuration is only provided
for the BBC micro:bit board.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-03-03 20:46:53 +01:00
Paul Sokolovsky
a3a5c48d93 samples: net: echo_async: Better error and write handling
Initially this sample was intended to be very simple and schematic,
but as this sample going to become a base for stream API conversion,
time to handle all the edge conditions.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-03-02 16:50:41 +01:00
Paul Sokolovsky
8e867378da samples: sockets: echo: Better error and short write handling
Initially this sample was intended to be very simple and schematic,
but as this sample going to become a base for stream API conversion,
time to handle all the edge conditions.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-26 10:20:50 -06:00
Vitor Massaru Iha
6f9823e4a6 samples: basic: fade_led: Update sample to work with ESP32
Update fade_led sample to work with ESP32.

Signed-off-by: Vitor Massaru Iha <vitor@massaru.org>
2018-02-23 13:13:12 -05:00
Alberto Escolar Piedras
d118b6470e samples: drivers/entropy fixes
* .yaml: added expression for test
* README: Eeach second 9 bytes are generated not 10

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-23 07:34:07 -05:00
Paul Sokolovsky
ec207f4250 net: app: Move mbedTLS debug log level config to mbedTLS Kconfig
mbedTLS log level is obviously a mbedTLS config setting. It makes
sense to have it defined in mbedTLS Kconfig, and different parts
of Zephyr to reuse as needed (e.g. net-app vs upcoming TLS wrapper
for sockets).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-22 18:44:55 -05:00
Kumar Gala
d9bd6909c3 samples: dump_http_server: move generated files into include/generated
Move the generated files into include/generated so they live with the
build and not in the zephyr source tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-02-21 18:53:23 -05:00
Christopher Collins
3e30e8164f samples: subsys: mgmt: smp_svr: add sample app
This commit adds the sample `smp_svr` app from the mcumgr repo.

Signed-off-by: Christopher Collins <ccollins@apache.org>
2018-02-20 22:07:52 +01:00
Pedro Martucci
a495b31ee0 sample: net: RPL mesh sample over QEMU
Create a net sample to setup a multi-node RPL mesh network using QMEU.
To enable this, it was necessary implement a hw filter on IEEE 802.15.4
UART Pipe driver and create a QEMU pipe management on cmake.

This sample use a tool developed on zephyr net-tools repository called
virtual-hub.

Signed-off-by: Pedro Martucci <pedropaulomartucci@gmail.com>
2018-02-20 14:47:14 +02:00
Paul Sokolovsky
7e06be2218 samples: sockets: http_get: Include Host: header in request
The Host header is even mandatory in HTTP 1.1, and indeed without
it, many virtual hosting setups don't work (which are many), so to
be faithful to what README says: "You can edit the source code to
issue a request to any other site on the Internet", let's
complicate the sample by including it.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-19 10:39:14 +02:00
Leandro Pereira
2a98e7cfb4 samples: drivers: crypto: Print correct buffer comparison on failure
When testing whether the CTR mode decrypted the payload properly, a
comparison of `decrypt.out_buf` with the known plain text `plaintext`
is performed, but the buffer comparison that is printed uses
`plaintext` and `encrypt.out_buf` instead.

Coverity-CID: 181847

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-02-17 09:15:10 -05:00
Paul Sokolovsky
f303e9d115 samples: sockets: Add big_http_download sample
This sample downloads a more or less big file (~6MB as preconfigured)
over HTTP and checks its hash for integrity. It also repeat such a
download indefinitely, counting total number of bytes transferred.

This is thus a kind of traffic load testing sample. (Ported to C
from MicroPython original).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-17 09:11:29 -05:00
Andy Ross
648ce1b1ff mpu_stack_guard_test: Disable on xtensa
As with the other non-MPU architectures, we don't want to run this
test.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Andy Ross
837dd99a0e samples/xtensa-asm2: Unit test for new Xtensa assembly primitives
This sample (which should eventually become a proper test) suite
builds from simple applications of the new primitives to a full
context switch test and interrupt handling suite (based on the
CPU-internal CCOMPARE2 timer).

It's been extraordinarily useful finding regressing as the asm2 code
gets modified and should probably stick around as long as possible.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-02-16 10:44:29 -05:00
Paul Sokolovsky
42680b07af mbedtls: Switch default MBEDTLS_CFG_FILE to config-mini-tls1_2.h
The previous default, "config-threadnet.h", is more or less arbitrary
choice made in a commit 312def2c78 1.5 years ago. In particular,
it's not related to Thread support in Zephyr per se (there was no
such support at that time).

It doesn't make sense to have a default intended for a particular,
not widely used (yet) protocol. Instead, the default should work
out of the box with a contemporary widely deployed arrays of TLS
servers, which are HTTPS server. config-mini-tls1_2.h works with
https://google.com, and by extension, with many other servers on
the Internet.

So, have that as the default, and let applications with special
needs to override that to what they need.

Addresses: #6132

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-15 12:35:31 -05:00
Erwin Rol
6c0e69e7fd samples: olimex_stm32_e407: CCM usage example
Add an example program showing the use of the STM32 CCM.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2018-02-13 12:36:22 -06:00
Luiz Augusto von Dentz
5c464b1bcc Bluetooth: central_hr: Fix assigning temporary UUID to discovery
bt_gatt_discover_params parameter shall remain valid as long as the
procedure is in place.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-02-13 16:24:04 +02:00
Johan Hedberg
ac1360f0a7 Bluetooth: Mesh: Convert to new net_buf_simple APIs
Convert the mesh code to use the new net_buf_siple APIs. This has the
benefit of saving 4 bytes off the stack due to the not needed pointer.
Also update the publication context helpers to map to the new
net_buf_simple API in an intuitive way.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-13 14:00:08 +02:00
Luiz Augusto von Dentz
800bfaf9a7 Bluetooth: UUID: Remove macros defining 16 bit values
Application should normally declare a bt_uuid with proper type and then
use bt_uuid_cmp.

Fixes #5162

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-02-13 13:33:48 +02:00
David B. Kinder
8cdd9bed6c doc: fix duplicate sample doc titles
Two docs listed in the Samples an Demos TOC had the same title displayed
in the board-specific samples section, "Power Management Demo".  Give
both sample docs a more specific title.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-02-12 21:59:54 -05:00
Paul Sokolovsky
bc1a82acc7 samples: net: sockets: Clean up/improve socket samples
With 323e8cf069 applied and printf() working out of the box,
CONFIG_NET_BUF_LOG=y workarounds can be removed from configs of
all samples.

Also, print an intro message at the start of each server sample,
to give a user hint that the app didn't just hang and what to do
next. (The port waiting for connection is printed. We can't (easily)
print host address, because the samples should run on both Zephyr
and POSIX systems, and finding out local host address would require
hairy #ifdef's undermining the purpose of these samples (that is,
showing that the *same* code can be used on both types of systems)).

Fixes: #5379

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-11 09:49:31 -05:00
Johan Hedberg
dd09cbc1c4 net: buf: Redesigned API with split data and meta-data
Redesign of the net_buf_simple and net_buf structs, where the data
payload portion is split to a separately allocated chunk of memory. In
practice this means that buf->__buf becomes a pointer from having just
been a marker (empty array) for where the payload begins right after
the meta-data.

Fixes #3283

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg
bd989a79ba tests: Remove broken net_buf unit tests
The net_buf unit tests were doing some pretty hacky stuff with
defining a dummy _net_buf_pool_list variable to fulfil the linker
magic that happens with a real build. Until now the code got lucky in
that the simple net_buf_alloc() tests didn't depend on
_net_buf_pool_list being valid, however with the coming redesign even
net_buf_alloc will require proper setup of this.

Since the unit tests were extremely minimal, and not testing anything
beyond what tests/net/buf already tests, just remove them for now.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg
1d131338bc net: samples: zperf: Reduce quark_se_c1000_devboard buffer counts
This gives a bit more margin to the available RAM.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg
5856540c90 net: samples: throughput_server: Decrease buffer count
Decrease the buffer count in order to give a reasonable margin to the
available RAM.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Erwan Gouriou
1caea8738c samples: bluetooth/ipsp: Update multicast address
With current value of IPV6 Multicast address, IPV6 mcast bind
does not succeed and IPSP use case could not work.
Change use case multicast address to match IPV6 address and
enable binding

fixes: #6050

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-02-08 14:40:42 +02:00
Erwan Gouriou
c734c2972f flash: remove obsolete FLASH_DRIVER_NAME
Replace seldom occurrences of FLASH_DRIVER_NAME by equivalent
and commonly used FLASH_DEV_NAME.

Fixes #5919.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-02-06 11:48:53 -06:00
Manivannan Sadhasivam
2c31ccee0e samples: sensor: Add sample application for CCS811 sensor
Add sample application for AMS CCS811 digital gas sensor driver.
This application fetches Co2, VOC, Voltage and Current readings
from the sensor and prints it on serial console continuously.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-02-06 11:16:26 -05:00
Paul Sokolovsky
166cd7f66d samples: sockets: http_get: More configurability and logging
Make it easy to override HTTP host/port/path. Print URL which we
request and make few other adjustment to the output for clarity.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-06 12:57:48 +02:00
Paul Sokolovsky
63f862b262 samples: sensor: vl53l0x: Update for SENSOR_CHAN_DISTANCE refactor
SENSOR_CHAN_DISTANCE is now in meters. Print value in meters, as
double, this requires printf() and CONFIG_STDOUT_CONSOLE. This is
similar to how other sensor samples have it.

Fixes: #5693

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-05 10:30:34 -06:00
Paul Sokolovsky
b2ce9df077 tests: Few test require CONFIG_STDOUT_CONSOLE=n
For some, "y" affects output, for some less tested platforms, leads
to crashes.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-05 07:05:12 -08:00
Andrei Emeltchenko
c3a9f8d4f8 usb: sanitycheck: Clean up sample.yaml
Remove old sample VID/PID and use new style.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-02-05 06:39:50 -08:00
Paul Sokolovsky
b7623a85b0 sensors: Redefine SENSOR_CHAN_HUMIDITY in percents, not milli-percents.
Based on the discussion in #5693, the reason why humidity was defined
in milli-percent was likely following Linux which defines it as such
in its sensor subsystem:
http://elixir.free-electrons.com/linux/latest/source/Documentation/ABI/testing/sysfs-bus-iio#L263

However, Linux defines temperature in milli-degrees either, but
Zephyr uses degrees (similarly for most other quantities). Typical
sensor resolution/precision for humidity is also on the order of 1%.

One of the existing drivers, th02.c, already returned values in
percents, and few apps showed it without conversion and/or units,
leading to confusing output to user like "54500".

So, switching units to percents, and update all the drivers and
sample apps.

For few drivers, there was also optimized conversion arithmetics
to avoid u64_t operations. (There're probably more places to
optimize it, and temperature conversion could use such optimization
too, but that's left for another patch.)

Fixes: #5693

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-05 14:10:39 +01:00
Alberto Escolar Piedras
6ef85ed6fc test: shell: native_posix also supports shell
The native_posix port also supports shell apps thru its
stdin redirection.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-02 07:48:46 -08:00
David B. Kinder
ec1b1df5ed doc: fix ReST heading underlines
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>
2018-02-01 19:33:39 -08:00
Maureen Helm
928ff12c73 samples: drivers: Add freedom boards to flash_shell sample
Adds frdm_k64f, frdm_kw41z, and frdm_kl25z boards to the flash_shell
sample.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 16:43:40 -06:00
Maureen Helm
e92df9c01d samples: Build hts221 sensor sample only on supported boards
The hts221 sensor driver was implicitly made dependent upon the
disco_l475_iot1 board when it was converted to dts, so build the
associated sample only for this board. This issue was encountered when
adding sensor dts support to nxp boards, which don't have hts221.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Johan Hedberg
8fc4c99496 Bluetooth: Remove redundant AD parsing check
A few lines earlier the code bails out in case len is 0. Checking for
buf->len < 1 is the same as checking for buf->len == 0. Since len is
guaranteed to be > 0 here the check len > buf->len implicitly checks
for buf->len == 0, i.e. the second test can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 07:01:10 -08:00
Andrei Emeltchenko
f3653b1a5c usb: Add sanitycheck configuration
Add configuration for sanitycheck for HID sample

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko
bab250a0e8 usb: samples: Add HID sample
Add simple USB HID sample device. Connecting to Linux registers as
input device, lsusb is able to show descriptors (unbinded from input)

...
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      32
          Report Descriptor: (length is 32)
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x00 ] 0
                            Undefined
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report ID, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Local ): Usage, data= [ 0x00 ] 0
                            Undefined
            Item(Main  ): Input, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile
Bitfield
            Item(Global): Report ID, data= [ 0x02 ] 2
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Local ): Usage, data= [ 0x00 ] 0
                            Undefined
            Item(Main  ): Output, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile
Bitfield
            Item(Main  ): End Collection, data=none
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
David B. Kinder
701bb2afba doc: fix misspellings in boards and samples docs
Fix misspellings found in board and sample docs missed during regular
reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-01-30 20:27:43 -05:00
Kamil Sroka
8dd852dc92 samples: net: Add config and enable CI for OpenThread on nRF52840
Add samples config for nRF52840 with OpenThread
for echo_client and echo_server.

Add OpenThread to CI for echo_client and echo_server on nRF52840

Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
2018-01-29 22:42:03 -05:00
Kumar Gala
a394693d2f drivers: flash: NXP k6x/kw2xd: Convert to use device tree
Convert NXP k6x and kw2xd flash driver to use device tree to get the
flash controller name from device tree.  We introduce yaml bindings for
the "nxp,kinetis-ftfe" and "nxp,kinetis-ftfl" devices.

Fixes: #5788

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-29 16:34:49 -06:00
Anders Pitman
dbba22397c samples: button: Fix button sample GPIO for nRF52
Applies to #4008 and #5159 for this board. Problem is that the
button interrupt callback was only firing once. Solution is to
set the pin pull up flag to GPIO_PUD_PULL_UP.

Signed-off-by: Anders Pitman <tapitman11@gmail.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-29 10:23:36 +01:00
Jukka Rissanen
37f54c11fa samples: net: perf: Add sample for throughput measurement
Add a simple UDP server application that will receive UDP data
and print various statistics like number of packets received and
dropped, amount of bytes received, and how many packets / sec
we were able to receive.

Currently the sample only provides a config file for FRDM-K64F board.
Note that this sample should not be run in QEMU as the performance
is very bad there because of SLIP link between Linux host and QEMU.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-01-29 01:57:41 +05:30
f9ebe62b3c samples: update the blinky sample to work with the Arduino Zero.
The GPIO unit on the SAM0 is called 'PORT' which conflicts with the
name used in this sample.  Rename to LED_PORT instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-29 01:41:41 +05:30
Kumar Gala
dc98605f4a drivers: flash: stm32: Convert to use device tree
Convert STM32 flash drivers to use device tree to get the flash
controller name and base address.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-26 09:25:57 -06:00
Kumar Gala
26e4da52cf arm: nordic: flash: Use FLASH_DEV_NAME define
We want to move to use a common FLASH_DEV_NAME across the various flash
drivers. So samples, tests, or other code can be a bit more generic.  So
replace CONFIG_SOC_FLASH_NRF5_DEV_NAME with FLASH_DEV_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-25 15:23:00 -06:00
Anas Nashif
1a67aed51f samples: crypto: remove DEBUG/ASSERT from prj.conf
Those are added by sanitycheck, no need to have them enabled in the
project by default.

CONFIG_DEBUG is causing issues on qemu_nios2, see #5743.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
2eb443f2d8 samples: philosophers: test different configurations
The demo can be configured to use different object types for its
synchronization, so test all of them.

The demo can also be configured to work with static objects or dynamic
objects, byt default the demo uses dynamic objects, add a test for
static objects.

Also, the demo can be configured to work with threads of the same
priority or not, so enable both options for testing

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
6de0dfad51 samples: event_logger: match more lines during sanitycheck
Have the test run for long by matching more lines in the output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
3a0a592583 samples: hello_world: disbale asserts on single thread (REVERTME)
For some reason, single thread is stuck when asserts are enabled.

This is tracked in #5733.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
40188a8449 samples: exclude some platforms due to bug [REVERTME]
Do not build for some unsupported architecture and exclude ARM qemu
platform due to bug #5735.

STACK_ALIGN 0x8
MPU STACK GUARD Test
Canary Initial Value = 0xf0cacc1a threads 0x200010e0
Canary = 0x20000240    Test not passed.
***** BUS FAULT *****
  Executing thread ID (thread): 0x200010e0
  Faulting instruction address:  0x209c
  Imprecise data bus error
Fatal fault in thread 0x200010e0! Aborting.
***** HARD FAULT *****
  Fault escalation (see below)
***** BUS FAULT *****
  Executing thread ID (thread): 0x200010e0
  Faulting instruction address:  0x1f4
  Imprecise data bus error
Fatal fault in ISR! Spinning...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
04035d19bc tests: nfc_hello: remove filter and support harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
a7a1e393ab tests: mem_domain_apis: remove filter and support harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
9f6147395f tests: mpu_stack_guard: remove filter and support harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
d2b7749428 samples: event_logger: remove filter and support harness
Evaluate output from sample and record success/failure.

Enable on other platforms, this should not be whitelisted.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
5d3a534807 samples: use console harness for some samples
The output of those samples can be parsed and verified by sanitycheck,
so lets use the console harness for this.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
5ba7eed255 samples: philosophers: test more scenarios
Enable 2 additional documented scenarios:
- preempt only
- coop only

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
d6cc2909b8 sample: kernel_event_logger: cleanup headers
Remove unused and duplicated header inclusion.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
1b1b7091ff sample: cpp_synchronization: support console harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
5c8124f96b sample: philosophers: support console harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
4843c69f06 sample: external_lib: support console harness
Evaluate console output of sample.

Enable on other platforms, this should not be whitelisted.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
a442987b02 sample: hello_world: support console harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif
dfbc0f5efb sample: synchronization: support console harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Vincent Veron
8310c53200 sample: sensor: Add vl53l0x sample application
This sample application allows to test vl53l0x distance sensor.
By default it is built with disco_l475_iot1 board as it is
built-in.

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2018-01-23 10:14:49 -06:00
Paul Sokolovsky
6bab4998ba samples: net: zperf: Fix only IPv4/only IPv6 build, better messages
The code couldn't really build with only CONFIG_NET_IPV4 or
CONFIG_NET_IPV6 enabled, because some parts weren't covered
by #ifdef's. Regroup the code to get it covered.

Also, improve error/notice messages.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-01-22 10:15:27 +02:00
Andrzej Puzdrowski
9fdcab9b1b samples: drivers: soc_flash_nrf5 fix missing flash write access
By default CONFIG_MPU_ALLOW_FLASH_WRITE=n so the example must have been
falling on any write to flash.
This patch adds CONFIG_MPU_ALLOW_FLASH_WRITE=y to project configuration.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-01-19 11:47:43 -06:00
Anas Nashif
ff0d690e79 samples: shell: add standalone version command
Combine modules with standalone commands.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-19 12:01:08 -05:00
Anas Nashif
fa7f13ef00 shell: rename sample to be less generic
This sample implements a custom module, so rename it to allow for other
samples with specific features.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-19 12:01:08 -05:00
Anas Nashif
dd013691b2 shell: add a shell banner
Give details about running version and add a line about usage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-19 12:01:08 -05:00
Carles Cufi
72046a8abc doc: getting_started: Support multi-OS instructions
In order to be able to document the build on Windows and UNIX
systems, slight variations are required on the app commands
that are used throughout the documentation system.

This includes getting rid of the prompt symbol and providing commands
for both UNIX and Windows operating systems.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-18 16:53:31 -05:00
Andrei Emeltchenko
314d182f79 samples: zperf: Add USB RNDIS configuration check
Add configuration for zperf sample allowing to build USB dongle with
zperf for testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Andrei Emeltchenko
7e80f41162 usb: Rename SYS_LOG_USB to SYS_LOG_USB_DEVICE
At the moment CONFIG_SYS_LOG_USB_LEVEL name does not specify that this
is log level for the Device Stack. Make it clear renaming to the
proper name.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Andrei Emeltchenko
6e17e71fb5 samples: Correct default SYS_LOG_USB and SYS_LOG_USB_DRIVER levels
Making configuration files useful.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Yannis Damigos
3d1115adea tests: Clear SPI_*_IRQ_PRI from tests and samples
Remove SPI_*_IRQ_PRI from tests and samples.
Using DT to get the *_IRQ_PRI, we can't
override it using Kconfig.

If needed, use a BOARD_NAME.overlay file to
override default values.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-17 11:51:48 -06:00
Erwan Gouriou
0a3d9933c2 sample: fix configuration for sensor HTS221 sample application
Since no GPIO trigger is configured in hts221 sample application,
update prj.conf to enable TIGGER_NONE flag


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-01-13 09:06:58 -08:00
Anas Nashif
c3880c0db4 samples: crypto: increase min_ram for sample
This samples does not fit on platforms with 8k RAM, increase minimal
requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-13 10:48:36 -05:00
Yannis Damigos
4b7f3e75dd samples: bmi160: Add testcase filter for SPI_LEGACY_API
Don't run testcase if CONFIG_SPI_LEGACY_API is false.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-11 14:35:45 -06:00
Yannis Damigos
d907ed309e samples: bme280: Add testcase filter for SPI_LEGACY_API
Don't run testcase if CONFIG_SPI_LEGACY_API is false.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-11 14:35:45 -06:00
Anas Nashif
a2002e6069 samples: nfc: update README
Update README for usage with CMake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-11 12:50:14 -05:00
Tomasz Bursztyka
5195ddf472 drivers/ieee802154: Cleanup Kconfig
A very old reference to former net stack was still lurking around.
Removing it.

Taking the opportunity to clear up dependencies.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-01-10 21:53:01 -05:00
Sebastian Bøe
4d9499cbeb cmake: external_lib: Specify that the library should be GLOBAL
Having a library being GLOBAL, although not default behaviour, or
necessary for the sample, is expected behaviour for a library. It is
expected that like normal libraries, the target name will be
accessible from outside of the CMakeLists.txt file that created it.

Since samples are used as reference code, we specify GLOBAL so that
libraries are created with this intuitive behaviour.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-09 11:44:40 -05:00
Anas Nashif
9512f0ddf3 samples: rpl: do not build when assert is enabled
Was failing due to increased size of binary.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-09 11:13:08 -05:00
Anas Nashif
4d2ad0a8a5 Bluetooth: remove unused BT_DEBUG_COLOR
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-09 10:59:41 -05:00
Anas Nashif
2735c15120 samples: fix amg88xx sample.yaml syntax
Was still using old synatx.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 14:45:38 -05:00
Sebastian Bøe
830b8bdc17 samples: threads: Rewrite misleading sample
The basic/threads sample is printing a log that looks like this:

Toggle USR0 LED: Counter = 0
Toggle USR1 LED: Counter = 0
Toggle USR0 LED: Counter = 1
Toggle USR0 LED: Counter = 2
Toggle USR0 LED: Counter = 3
Toggle USR0 LED: Counter = 4

From that log you would think that it was logging when leds were
blinking, but actually the led-threads might have crashed, and it
would just continue logging anyway. All it's doing is executing
printk's at roughly the same frequency as the LED's are blinking.

This patch rewrites the sample to use a FIFO so that the printk's only
trigger if the LEDs are actually blinking.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-08 14:25:11 -05:00
Anas Nashif
33592e8aa8 cmake: remove IS_TEST handling
Depending on a path inside the Zephyr tree to determine if we are a test
does not scale. Also some samples were marked as TEST while they are
not, just to get some options defined for tests.

Idenitfying a test will be addressed in another patch introducing
CONFIG_TEST.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 10:03:57 -05:00
Anas Nashif
94066e0f15 tests/samples: remove unknown option LOG_CBUFFER/LOGGER_BACKEND
Those options are not part of Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 08:08:45 -05:00
Anas Nashif
c78296dab4 tests: remove obsolete CONFIG_MDEF
CONFIG_MDEF is no more..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 08:08:45 -05:00
Johann Fischer
7817622b4b samples: sensor: add amg88xx sample
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-01-07 16:04:45 -05:00
Punit Vara
71948788eb tests: logger-hook: convert sample to ztest and move to test/
issue: #3302

Signed-off-by: Punit Vara <punit.vara@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-05 18:17:59 -05:00
Sebastian Bøe
47542598b6 cmake: Ninja: Fix the external_lib sample
This samples was failing to build with Ninja because Ninja detected
that libmylib.a was missing. Adding it as a BYPRODUCT in the
ExternalProject fixes the issue.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-03 13:19:59 -05:00
Sebastian Bøe
6f642a19fd cmake: Ported mbedTLS to use Zephyr interface libraries
mbedTLS include directories will now default to be in the 'app'
include path when mbedTLS has been enabled.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-02 22:09:01 -05:00
Ravi kumar Veeramally
a0371ae92f net: tcp: Add initial support for TIMEWAIT timer
Right now in FIN_WAIT1 state, if we receive FIN+ACK message, then
tcp state changed to FIN_WAIT2 on ACK flag and immediately on FIN
flag state changed to TIME_WAIT. Then final ACK is prepared and sent
(in queue at-least) to peer. Again immediately state changed to
TCP_CLOSED, where context is freed. net_context_put frees context
and releases tcp connection. Final ACK packet which is in queue
is dropped.

As a side effect of freed ACK packet, peer device keep on sending
FIN+ACK messages (that's why we see a lot of "TCP spurious
retransimission" messages in wireshark). As a result
of context free (respective connection handler also removed), we see
lot of packets dropped at connection input handler and replying with
ICMP error messages (destination unreachable).

To fix this issue, timewait timer support is required. When tcp
connection state changed to TIMEWAIT state, it should wait until
TIMEWAIT_TIMETOUT before changing state to TCP_CLOSED. It's
appropriate to close the tcp connection after timewait timer expiry.

Note: Right now timeout value is constant (250ms). But it should
be 2 * MSL (Maximum segment lifetime).

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-12-31 11:58:27 -05:00
Anas Nashif
eba1bbd705 samples: remove more build_only tags
Remove build_only and add harness type needed for the sample/test to
allow running with sanitycheck and on devices once we have harness
support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
bca9c456d2 samples: remove build_only from various samples
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
c6d2ba996f samples: drivers: remove build_only flag
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
26ccc0bbcb samples: crypto: remove build_only and sample cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
0d841cf0f2 samples: entropy: filter based on HW capabilities
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
b5b8095749 samples: bluetooth and net samples need test setup
remove build_only and make them depend on test harness (bluetooth)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
4599bbff67 samples: watchdog: fix dependencies and sample cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
d473d53da8 samples: rtc: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
6e7de15680 samples: TMP112: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
9f0e1b82f0 samples: TH02: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
c98513e6a5 samples: sx9500: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
31a23dca68 samples: mcp9808: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
a6119ee105 samples: max30101: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
482feb45e4 samples: bmi160: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
159e0a2167 samples: magn_polling: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
0448642b33 samples: hts221: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
42ac8abdc3 samples: fxos8700: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
1ac3cc9347 samples: fxas21002: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
21787c8d1a samples: bmi150: fix dependencies and test cleanup
Remove ARC unrelated configs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
200b2459cf samples: bmg160: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
da9a59e233 samples: bme280: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
e7c009eec9 samples: apds9960: fix dependencies
depend on i2c and gpio drivers being available.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
468e3f7a11 samples: apds9960: remove arc related configs
Also remove unused STDOUT_CONSOLE

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
c9d6b289c7 samples: pwm: depend on boards supporting PWM
Still need a better way to filter and a better way to support multiple
platforms with these tests, but for now we remove the build_only tag and
make it depend on real HW.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif
7440a7ff23 tests: move aio sample to tests
This is clearly a test and not a sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Alberto Escolar Piedras
04c7620580 native: blacklisted 3 testcases
The following 3 testcases are blacklisted for the POSIX
arch / simple_process BOARD:
* tests/drivers/ipm : won't compile due to missing
   __stdout_hook_install()  [part of minimal libc]
  (POSIX arch uses the native libc)
* tests/kernel/mem_protect/stackprot : will crash
  "natively" when trying to corrupt the stack and therefore
  will fail the testcase. The current understanding is that
  the POSIX arch should let the native OS handle faults,
  so they can be debugged with the native tools.
* samples/cpp_synchronization : it is not possible
  to build cpp code yet on top of the posix arch

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2017-12-27 14:16:08 -05:00
Ramakrishna Pallala
b82dfb479b samples: boards: add sample for Altera Nios-II PIO core
Add a sample application for Nios-II PIO core on Altera MAX10 board.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-12-21 12:02:24 -08:00
Sebastian Bøe
cf6cb590df cmake: Don't link with subsys__bluetooth unnecessarily
It is only necessary to link with subsys__bluetooth if the path
"subsys/bluetooth" is needed as an include directory. None of the
samples have this need.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-19 12:46:03 -05:00
Anas Nashif
e2122cbf89 lib: move ring_buffer from misc/ to lib/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-15 20:02:01 -05:00
Michael Scott
2fc554b8fc crypto: config: config-coap: add CONFIG for setting max content length
The CoAP samples use an MBEDTLS config "config-coap.h" which could be
re-used by the LwM2M sample, except that most servers use a larger
maximum content length setting of 1500 bytes.

Let's add a CONFIG to set this for users of the CoAP lib and set the
CONFIG value for the samples to the 256 size currently used.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 17:52:13 -05:00
Michael Scott
5f4c7fcf5c samples: lwm2m: update documentation for DTLS support
- Mention the prj_dtls.conf setting
- Explain setting up security in the Leshan Demo Server web UI.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 16:46:48 -05:00
Michael Scott
100f8273dd samples: lwm2m: add support for DTLS
To test, use -DCONF_FILE=prj_dtls.conf

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 16:46:48 -05:00
Kumar Gala
dfce457ebe samples: mesh/onoff-app: fix whitelist typo
Board name is nrf52840_pca10056 (with an underscore) instead of
nrf52840-pca10056 (with a dash).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-12-14 14:02:09 -05:00
Anas Nashif
2c96dacf0a samples: mesh/onoff-app: fix sample.yaml syntax
Also, remove build_only, we can run on the whitelisted platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-14 13:04:51 -05:00
Steve Brown
bce1b974f0 samples: onoff-app: Add OnOff Model for the Nordic nRF52840-PDK board
Signed-off-by: Steve Brown <sbrown@cortland.com>

---

The updates to BlueZ' meshctl have not been submitted.

I am submitting this PR only for review. It could be committed
after the patches for the meshctl commands are applied.
2017-12-14 08:27:05 +02:00
qianfan Zhao
b4f45b8a1d samples: webusb: fix array length in Product and SN string descriptors
Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2017-12-12 09:28:42 -05:00
Anas Nashif
23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Sebastian Bøe
1588125672 samples: Don't read board from cmake -DBOARD=x
The CMakeLists.txt file was reading ${BOARD}, but this means the user
must set BOARD like this cmake -DBOARD=foo. The user must be allowed
to set BOARD from the environment.

The code was unnecessary anyway because the convention
prj_${BOARD}.conf is known by boilerplate and therefore not necessary
to specify.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-11 09:06:48 -05:00
Sebastian Bøe
b7fa4f1e29 samples: echo_server: Test the nrf build in CI
This introduces an nrf build to CI for the echo_server sample. Doing
so ensures that https://github.com/zephyrproject-rtos/zephyr/pull/5018
cannot regress again.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-06 11:11:59 -06:00
Anas Nashif
abbaac9189 cleanup: remove nanokernel/nano leftovers
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-05 09:44:23 -06:00
Sebastian Bøe
89516fbc25 cmake: Change the zephyr_get_* API to be LANG-aware
When exporting flags to an external build system we need to deal with
the fact that we sometimes use generator expressions. Specifically, we
use generator expressions that look like this:

$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>

This patch replaces the old API with a new one where users can ask for
compile options for specific languages, like this:

zephyr_get_compile_options_for_lang_as_string(CXX x)

The existing API would have either crashed or silently omitted flags
when a COMPILE_LANG generator expression was present.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-05 10:08:40 -05:00
Kumar Gala
6b38f57225 Add missing license and copyright headers
The following files didn't have any copyright or license headers on them
when they got contributed.  So add the SPDX Apache license and
appropriate copyright info:

boards/arm/stm32l476g_disco/pinmux.c
samples/basic/threads/src/main.c
tests/net/socket/tcp/src/main.c

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-12-05 08:21:05 -06:00
Anas Nashif
467b3401e3 samples: logger-hook: remove unused configs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-27 22:15:30 -05:00
Johan Hedberg
48aecd1513 Bluetooth: Mesh: Add IV Update test mode API
This makes it possible to pass all IV Update tests without having to
build a custom configuration for some of the tests. We also disable
the feature in all sample configurations, but leave it on in the
tests.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-27 10:17:54 +02:00
Jukka Rissanen
6faf997b97 samples: net: echo-server: Fix compilation with mbedtls
The echo-server compilation failed because mbedtls config file
was not found. Added suitable magic to CMakeLists.txt fixing that.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 18:45:35 -05:00
Jukka Rissanen
37247bda78 samples: net: zperf: Ignore error when creating TCP sample pkt
When sending TCP sample packet, just fill the packet to max and
ignore any overflow error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 10:10:31 -05:00
Tomasz Bursztyka
b52c0f24a6 net/ieee802154: Make RAW mode generic
- Renaming NET_L2_RAW_CHANNEL to NET_RAW_MODE
- Create a generic IEEE 802.15.4 raw mode for drivers
- Modify the IEEE 802.15.4 drivers so it passes the packet unmodified,
up to code using that mode to apply the necessary changes on the
received net_pkt according to their needs
- Modify wpanusb/wpan_serial relevantly

Fixes #5004

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-11-22 10:10:09 -05:00
Jukka Rissanen
93c426e778 samples: net: zperf: Check UDP pkt before accessing it
Check that we do not try to access fragment when UDP packet is
received if pkt is NULL. In practice this should not happen for
UDP but do the checks in proper order anyway.

Coverity-CID: 179252
Fixes #5057

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Jukka Rissanen
f7f671d18b samples: net: zperf: Check pkt before accessing it
The pkt was accessed before NULL check.

Coverity-CID: 179250
Fixes #5059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Jukka Rissanen
b0b053e91e samples: net: zperf: Remove deadcode
As we are checking that pkt is not NULL already in the start
of the function, remove the checks later in the code in function
zperf_tcp_receiver.c:tcp_received()

Coverity-CID: 179248
Fixes #5061

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Johan Hedberg
4fe3e03152 Bluetooth: samples/mesh_demo: Fix address handling
Clean up and fix the address handling.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 13:30:30 +02:00
Johan Hedberg
e31102c890 Bluetooth: samples/mesh_demo: Remove unused model publication
This app isn't (at least yet) using the model publication for
anything, and in fact this could cause trouble due to missing
publication net_buf_simple buffer.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Johan Hedberg
8f1541184f Bluetooth: Mesh: Fix non-periodic Model Publication
The only generally available model supporting publication that's
convenient to be used for testing is the Health Server Model.
Unfortunately since this model supports period publication, the
non-periodic side got less attention and had some bugs.

The first thing that needs to be done is to verify that the period
returned by bt_mesh_model_pub_period_get() is positive. If it's zero
then no periodic publication should take place.

Another thing that this patch cleans up is the naming of the callback
used for periodic publishing. There's no need do require the callback
to call bt_mesh_model_publish() since this must happen no matter what,
so instead rename the callback from 'func' to 'update' and have the
access layer call bt_mesh_model_publish() if the callback was
successful.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Jukka Rissanen
9d99691e7b samples: net: echo_client: Only send allowable number of bytes
Honor the device MTU when sending data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-20 16:39:36 -05:00
Jukka Rissanen
d206ad2799 samples: net: echo-client: Fix compilation with mbedtls
The echo-client compilation failed because mbedtls config file
was not found. Added suitable magic to CMakeLists.txt fixing that.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-20 16:39:09 -05:00
Johan Hedberg
e7bb76e2b6 Bluetooth: Mesh: Fix model publication
Model publication was broken in a couple of ways:

 - The Publish Retransmit State was not taken into account at all
 - Health Server used a single publish state for all elements

To implement Publish Retransmit properly, one has to use a callback to
track when the message has been sent. The problem with the transport
layer sending APIs was that giving a callback would cause the
transport layer to assume that segmentation (with acks) is desired,
which is not the case for Model Publication (unless the message itself
is too large, of course). Because of this, the message sending context
receives a new send_rel ("Send Reliable") boolean member that an app
can use to force reliable sending.

Another challenge with the Publish Retransmit state is that a buffer
is needed for storing the AppKey-encrypted SDU once it has been sent
out for the first time.To solve this, a new new net_buf_simple member
is added to the model publication context. The separate 'msg' input
parameter of the bt_mesh_model_publish() API is removed, since the
application is now expected to pre-fill pub->msg instead.

To help with the publishing API change, the Health Server model gets a
new helper macro for initializing the publishing context with a
right-sized publishing message.

The API for creating Health Server instances is also redesigned since
it was so far using a single model publishing state, which would
result in erratic behavior in case of multiple elements with the
Health Server Model. Now, the application needs to provide a unique
publishing context for each Health Server instance.

The changes are heavily intertwined, so it's not easily possible to
split them into multiple patches, hence the large(ish) patch.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-20 15:00:29 +02:00
Youvedeep Singh
691d709943 samples: nrf52: power_mgr: Increase idleness for main thread
Increase sleep time for main thread (1 sec to 1 minute) to keep SOC
in Low Power State for longer time. Currently nrf SOC is entering into
low power state and exiting immedately after 1 sec.
With this change SOC will wake stay in Low Power State till GPIO is
pressed or sleep time expired (whichever is earlier).

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-18 11:21:13 -05:00
Andrei Emeltchenko
59161cebcd net: doc: Add Ethernet over USB basic documentation
Add basic documentation about Ethernet over USB and describe
prj_netusb.conf configuration file.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-18 08:49:57 -05:00
Jukka Rissanen
624a75c76e samples: net: http-server: Do not set Content-Length
As per https://tools.ietf.org/html/rfc7230#section-3.3.2:
"A sender MUST NOT send a Content-Length header field in any
message that contains a Transfer-Encoding header field."

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-17 17:38:39 -05:00
Johan Hedberg
bd69b2127e Bluetooth: Mesh: Use dedicated struct for heartbeat subscription
This simplifies the API since there is no-longer a need to pass a huge
number of function arguments around.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-16 15:35:10 +02:00
Johan Hedberg
d4365e16f9 Bluetooth: Mesh: Use dedicated struct for heartbeat publication
This simplifies the API since there is no-longer a need to pass a huge
number of function arguments around.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-16 15:35:10 +02:00
Sebastian Bøe
49e7ca957e cmake: set IS_TEST in the samples that were including Makefile.test
For an unknown reason, various samples in KBuild were including
Makefile.test, this had some desired benefits, one of which is that
the popular BOOT_BANNER appears. The CMake-equivalent of including
Makefile.test is setting the flag IS_TEST. This commit reverts the
behaviour of the samples back to how it was pre-cmake.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-16 08:26:25 -05:00
Sebastian Bøe
c7c7917da2 cmake: set IS_TEST in the hello_world sample
The Kbuild equivalent of IS_TEST was used for hello_world before, so
we revert back to the old behaviour. This resolves
https://github.com/zephyrproject-rtos/zephyr/issues/4904

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-16 08:26:25 -05:00
Anas Nashif
d55884a34d sample: crypto: also test mbedTLS config
expand testing to mbedTLS

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-16 05:48:16 -05:00
Luiz Augusto von Dentz
27628a23fc net: http_client: Fix having IPv4 options in prj_bt.conf
IPSP/6LoWPAN is IPv6 only, it cannot transport IPv4 packets.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-11-16 10:41:07 +02:00
Luiz Augusto von Dentz
697e5698b3 net: samples: Remove CONFIG_NET_L2_BT_ZEP1656
CONFIG_NET_L2_BT_ZEP1656 should only be used with older Linux up to
4.11 which by now should have been updated in all distros.

For those sticking with older distros should select it manually as
it does breaks IID address it should never be used in production.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-11-16 10:41:07 +02:00
David B. Kinder
be9ee06bd9 doc: fix misspellings in boards and samples docs
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-11-15 12:59:22 -05:00
Kumar Gala
7cd27be39a drivers/ieee802154_kw41z: Update kw41z to support event trace buffer
Added conditionally enabled event state tracing support.
Needed for enhanced debug visibility of tight timed events where
normal print debug messages affect the timing of things. This is a
simple buffer that allows post analysis via gdb of what sequencer
events occurred.

Signed-off-by: David Leach <david.leach@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-15 08:30:16 -06:00
David Leach
fcffac92b7 drivers/ieee802154_kw41z: Reduce debug logging due to false positives
- Removed some debug output and changed the level of others to reduce
  the amount of information logged. The reason is that some of this is
  causing false positive distractions.
- Removed enabling of FILTER error IRQ events. It isn't needed and is
  only informational.
- Changed frame control AR bit inspection to use native retrieval
  routine.
- Addressed some coding style issues.

Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-15 08:30:16 -06:00
David Leach
e8431daac0 drivers/ieee802154_kw41z: Stabilize the KW41Z IEEE802.15.4 driver
- Reworked the driver logic around TX/RX to correctly handle the
  expectations of the underlying 802.15.4 hardware IP.
- Fixed a problem with TX always reporting an error to the stack
  which resulted in constant retries.
- Fixed bug in RX to TX transition which would occasionally cause the
  driver to error the TX.
- Changed RX logic to ensure that invalid RX frames were not passed up
  the stack.
- Simplified hardware timer usage to only use TMR3.
- Added RX watermark and TMR3 support to fix a hardware problem where
  the hw IP can get stuck on a receive in noisy environments.
- Modified samples/net/echo_client and echo_server kw41z project config
  files to provide enanced debug visibility into stacks and threads.

Signed-off-by: David Leach <david.leach@nxp.com>
2017-11-15 08:30:16 -06:00
Sebastian Bøe
40ddb7f747 samples: external_lib: Build binaries in the build directory
This fixes https://github.com/zephyrproject-rtos/zephyr/issues/4925

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-15 08:49:06 -05:00
Johan Hedberg
e6aa6a0784 Bluetooth: samples/mesh_demo: Add heartbeat publication support
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg
255edcfde2 Bluetooth: Mesh: Provisioning: Add NetKeyIndex to complete callback
It may be useful for the app to know what the initial NetKeyIndex that
it was given during provisioning is.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg
70cbcef576 Bluetooth: Mesh: Rename health server code from health to health_srv
This is in anticipation of soon adding health client support, which
could then cause confusion due to the ambiguous API names.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg
3b252ca2be Bluetooth: Mesh: Rename configuration server code from cfg to cfg_srv
Now that there's support for configuration client as well, rename cfg
to cfg_srv to avoid any confusion.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg
86624941e4 Bluetooth: samples/mesh_demo: Add dummy provisioning
Some of the provisoning routines, such as node reset assume that we
have a valid bt_mesh_prov pointer.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg
0ef7c6e09a Bluetooth: Mesh: Add more flexible APIs for provisioning bearers
Add the ability to track the provisioning bearer through an extra
parameter to link_open/close. Also introduce new public functions to
enable/disable specific provisioning bearers. This also means that one
now needs to explicitly enable provisioning bearers after calling
bt_mesh_init().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Johan Hedberg
a81fa43a59 Bluetooth: Mesh: Use proper _t suffix for typedefs
To be consistent with the coding style, use a _t suffix for typedefs.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-15 13:48:29 +02:00
Jukka Rissanen
ba6c72fff1 samples: net: http: Possible null memory access in client & server
We might access null pointer in debug print.

Coverity-CID: 178789
Fixes #4785

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-14 23:03:16 +02:00
Jukka Rissanen
a38345ad98 samples: net: http: Do not overrun url array
It is possible to access past end of url buffer by one byte.

Coverity-CID: 178790
Fixes #4784

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-14 23:03:16 +02:00
Johan Hedberg
6f4d627983 Bluetooth: samples/mesh_demo: Convert to using Configuration Client API
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +02:00
Johan Hedberg
588887c9b7 Bluetooth: Mesh: Add primary address to provisioning complete callback
It may be useful for the app to know that the local node's primary
address is.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-14 16:48:49 +02:00
Zhang WenChao
b6171378fc sample: blink_led: Add support for stm32f4_disco
Signed-off-by: Zhang WenChao <zhangwenchao001@gmail.com>
2017-11-14 07:04:00 -05:00
Robert Chou
1d70a39d1b net: samples: replace tag zoap with coap
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-11-14 06:42:57 -05:00
Michael Scott
92cf80e9b2 net: http: dont add CRLF to protocol
In http_request() a CRLF is added to the header information after
the protocol is added.  2 CRLF in a row means the header information
is done, so following header information will be ignored.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-11-14 09:52:59 +02:00
Paul Sokolovsky
ed3ede06e1 samples: net: sockets: Reinstate POSIX Makefiles.
All current socket samples as one of the points show portability to
POSIX platforms, and provide POSIX makefiles to let user build such
a version of application easily. These Makefiles were lost during
CMake conversion.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-11-13 16:41:14 -05:00
Sebastian Bøe
965f78088f samples: dump_http_server: Change where the .inc file is written
KBuild would write the .inc file to the source directory, this was
changed during the CMake migration because whenever possible it should
be avoided to write files outside of the build directory.

But Makefile.posix assumes that these files are generated in the
source directory so we need to keep generating them there for now.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-13 10:08:41 -05:00
Johan Hedberg
b4700c3f2b Bluetooth: Mesh: Clarify API for empty model arrays
Avoid applications defining empty model arrays by themselves by
documenting the BT_MESH_MODEL_NONE helper macro (renamed to be more
intuitive) and using it in the mesh sample app.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-13 14:38:04 +02:00
Johan Hedberg
a554ae2bc1 Bluetooth: Mesh: Remove reference to non-existing Kconfig option
There's no such Kconfig option as CONFIG_BT_MESH_TX_SEG_COUNT.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-13 14:38:04 +02:00
Carles Cufi
697e30459d samples: grove: Convert doc to CMake.
Convert doc of samples/grove to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi
d1235f9bd8 samples: subsys: Convert doc to CMake
Convert doc of samples/subsys to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi
8146d8efbb samples: sensor: Convert doc to CMake
Convert doc of samples/sensor to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi
19d1e9afd1 samples: drivers: Convert doc to CMake
Convert doc of samples/drivers to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi
bd9d38b5bd samples: boards: Convert doc to CMake
Convert doc of samples/boards to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi
08183f7e73 samples: basic: Convert doc to CMake
Convert doc for samples/basic to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi
ece86b23ac samples: misc: Convert doc to CMake
Convert misc samples doc to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Carles Cufi
915bf989cf samples: mmu: Convert doc to CMake
Convert the samples/mmu documentation to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Michael Scott
9a380bf08f samples: net: lwm2m_client: update README
Update the sample README with the latest changes during the
1.10 development cycle.  We removed the 2 concurrent IPv4
and IPv6 connections and now the sample will make a single
connection based on whatever is configured (currently IPv6
takes precedence over IPv4).

Added instructions for how to switch the sample to IPv4.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-11-11 10:06:43 -05:00
Jukka Rissanen
dea2868a82 samples: net: Update compilation instructions for cmake
Update network sample documentation for cmake.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-10 11:36:33 -05:00
Jukka Rissanen
3c0a0053fa samples: net: Remove QEMU_NET_STACK setting from CMakeLists.txt
The QEMU_NET_STACK is enabled automatically if building
a networking application to QEMU so no need to do it for
each networking sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-10 14:52:53 +02:00
Johan Hedberg
c7001a4620 Bluetooth: samples: Remove references to Kbuild-style building
Update the documentation for the Bluetooth samples not to refer to the
old style of building using make. Instead, simply refer to the general
instructions.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-09 10:57:49 -05:00
Andrei Emeltchenko
994ec924e3 usb: samples: Support build for 96b_carbon board
Rename netusb project file to be more general and support sanity build
for 96b_carbon board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-09 09:31:58 -05:00
Jukka Rissanen
d63efc3aa1 samples: net: rpl: RPL node application was missing sample.yaml
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-09 10:59:30 +02:00
Jukka Rissanen
025e07e413 samples: net: rpl: Fix compile error in rpl-node application
Some required files were removed from samples/net/common which
caused compile error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-09 10:59:30 +02:00
Sebastian Bøe
6d35480e36 cmake: Fixed samples/net/rpl-node
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
8dd5107d6a cmake: Ported samples/net/rpl-node
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
c7832bd343 cmake: Use -serial bt-server when CONFIG_BT
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
09f646a628 cmake: Fixed NODE_ADDR
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
5630ccfc23 cmake: Introduce a default VID and PID
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Anas Nashif
cd313cb82d sampels: remove obsoleted static_lib sample
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-08 20:00:22 -05:00
Sebastian Bøe
12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Andrew Boie
f90242a448 mem_domain_apis_test: fix sample.yaml
This should be runnable on any board that supports user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-11-08 09:15:14 -08:00
Andrei Emeltchenko
fb4dfa9d6f net: samples: Add netusb configuration to zperf
Add configuration for USB CDC ECM Ethernet Networking.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-08 10:55:50 -05:00
Andrei Emeltchenko
6048c0cd2f net: Fix zperf TCP build
Fix zperf for TCP tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-08 10:55:50 -05:00
Johann Fischer
cebc1c501b samples: webusb: rework usb descriptor
Remove Intel's VID and PID, rework usb descriptor
and remove cdc_acm.h header dependencies.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-11-07 15:31:02 -05:00
Adithya Baglody
792fc9ed01 samples: MPU: updated the memory domain test for x86.
GH-3852

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-11-07 12:22:43 -08:00
Johan Hedberg
b451f132c5 samples: bluetooth/mesh: Add Friend support
Make it possible to use the mesh sample app as a Friend node.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-07 18:59:06 +03:00
Sahaj Sarup
b6c70fd331 samples: Basic Thread Demo
A basic demo to showcase multi-threading using K_THREAD_DEFINE

Signed-off-by: Sahaj Sarup <sahaj.sarup@linaro.org>
2017-11-07 08:28:32 -05:00
Jukka Rissanen
6ddc85d522 samples: net: HTTP client sample using net-app
This is a sample HTTP client application that uses new http API
instead of legacy one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Jukka Rissanen
5c9de9035d samples: net: HTTP server sample using net-app
This is a sample HTTP server application that uses new http API
instead of legacy one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Jukka Rissanen
770de2c69a samples: net: http: Remove deprecated HTTP client/server samples
As the old HTTP API is deprecated, the old samples can be removed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Jukka Rissanen
2486694eb9 net: http: Create HTTP library that uses net-app
Create http library that uses net-app instead of net_context
directly. The old HTTP API is deprecated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-06 09:33:00 -05:00
Youvedeep Singh
3a179e29b0 samples: boards: nrf52: test demo for nrf52 power management
This sample tesecase provides sample code :-
1. Triggers Low Power tasks into nrf52 SOC (CONST LAT and LOW PWR)
2. Triggers System Off state.
3. Wake up device through port Event by GPIO (Button 1).

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
2017-11-06 09:29:10 -05:00
Jukka Rissanen
795bffbee2 samples: net: echo-client: Fix compile warning
This is similar fix as in commit 643cc4a22c but this one fixes
the thread parameter in UDP DTLS thread.

Fixes this function parameter datatype warning:

expected ‘k_thread_stack_t * {aka struct _k_thread_stack_element *}’
 but argument is of type ‘u8_t * {aka unsigned char *}’

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-03 10:49:33 -04:00
Savinay Dharmappa
4cec15270d sample: subsys: logging: kernel_event_logger: Add sample application
patch adds a sample application to demonstrate use of kernel event
logger feature.

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2017-11-02 22:22:54 -04:00
Anas Nashif
373b6bed8b samples: remove ieee802154 sample, we have echo server/client
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-02 15:53:04 -04:00
Jukka Rissanen
862ddb17ab samples: net: coaps_server: Fix coap packet parsing
The length and the start of the coap payload was not correct
because the received packet did not had IP and UDP header in place.

Fixes #4630

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-02 14:43:10 +02:00
Leandro Pereira
da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Leandro Pereira
adce1d1888 subsys: Add random subsystem
Some "random" drivers are not drivers at all: they just implement the
function `sys_rand32_get()`.  Move those to a random subsystem in
preparation for a reorganization.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Anas Nashif
0fb51fa849 headers: fix global includes for various source files
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Anas Nashif
9b7abb9d8c samples: bluetooth: add nrf52_pca10040 to beacon sample
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-31 12:32:34 -04:00
Michael Scott
98d8c6a665 net: lwm2m: fix all return values from resource callbacks
Previously, post_write and execute callbacks returned 1 when handled
and 0 for error condition.  However, this wasn't detailed enough and
the engine can't propagate any sort of error back to users -- so it
doesn't even check the return values in many cases!

Let's adjust the resource callback functions of all objects and the
lwm2m_client sample to return 0 for success or a valid error code.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Michael Scott
ccbd696706 net: lwm2m: remove predefined firmware buffer from firmware_pull
Now that we can access resource data in the lwm2m subsys, let's use
the user provided firmware push buffer (5/0/0) to also store the
firmware pull data.

This way the size of the firmware pull buffer is completely up to the
application.

NOTE: This patch adds a 64 byte firmware buffer to the lwm2m_client
sample for this purpose.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Michael Scott
1bab82f8f0 samples: lwm2m: remove large buffer size requirement
Now that the LwM2M library can parse across multiple fragements,
let's remove the larger than normal buffer size setting.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-31 09:41:27 +02:00
Anas Nashif
780324b8ed cleanup: rename fiber/task -> thread
We still have many places talking about tasks and threads, replace those
with thread terminology.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-30 18:41:15 -04:00
Andrei Emeltchenko
2d822f1504 samples: http_server: Add netusb configuration
Add configuration to http_server sample making it possible to work
with USB Device stack with Ethernet ECM protocol.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-30 11:50:42 -04:00
Andrei Emeltchenko
c4a3d6817c samples: echo_server: GPIO should be selected in the board configs
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-30 08:30:48 -04:00
Paul Sokolovsky
44e25bc53c Bluetooth: ipsp: Add detailed instructions
Given that 6lowpan/BLE support is still work in progress, uses
debugging interfaces to setup, has known issues, and otherwise
not widely known or adopted, provided detailed instructions,
including reasonable diagnosing steps on how to set up and test
such a connection.

Tested using 96b_carbon.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-30 08:10:35 -04:00
Andrei Emeltchenko
66df6f1130 net: sample: Add USB Ethernet stick configuration
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-28 14:38:19 -04:00
Andrei Emeltchenko
61202e898e usb: Add sanity_check configuration for netusb
Add netusb and composite netusb build check configurations.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-28 14:38:19 -04:00
Andy Ross
4a8a24fe39 Revert "cdc_acm : Restrict writing more than 4 bytes into TX USB Endpoint."
This reverts commit 1da0a9eebd.

The workaround caused a severe performance penalty, and only worked
for USB packets of 4-15 bytes in length (16+ byte packets weren't
subject to the hardware bug).  Single-byte packets (very common for
cdc_acm serial port transfers) would still be duplicated sometimes.

The upcoming DMA implementation does not share the performance
penalty, and also is not subject to the bug for those sizes of packets
(though it DOES still have a problem with single-byte packets!).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-10-28 14:38:19 -04:00
Tomasz Bursztyka
1b77ee12ea samples/net: Reducing prj*.conf files by relevantly removing 6Lo option
If NET_L2_IEEE802154 and NET_IPV6 are enabled:
- NET_6LO is enabled
- NET_L2_IEEE802154_FRAGMENT is enabled

Thus removing setting this config options to yes where applicable.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-28 14:28:02 -04:00
Marti Bolivar
306c717b9e samples: drivers: add WS2812 sample application
This is similar to the LPD8806 sample, but uses the WS2812 driver
instead. The app configuration is a bit more finicky, so try to
provide helpful references. This could be made more beginner-friendly
with the addition of timing diagrams, etc., but this should be enough
for an experienced developer to use.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Marti Bolivar
3e674eac98 samples: drivers: add LPD8806 sample application
This sample displays the colors red, green, and blue on consecutive
LEDs in an LED strip, moving the starting point where red begins
further down the strip at each time step. The color band wraps around
to the beginning when it reaches the end.

Since this is the first application in samples/drivers to have
documentation, add samples/drivers/drivers.rst as well, and include it
in the top-level toctree from samples/samples.rst.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Paul Sokolovsky
50d7ca11bc samples: echo_server: Clean up frdm_k64f config
Remove CONFIG_NET_L2_ETHERNET, as it's automatically set by the
board. This effectively makes prj_frdm_k64f.conf fairly portable,
e.g. the same config can be used for frdm_kw41z whcih uses 802.15.4
connectivity instead.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-28 09:24:58 -04:00
Michael Scott
907e7671e9 samples: lwm2m: reduce footprint of lwm2m conf
LwM2M is intended for constrained devices.  The default samples
settings are quite large by that standard and can be reduced to
reflect actual usage.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-26 09:25:56 +03:00
Michael Scott
f34d0ebb8a samples: lwm2m: combine prj_*.conf files
After the LwM2M sample was introduced several HW related defaults were
added to Kconfig.  We no longer need separate prj*.conf files for K64F
and qemu_x86.  Let's combine them into a single prj.conf file and
adjust documentation.

NOTE: This also adjusts README.rst

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-26 09:25:56 +03:00
Kumar Gala
c1881b22fe samples: net: wpanusb: Fix build error due to missing USB device vid/pid
We removed the default values for:
* CONFIG_USB_DEVICE_VID
* CONFIG_USB_DEVICE_PID

So put some dummy values in the sample.yaml to get things building
again.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-10-25 11:52:50 +02:00
Jukka Rissanen
643cc4a22c samples: net: echo-client: Fix compile warning
Fixes this function parameter datatype warning:

expected ‘k_thread_stack_t * {aka struct _k_thread_stack_element *}’
 but argument is of type ‘u8_t * {aka unsigned char *}’

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-24 11:41:40 -07:00
Jukka Rissanen
62fb302396 samples: net: echo-client: Fix DTLS compilation
If DTLS was enabled, then certifacate setup function was missing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-24 11:41:40 -07:00
Johan Hedberg
5640b631b4 samples: mesh_demo: Enable relay by default for the micro:bit
The relay functionality was supposed to be always enabled rather than
always disabled on the micro:bit.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-23 12:39:52 +02:00
Adam Podogrocki
61467e019e iwdg: the sample of the use of STM32 Independent Watchdog
JIRA: ZEP-2347

Change-Id: I808e9f110681735cae45d14c5802636012f018cc
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-10-23 09:51:16 +02:00
Andrew Boie
21a7a0f576 Revert "samples: MPU: updated the memory domain test for x86."
This reverts commit 35a4c679b4.
2017-10-20 15:02:59 -04:00
Adithya Baglody
35a4c679b4 samples: MPU: updated the memory domain test for x86.
GH-3852

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2017-10-20 10:39:51 -07:00
Anas Nashif
321e6c2701 samples: echo client/server: test more configurations
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-20 13:22:25 -04:00
Anas Nashif
1c60c00504 samples: echo_server: remove unrelated CONFIG_ARC_INIT
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-20 13:22:25 -04:00
Jukka Rissanen
6a0c5dede7 samples: net: ieee802154: Update config to sane values
The IEEE 802.15.4 UART pipe config files in
echo_server/prj_qemu_802154.conf and echo_client/prj_qemu_802154.conf
did not had proper configuration options set. This prevents
qemu<->qemu communication between the echo-server and echo-client.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-20 12:55:55 -04:00
Chunlin Han
c7a55004bd samples: fix mem_domain_apis_test doesn't be built during sanitycheck
Use platform_whitelist to specify supported boards to make sure
mem_domain_apis_test sample will be built during sanitycheck.

Signed-off-by: Chunlin Han <chunlin.han@linaro.org>
2017-10-19 09:41:27 -04:00
Andrei Emeltchenko
45c4d07287 usb: Add missing tag to sanity check configuration
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-19 09:30:58 -04:00
Andrei Emeltchenko
44a3cca2e2 usb: Remove default Vendor and Product ID
Vendor ID and Product ID should be assigned on build time by
respective process.

For sanity check we assign some random values which are only used for
build tests and should not be used for real products.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-10-19 09:30:58 -04:00
Johan Hedberg
ee107baad9 samples: mesh_demo: Use second button to change target address
It's been observed that that the relay toggling functionality is not
very useful, and that it's better left enabled always. Change the
purpose of the second button to instead modify the target address that
messages sent through the first button get directed to. By default the
destination is the group address, i.e. all nodes receive the message.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-10-18 16:08:22 -04:00
Paul Sokolovsky
5cbfa397c5 samples: sockets: dumb_http_server: Use big payload by default
This sends out 2KB+ payload (i.e. guaranteedly more than 1 network
packet). When this sample was initially written, using such payload
quickly let to a deadlock somewhere in the network stack. However
as of now, running with such payload can sustain testing with
"ab -n10000" (10000 consecutive HTTP requests using Apache Bench),
so set is as a default, to serve as a mark point against possible
future regressions.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-18 12:38:36 -04:00
David B. Kinder
4600c37ff1 doc: Fix misspellings in header/doxygen comments
Occasional scan for misspellings missed during PR reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 19:40:29 -04:00
Michael Scott
1965e5e9fc net: lwm2m: add RD client callbacks for app
Applications may want to be notified when various events
happen in the LwM2M rd client.  Let's implement an event
callback which sends: connect, disconnect and update events.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
Robert Chou
b93eb8dee1 net: lwm2m: add firmware push support
1. Add handling block1 option in handle_request(). The basic idea is
   to declare structure block_context at compiled time and use "token"
   as a key to pick up the on-going block cotext. It should be able to
   support multiple blockwise transfer concurrently
2. Use write callback implemented in lwm2m_obj_firmware to deal w/ the
   update state transition and than call the callback registered by the
   application
3. move default_block_size to lwm2m_engine.c to share between
   lwm2m_engine and lwm2m_obj_firmware_pull

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
[michael.scott@linaro.org: rebased on LwM2M net_app changes.]
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
Robert Chou
d9f5fe7455 net: lwm2m: add state machine for firmware pull update
1. Parse firmware pull URI
2. Add lwm2m_firmware_get/set_update_cb() for application to register
   callback. This is because we want to check the update_state before
   we pass to the application
3. Add lwm2m_firmware_get/set_update_result() and
   lwm2m_firmware_get/set_update_stat() to manage the state transition
   as well as the sanity check

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
[michael.scott@linaro.org: rebased on net_app framework and
lwm2m_message refactoring.]
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-17 19:40:04 -04:00
David B. Kinder
ee71332b99 doc: fix doc misspellings
Found some spelling issues missed during regular PR review

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 14:31:52 -04:00
Jukka Rissanen
6f41e3a191 samples: net: http_client: Disable OPTIONS method
As many HTTP servers do not support OPTIONS method, disable it
by default.

Fixes #4325

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-17 13:52:26 -04:00
Jukka Rissanen
e5958d3a8d sample: net: mdns: Add mDNS responder application
This application does not do anything itself, it just waits
mDNS queries and responds to them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-17 08:36:39 -04:00
Harry Jiang
17404abed3 samples: environmental_sensing: fix the data type for read_u32()
Signed-off-by: Harry Jiang <explora26@gmail.com>
2017-10-17 09:10:26 +03:00
Paul Sokolovsky
a39ec5f72c drivers: slip: Rework logging to follow conventions
Previously, there was boolean CONFIG_SLIP_DEBUG, which effectively
switched between "logging off" and "debug-level logging". Instead,
switch to CONFIG_SYS_LOG_SLIP_LEVEL (the naming of the option follows
existing conventions) which allows to select any of the standard 5
logging levels.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-16 12:31:17 -04:00
Jukka Rissanen
8b6a7690ef samples: net: echo_client: Print the used protocol when sending
Useful when debugging what protocol is being used when sending
TCP data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-16 16:36:01 +03:00
Jukka Rissanen
f766ba4171 samples: net: echo_client: Connect both IPv4 and IPv6 before sending
Make sure we are connected before starting to send IPv4 and IPv6 TCP
data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-10-16 16:36:01 +03:00
Robert Chou
a2af43e270 net: samples: fix early unref issue for coap_client/server
Explicitly call net_pkt_ref()/net_pkt_unref() to avoid packet being
freed after calling net_context_sendto() at retransmit_request().
Also, do not return when net_context_sendto() returns error. Instead,
we should keep retrying.

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-16 12:38:28 +03:00
Robert Chou
d2e98c86fa net: samples: fix malformed payload when coap_client/server retransmit
Original coap_client implementation does not setup "appdatalen" of
net_pkt correctly and does not strip the IP + UDP headers when doing
the retransmit. This will result in malformed coap packet. Fix it by
adding a strip_headers() function to set appdatalen and get rid of
IP + UDP headers.

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-16 12:38:28 +03:00
Paul Sokolovsky
de6fafb701 samples: net: sockets: Print incoming connection number
This helps to debug issues with mass connection handling (e.g. when
issues happen at ~500th connection).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-16 11:01:06 +03:00
Anas Nashif
0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Andrew Boie
8bfac9b6c3 philosophers: run with threads in user mode
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-10-13 12:56:14 -07:00
Johann Fischer
5ab2cb96eb samples: cdc_acm: add composite configuration
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-13 09:18:14 -04:00
Robert Chou
4869c16eae net: samples: fix coap_client early unref packet issue
1. After calling sendto(), the packet will be unreferenced.
   Call coap_pending_cycle() to make sure the packet is referenced until
   we got the response from the peer or retransmission timeout.
2. In retransmit_request(), we rearrange the order to avoid the issue.
3. Remove IPv4 configuration for source code is expecting IPv6
4. Correct a typo in README.rst
5. Initialize the interface w/ IPv6 address

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-13 14:38:18 +03:00
Robert Chou
4fbf721390 net: sample: correct coap-server ETSI TD_COAP_BLOCK_03/04 testcases
When testing against etsi_coaptest.sh, test cases TD_COAP_BLOCK_03/04
will get stuck. This is because these testcases send out a blockwise
transfer but with an empty payload. Although this should be a legit
request, large-update/create handlers did not check "MORE" flag in
block1 option and always return an error when request comes with empty
payload.

Corrected as below
1. Initialize coap_block_context when first block arrives.
   (SIZE1 option is not always available. In the case that SIZE1 is
    unavailable, the zoap_block_context will be re-initialized each time
    a new block has arrived)
2. Check "MORE" flag of block1 option. If it's the last block, then
   an empty payload should be allowed.
3. Response w/ 2.04 CHANGED when the last block has arrived for
   large-update
4. Response w/ 2.02 CREATE when the last block has arrived for
   large-create
5. Remove adding block2 option to the response since we are not sending
   back any data to the caller

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-10-13 13:50:28 +03:00
Tomasz Bursztyka
4f0b25bef1 samples/wpan: Use set_filter() instead of former API function
Replace set_ieee_addr/set_shord_addr and set_pan_id relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-13 13:48:32 +03:00
Andrzej Puzdrowski
a568e1399f sample: drivers: soc_flash_nrf5: Test of write-block-size get API
Added example code of using the new API for retrieving write-block-size.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-10-11 11:19:15 -05:00
Marti Bolivar
1047be9dbe samples: flash_shell: update to keep up with flash driver changes
Keep the flash shell up to date with the latest flash driver updates.

- Get the driver name from soc.h
- Add a write_block_size command
- Implement flash_shell_page_layout() using flash_page_foreach()

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-06 22:12:23 -04:00
Ravi kumar Veeramally
b4dbd50b8d net: samples: Add leds demo app over RPL and CoAP
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally
c30f692af0 net: samples: Modify coaps_client to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally
7519240502 net: samples: Modify coaps_server to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally
bde8c6d616 net: samples: Modify zoap_client to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally
3e4a70669a net: samples: Modify zoap_server to new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Ravi kumar Veeramally
e6bda22710 net: samples: Modify leds_demo to use new CoAP api's
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-10-06 22:07:37 -04:00
Michael Scott
41897d7e19 samples: net: irc-bot: fix help text buffer size
At 32 bytes the snprintk call to fill the help buffer was most often
running out of room and returning an error.  Let's expand it to 64.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
201076254a samples: net: irc-bot: handle private messages in some commands
Users can private message the bot and the bot should respond directly
back to that user rather than rudely ignoring them.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
61c8c3fc7a samples: net: irc-bot: establish a static global for nickname
Let's create a static global var for nickname so that we can use it
later without having to pass it all the way through callbacks, etc.

Also limit the size to 16 bytes as IRC servers will truncate anything
beyond.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
2eb4a37bac samples: net: irc-bot: remove use of zirc and zirc_chan
These structures were originally intended to prototype an IRC library
which would be later moved into the subsys/net/lib/irc folder.

Unfortunately, that effort has faded and they make this code much more
complex than necessary.  Let's remove them in favor of simplicity.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
45561c7310 samples: net: irc-bot: move initialite_hardware() code to main()
The code is easier to follow this way.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
34ca5ee67b samples: net: irc-bot: declare banner text at the top
For style points let's declare the text shown at the beginning
of main() function to the top of our source as APP_BANNER so that
it's obvious and presents nicely.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
b5617b1106 samples: net: irc-bot: fix cmd parsing across multiple buffers
Let's simplify the parsing function which scans incoming traffic
for carriage returns and let the net_pkt_read() function cross
multiple buffers if needed.  Also, gracefully skip lines which
are longer than the command buffer.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
3e1e2d53ec samples: net: irc-bot: clean up prj.conf
Several settings were out-dated or now enabled elsewhere.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
334667342c samples: net: irc-bot: add support for CONFIG_NET_CONTEXT_NET_PKT_POOL
Some L2 layers such as bluetooth need to have extra buffer pools to
hold copies of packets for use with TCP.  Let's add support for that
so that future enablement of other boards won't get bitten.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
86c426d3e8 samples: net: irc-bot: migrate from NET_LOG to SYS_LOG
Let's migrate from using NET_LOG_* functions to the SYS_LOG
facility which allows for granular control over the display
of info, debug and error messages unique to the file that
you're in.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Michael Scott
80bad32828 samples: net: irc-bot: migrate to net_app API
Let's remove all of the extra coding to handle DHCP, DNS and event
management.  This is all handled by the net_app API.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-10-06 19:46:33 -04:00
Tomasz Bursztyka
10904a0d29 net/samples: Build cc2520 frdm's common code only when relevant
If cc2520 is not selected, then won't be any need for that part.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-06 18:30:18 -04:00
Johann Fischer
927cdf9c32 samples: usb: set default log levels in mass sample to error
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-10-05 12:09:59 -04:00
Tomasz Bursztyka
0576a393f2 samples/net: Let's merge ieee802154 qemu and hw tests into one
There is now only samples/net/ieee802154 for low level IEEE 802.15.4
test.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Tomasz Bursztyka
d4eeaff93c samples/net: Removing config support for arduino_101 with CC2520
It's useless now, arduino_101 has proven not working very well with x86
gpios and CC2520 never got to work properly there.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Tomasz Bursztyka
91df111386 samples/net: Getting rid of common ieee802154 settings altogether.
Only ieee802154 should have been using it, but it ended in various
samples that did not require it anymore once they've been using
net_app. Unlike former samples settings, net_app settings are tied to
net_app, so let's just forget about all of it and silently use net_app.
If something goes wrong in setting net options, it will be a unique
place.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-10-05 07:17:50 -04:00
Paul Sokolovsky
c80e9d00da samples: net: echo_client: Consistently enable net_app for all configs
This app now depends on net_app API, so it must be enabled for all
project configs we have.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-10-04 10:46:12 +03:00
Aska Wu
89f28ac7c8 net: sample: Add sntp client sample
This sample demostrates how to use SNTP client library to get the
current time from SNTP/NTP server.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-10-03 15:29:27 -04:00
Anas Nashif
71a927955e usb: move headers to include/usb/class
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif
18a33edd39 usb: fix local includes and add usb namespace
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif
fde34dd54b usb: fix header by adding subsystem prefix
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 14:50:14 -04:00
Anas Nashif
95d4ebbcd9 samples: net: use 'run' target in common Makefile.ipstack
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-03 10:27:17 -04:00
Chunlin Han
fe48e9efde sample: demonstrate the usage of memory domain APIs
The demo application to demonstrate the usage of memory domain APIs.

Signed-off-by: Chunlin Han <chunlin.han@linaro.org>
2017-09-29 16:48:53 -07:00
Johan Hedberg
d712a4e1a3 Bluetooth: Mesh: Remove local network interface Kconfig option
From section 3.4.5.3 in the Mesh Profile Specification 1.0:

    "A node shall implement a Local Network Interface."

Removing the Kconfig option also helps clean up quite a lot of code.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-27 16:33:06 +03:00
Johan Hedberg
8f168c85f7 samples: microbit/pong: Fix incorrect placement of parenthesis
The code was causing only one byte of data to be placed in timeout
instead of sizeof(timeout) as intended.

Coverity-CID: 170744

Fixes #4057

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-09-26 12:55:14 +03:00
Paul Sokolovsky
ef39533365 samples: sockets: Add a dumb HTTP server example
It's dumb, because it doesn't really parse HTTP request, just always
sends the same page in response. Even such, it's useful for socket
load testing with tools like Apache Bench (ab) and for regression
checking in the net subsystem.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-09-22 08:24:36 -04:00
Luiz Augusto von Dentz
9b5d3f174f Bluetooth: ipsp: Add dedicated conf file for CONFIG_NET_L2_BT_ZEP1656
CONFIG_NET_L2_BT_ZEP1656 shall only be used with hosts that are known to
not comply with RFC 7668.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Luiz Augusto von Dentz
a4e176b6a3 Bluetooth: ipsp: Add note about the Linux 4.12 kernel release
Since 4.12 Linux kernel has fixes required to comply to RFC 7668.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Luiz Augusto von Dentz
b81ab53f89 Bluetooth: ipsp: Add CONFIG_NET_APP_BT_NODE=y to prj_dbg.conf
CONFIG_NET_APP_BT_NODE is required in order for the Bluetooth L2 driver
to register IPSS service.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-22 07:27:34 +03:00
Andrei Emeltchenko
54831ec5c7 usb: webusb: Move USB version definition to right place
Make it possible to reuse definitions from other samples.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 13:10:04 -04:00
Andrei Emeltchenko
4efaefba5c usb: Allow to select configuration for composite devices
Composite multifunction USB devices should be able to know about
configuration change, implement it through existing callback.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-09-21 09:00:23 -04:00
Michał Kruszewski
77824a548d samples: net: Add documentation to prj_qemu_cortex_m3.conf file.
Add information that IP addresses in prj_qemu_cortex_m3.conf file for
echo_client are set that qemu<->qemu communication could be tested.

Signed-off-by: Michał Kruszewski <michal.kruszewski@nordicsemi.no>
2017-09-21 09:36:44 +03:00
Michał Kruszewski
e25ee2c3fb samples: net: Fix wrong error logging information in echo client.
When TCP connection over IPv4 could not be established there was
an error about TCP connection over IPv6.

Signed-off-by: Michał Kruszewski <michal.kruszewski@nordicsemi.no>
2017-09-20 15:44:32 -04:00
Paul Sokolovsky
4a771bad37 samples: net: sockets: Add HTTP GET example
This example shows usage of client connection and getaddrinfo().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-09-19 17:39:44 +03:00
Luiz Augusto von Dentz
154f32d9ca Bluetooth: ipsp: Remov ipss.c
This file is no longer needed as IPSS service is already enabled with
CONFIG_NET_L2_BT.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-09-18 10:21:11 -04:00
Michael Scott
33c79033d0 net: lwm2m: move library internals to net_app APIs
This is the final stage of moving the LwM2M library internals to
the net_app APIs.  This means we can support DTLS and other
built-in features in the future.  All of the logic for
establishing the network connection is removed from the sample
app.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-18 10:26:41 +03:00
Michael Scott
82c2b70cb5 samples: lwm2m: initialize lwm2m_ctx prior to use
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-18 10:26:41 +03:00
Michael Scott
728ab4229a net: lwm2m: introduce lwm2m context structure
The LwM2M library does not use net_app APIs internally.  To help
this effort let's establish a user facing structure "lwm2m_ctx"
(similar to http_client_ctx and mqtt_ctx) and start it off by
wrappering the net_context structure.

Future patches will add user setup options to this structure and
eventually remove the net_context structure in favor of a net_app_ctx.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-18 10:26:41 +03:00
Jukka Rissanen
af63ae28ec samples: net: dns: Add mDNS client support to DNS resolver sample
The DNS resolver example enables mDNS client support and then
queries zephyr.local hostname. The net-tools project has example
avahi-daemon script that will response these .local queries and
can be used in testing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-17 18:02:18 -04:00
Carles Cufi
43fa93f682 samples: bluetooth: hci: Fix TX memory leak
Whenever a buffer is sent to the driver via bt_raw using bt_send() the
buffer might not be consumed if an error is returned. In that case
unreference the buffer to avoid leaking the already allocated net_buf.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-09-13 14:17:32 +02:00
Anas Nashif
f7b2484219 samples: add missing sample.yaml and fix build
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 17:21:08 -07:00
Michael Scott
f3454769db samples: lwm2m: remove unused NET_L2_BT settings
Currently, we don't have a .conf which enabled BT.  This will be
re-enabled at some future date after migrating to the full net_app
APIs by setting CONFIG_NET_APP_BT_NODE=y.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-12 20:37:48 +03:00
Michael Scott
e54d750e37 samples: lwm2m: remove extra .conf settings
NET_APP and NET_APP_CLIENT are now set automatically.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-09-12 20:37:48 +03:00
Anas Nashif
1e8afbfe5a cleanup: remove lots of references to unified kernel
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-12 12:37:11 -04:00
Jukka Rissanen
e71a31e22f net: Wrong networking defines used in the code
There were bunch of config options in tests/net, net-shell and
wpan_serial sample, and those options had wrong name so they
were ignored by the code.

Fixes #1428

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-09-12 08:37:53 -04:00
Marti Bolivar
219b3cd067 samples: drivers: add flash_shell
This is a simple shell module that allows arbitrary boards with flash
driver support to explore the flash device.

- Reading, erasing, and writing by device offsets are supported in all
  cases.

- If the flash page layout is available, it can be printed, and I/O
  can also be done to a specified page as well.

One known issue is that writing to flash on targets that require
doubleword-sized writes (e.g STM32L4) will fail since the number of
arguments required exceeds ARGC_MAX in shell.c. Addressing that is
left to future work.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-09-11 11:41:57 -04:00
Andrzej Puzdrowski
4255766ba7 samples: drivers: soc_flash_nrf5: Get flash page layout sample
Added sample code for testing and displaying the flash layout using
the recently introduced API.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-09-11 11:41:57 -04:00
Sebastian Bøe
76537ad1dd samples: Add bbc_microbit to hci_uart's whitelist
bbc_microbit has been observed to regress on this sample and is
therefore a good candidate for CI.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-09-07 07:04:22 -05:00
Punit Vara
3dd100a750 samples: bmm150: Add sample application for BMM150 sensor
To test BMM150 geomagnetic sensor driver in polling mode,
sample application added by this patch can be used.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-09-05 07:56:41 -04:00
Carles Cufi
80e0f7939e Bluetooth: controller: Add DTM HCI commands
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-09-04 06:08:09 -04:00
Anas Nashif
62f8d4d792 samples: grove: set min_flash filter
This sample does not fit in < 32Kb when built with asserts enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-09-01 10:19:40 -04:00
Jukka Rissanen
4fea5b18ab net: app: Add IP header to packets received by TLS/DTLS tunnel
The IP header was stripped by _net_app_ssl_mux() when it received
IP packet. This is fine but if the application expects the get
the IP header, then there is a problem. Fix this by saving IP
header to ssl_context and then putting it back in front of the
packet when the data is passed to application.
Note that this IP header is not used by net_app when the packet
is sent because TLS/DTLS creates a tunnel for transferring packets
and user can only sent packets via this tunnel.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-30 08:12:10 -04:00
Ravi kumar Veeramally
487359e861 net: samples: Fix unchecked return value in zoap_server
Coverity-CID: 174411

Jira : ZEP-2525

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-08-30 08:07:56 -04:00
Jukka Rissanen
f608c2fcfc samples: net: zoap: Increase IPv6 multicast addresses
The default IPv6 multicast address count was too small,
increasing addresses to 5.

Jira: ZEP-2560

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-25 22:17:38 -04:00
Jukka Rissanen
e3f6fae846 samples: net: Fix compile error in echo-server when using TLS
The echo-server sample was using removed net_app_server_tls_disable()
function, the correct one is called net_app_server_disable()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-25 15:50:41 -04:00
Leandro Pereira
47364bcf08 samples: leds_demo: Fix null pointer dereference when adding IP address
Jira: ZEP-2549
Coverity-ID: 157607
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-22 16:32:35 -04:00
Jukka Rissanen
87adcd5ff4 samples: net: mqtt: Define the stack properly
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>
2017-08-22 16:29:51 -04:00
Jukka Rissanen
c200de1b53 net: app: Introduce missing enable/disable functions for server
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>
2017-08-22 13:33:33 -04:00
Leandro Pereira
adc95678ba samples: nats: Fix NULL pointer dereference when publishing
Also ensure that payload is sent when publishing a message.

Coverity-ID: 174408
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-22 08:19:54 -04:00
Vinayak Kariappa Chettimada
6a39ed084f Bluetooth: controller: Add Minimum Number of Used Channels Proc
Add implementation to support Bluetooth 5.0 Minimum Number
of Used Channels Procedure.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-08-21 08:41:56 -04:00
Paul Sokolovsky
756e729c00 samples: net: echo_async: Add IPv6 support
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>
2017-08-21 08:40:46 -04:00
Michael Scott
7fdd86aa09 samples: net: add sample documentation for lwm2m-client
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-21 08:37:15 -04:00
Paul Sokolovsky
dcb80f7ab8 net: struct sockaddr should have field "sa_family"
POSIX requires struct sockaddr's field to be named "sa_family"
(not just "family"):
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html

This change allows to port POSIX apps easier (including writing
portable apps using BSD Sockets compatible API).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-18 16:34:51 -04:00
Ricardo Salveti
3d4700c5c5 samples: lwm2m: add IPSO light object to LWM2M client
Uses LED0_GPIO_PORT and LED0_GPIO_PIN if available.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-08-18 10:53:25 +03:00
Tomasz Bursztyka
087354019f samples/crypto: Add mbedtls shim driver support
Normalizing variables names and make sure tag handling behavior, which
might be different among backends, does not make the test failing.

Also, improving debug logs in case of error.

Change-Id: Ic317948aab459bfa75c9a72ac48cb2d12a0d0706
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 22:20:23 -04:00
Tomasz Bursztyka
422a769cc2 samples/crypto: Check error code everytime and improve logging
If the encryption/decryption failed there is no need to procceed
further.

Change-Id: If450e40ed6fd601b698b74c56ae21fc7f903d087
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 22:20:23 -04:00
Tomasz Bursztyka
0cefc6947c samples/zoap_server: Fix unchecked return value
Coverity-CID: 174413

Jira: ZEP-2523

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 14:10:01 -04:00
Paul Sokolovsky
d9af77bfd6 net: sockets: Consistently use "BSD Sockets compatible API" moniker
This is how it's called in the main docs, so use this same phrase in
Kconfig and samples too.

Also, added some articles to docs.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-17 12:02:55 -05:00
Luiz Augusto von Dentz
3625d7c851 net: common: Don't build ipss.c
ipss.c is not longer needed when using NET_APP since that has it
built-in.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-17 10:24:05 -04:00
Ricardo Salveti
4ff2c33451 Bluetooth: samples/hci_spi: increase BT_RX_BUF_COUNT to 10
Default BT_RX_BUF_COUNT value is not enough when transfering a large
amount of data (e.g. heavy network traffic over BT 6LoWPAN). Increase
BT_RX_BUF_COUNT from default value 3 to 10.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-08-17 08:20:18 +03:00
Paul Sokolovsky
7ef28df980 Bluetooth: samples: ipsp: Fix crash on TCP connection closure
Be sure to check for NULL pkt in receive callback, which means TCP
EOF. The fix ported from echo_server sample.

Jira: ZEP-2423

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-16 23:40:11 +03:00
Paul Sokolovsky
e314de5d53 samples: net: sockets: Add READMEs for echo/echo_async samples
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-16 16:09:05 -04:00
Andrew Boie
ba95aa00e0 cpp_synchronization: fix main() definition
C++ standard mandates that main() return an 'int' even though
Zephyr does not use it. Fix build error with XCC compiler.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-16 10:59:10 -07:00
Marti Bolivar
cf9a5e352f doc: 96Boards Carbon: add Bluetooth setup docs
Add cross-referenced information on the 96b_carbon and
96b_carbon_nrf51 pages which disambiguates between the two "boards".
Also describe how to flash 96b_carbon_nrf51 with
samples/bluetooth/hci_spi and 96b_carbon with samples/bluetooth/ipsp
to support a Bluetooth HCI stack on 96Boards Carbon (the physical
board).

While we're here, make the documentation page for 96b_carbon match the
format in doc/templates/board.tmpl.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-08-15 22:58:02 +03:00
Marti Bolivar
7394401baf Bluetooth: ipsp: use sys_log
Various of the printk messages in this sample app don't have
newlines. Let's fix the output by moving to SYS_LOG_xxx() macros
instead, which don't need them anyway.  This also makes it easier to
tell errors apart from other messages, etc.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-08-15 22:58:02 +03:00
Ricardo Salveti
8dbb388000 samples: Bluetooth: add HCI SPI raw handler sample
Add a sample application that allows a Zephyr-based Bluetooth
controller to interface with an HCI driver via SPI. This sample
implements the same BT SPI protocol already as Zephyr's HCI SPI
driver.

Currently, the sample only supports the legacy SPI API.

Provide a single configuration file, avoiding board-specific
files. Some board-specific configuration information must be provided
via other means:

- CONFIG_BT_CONTROLLER_TO_HOST_SPI_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_DEV_NAME
- CONFIG_BT_CONTROLLER_TO_HOST_SPI_IRQ_PIN

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-15 22:58:02 +03:00
Gil Pitney
4f67a6c76d cc3200: Remove TI cc3200 SOC and LaunchXL board support
Per ZEP-1958, Phase 2 of adding CC3220sf LaunchXL support,
was to "deprecate the CC3200 launchxl support in Zephyr
(redundant to the CC3220)."

Effectively, the CC3220 SOC replaces the CC3200.

This patch removes the following:
* the imported CC3200 SDK
* CC3200 SOC, board, DTS files.
* adjusts other files where cc3200 was mentioned.

Also, it fixes explicit references to CC3200 in generic
CC32xx driver files.

Jira: ZEP-1958

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-08-15 11:02:48 -05:00
Carles Cufi
d5c13a7530 Bluetooth: controller: Rename Kconfig prefix
Rename the BT_CONTROLLER prefix used in all of the Kconfig variables
related to the Bluetooth controller to BT_CTLR.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-08-14 15:44:56 +03:00
Jukka Rissanen
7886336593 net: app: Fix for net_app_get_net_buf()
The documentation says that the API will automatically append the
net_buf fragment to the end of network packet fragment chain.
This was not the case and current only user for this API in
echo-server sample appended the fragment itself. The fix is to
automatically append the fragment to the end of fragment chain.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-14 10:04:03 +03:00
Maureen Helm
a580bc5b2e samples: rgb_led: Add support for hexiwear_k64
The hexiwear_k64 board can drive the leds with a pwm, so update the
rgb_led sample to work with this board.

Jira: ZEP-2025

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-08-09 18:13:29 -04:00
Maureen Helm
3b5577d102 samples: fade_led: Add support for hexiwear_k64
The hexiwear_k64 board can drive the leds with a pwm, so update the
fade_led sample to work with this board.

Jira: ZEP-2025

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-08-09 18:13:29 -04:00
Maureen Helm
28bf1a554a samples: blink_led: Add support for hexiwear_k64
The hexiwear_k64 board can drive the leds with a pwm, so update the
blink_led sample to work with this board. Reduces the maximum blinking
frequency from 500 Hz to 64 Hz because your eye can't distinguish these
higher frequencies (the led appears solidly on). Increases the minimum
blinking frequency from 0.5 Hz to 1 Hz because the mcux pwm driver can't
handle frequencies less than 1 Hz.

Jira: ZEP-2025

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-08-09 18:13:29 -04:00
Leandro Pereira
d89e7e4e45 samples: drivers: gpio: Make the sample work with ESP32
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-09 12:26:14 -07:00
Michel Jaouen
6e2ba2c9e1 mpu_stack_guard_test: update log in README.rst
Following test changes, log info have changes and previous log info
with stack guard present shows an mpu error not caused by a stack
overflow caught by mpu stack guard feature.

Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2017-08-09 13:36:09 -05:00
Michel Jaouen
3e6965d188 mpu_stack_guard_test: add more thread for test
This test launches several threads. Only last thread will overflow the
stack and an mpu exception will occur. The other threads are regulary
suspended, this triggers access to kthread structure. This tests is
failed on st and nxp platform, if 32 bytes alignement is not set.

Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2017-08-09 13:36:09 -05:00
Jukka Rissanen
55b8edc88e net: Fix LLVM compiler warnings
Jira: ZEP-2488
Jira: ZEP-2486
Jira: ZEP-2485
Jira: ZEP-2482
Jira: ZEP-2480

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-09 12:50:50 -04:00
Robert Chou
cd56290dbe net: lwm2m: rename CONFIG_NET_L2_BLUETOOTH to CONFIG_NET_L2_BT
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-08-09 16:03:02 +03:00
Jukka Rissanen
ce80c9e42d samples: net: ieee802154: Fix compile error
The path to ieee802154_settings.c was wrong so the hw sample
did not compile properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-09 14:21:02 +03:00
Johan Hedberg
2975ca0754 Bluetooth: Kconfig: Rename CONFIG_BLUETOOTH_* to CONFIG_BT_*
The API name space for Bluetooth is bt_* and BT_* so it makes sense to
align the Kconfig name space with this. The additional benefit is that
this also makes the names shorter. It is also in line with what Linux
uses for Bluetooth Kconfig entries.

Some Bluetooth-related Networking Kconfig defines are renamed as well
in order to be consistent, such as NET_L2_BLUETOOTH.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-09 11:14:19 +03:00
Michael Scott
29c7c70a86 samples: lwm2m: add IPSO temperature object to LWM2M client
This commit adds IPSO temperature support to the LwM2M client sample.

NOTE: A dummy value of 25C is set during initialization and does not
change.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-09 10:55:53 +03:00
Michael Scott
b8ac539e51 samples: lwm2m: initial sample for LWM2M client
This sample utilizes the new LwM2M library by setting up default
values for LwM2M device and firmware objects and then establisting
a connection to a LwM2M server (for example Leshan Demo Server) via
the registration interface.

To use QEMU for this purpose please see:
doc/subsystems/networking/qemu_setup.rst

NOTE: This sample currently does not demonstrate DTLS/bootstrap as
neither of these is supported by the LwM2M library.

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-08-09 10:55:53 +03:00
Jukka Rissanen
b300aa58a9 samples: net: zoap_server: Check IPv6 address add return value
When unicast IPv6 address is added to network interface, it is
possible that the return value is NULL (if all the address slots
are already occupied).

Coverity-CID: 157607

Jira: ZEP-2467

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-08 12:31:08 -04:00
Vincenzo Frascino
5398ef4d85 samples: mpu_test: Add Allow Flash Write config
This patch adds a configuration file that tests Flash writes with MPU
enabled.

[david.brown: Put options in prj.conf with comments as per review
 feedback]

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
Signed-off-by: David Brown <david.brown@linaro.org>
2017-08-08 11:20:46 -05:00
Johan Hedberg
51252bdea4 Bluetooth: samples/mesh_demo: Fix tune generation with sharp notes
The parsing of strings with sharp notes (e.g. "100C#") was incorrectly
implemented. Now it should be correct. Additional benefit is that this
should fix Coverity CID 173632.

Jira: ZEP-2467

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-08 13:10:29 +03:00
Jukka Rissanen
0c243dfe8c samples: net: Remove IEEE 802.15.4 sample setup
The IEEE 802.15.4 settings are applied automatically by
net_app_init() function is is enabled by default.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-07 21:52:51 -04:00
Jukka Rissanen
19b7213f36 samples: net: Some apps were missing IPv6 address settings
Make sure that by default we have at least IPv6 address specified
in the application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-07 21:52:51 -04:00
Anas Nashif
f461ee4df5 samples: fixed tc syntax
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-07 21:43:51 -04:00
Johan Hedberg
bf8e504588 Bluetooth: Mesh: Fix duplicate const declarations
Remvoe duplicate const declarations which may cause compiler warnings.

Jira: ZEP-2442

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-07 19:18:02 +03:00
Paul Sokolovsky
5245a686fc samples: net: sockets: Switch to net_app auto-init
Don't call net configuration explicitly, instead rely on net_app
auto init service.

Thus, the only difference between POSIX and Zephyr versions of these
samples are different include files. The application code is 100%
the same.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-08-07 10:13:47 +03:00
Luiz Augusto von Dentz
e57b7ec4ba Bluetooth: ipsp: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
7d9e0184d9 net: led_demo: Remove dependency on ipss sample service
The led demo does not even enable Bluetooth by default, and in case a
custom enables it shall use CONFIG_NET_APP_BLUETOOTH_NODE.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
5383d47b3b net: zoap_server: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
4c9ebb9d9c net: zperf: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
b9c7f2ac33 net: zoap_client: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
71929d2d5c net: mqtt_publisher: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
f78b13c059 net: http_clients: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
a0f547d3d1 net: http_client: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
4ce629d128 net: echo_client: Remove dependency on ipss sample service
The so called Router role don't require the IPSS, nor it should
advertise since it is not the peripheral in this case.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
e71d7f5dc9 net: http_server: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Luiz Augusto von Dentz
a1d694bc6d net: echo_server: Use CONFIG_NET_APP_BLUETOOTH_NODE
Make use of CONFIG_NET_APP_BLUETOOTH_NODE to enable advertising and
registering the necessary services.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-08-04 18:18:40 +03:00
Punit Vara
da163e3bfc samples: Add sample for APDS9960 sensor
Sample can be used to test ambient light, RGB and proximity
functionality of APDS9960 sensor in polling mode.

Remove old sample which is not using sensor API.

ZEP-1552

Signed-off-by: Punit Vara <punit.vara@intel.com>
2017-08-03 15:29:35 -05:00
Anas Nashif
3ac7b3a229 doc: qemu target was deprecated, use 'run'
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-03 11:48:55 -04:00
David B. Kinder
62a0cd246d doc: fix uses of back quotes in documentation
ReST defines interpreted text roles where text enclosed by single quotes
can be "intrepreted", for example :ref:`some name` becomes a link to
a label anywhere in the doc set named "some name", :c:func:`funcname()`
becomes a link to the API documentation for "funcname", and
:option:`CONFIG_NAME` becomes a link to, in our case, the documentation
for the generated Kconfig option.

This patch fixes uses of `some name` (without a role) by either adding
an explicit role, or changing to ``some name``, which indicates inline
code block formatting (most likely what was intended).

This is a precursor to changing the default behavior of interpreted
text to treat `some name` as :any:`some name` (as configured in
doc/conf.py), which would attempt to create a link to any available
definition of "some name".

We may not change this default role behavior, but it becomes an option
after the fixes in this patch.  In any case, this patch fixes incorrect
uses of single-quoted text (possibly introduced because GitHub's
markdown language uses single-quoted text for inline code formatting).

Jira: ZEP-2414

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-08-03 11:08:23 -04:00
Johan Hedberg
0be8414e2f Bluetooth: samples/mesh: Increase GATT TX buffer count
Count of 4 seems to cause deadlocks with some Android phones due to
other GATT activity in addition to Mesh related data.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-08-03 13:10:30 +03:00
David B. Kinder
e9a3411651 doc: spelling fixes in docs
regular scan through docs and KConfig files for spelling issues
and UTF-8 characters

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-08-02 15:14:13 -04:00
Andrew Boie
3d346a1105 samples: ipm_mailbox: fix build error
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-08-02 11:15:25 -04:00
Anas Nashif
7c6cecde14 samples: mbedTLS server: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
48b351e34c samples: socket: echo_async unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
6ca686cc51 samples: socket: echo: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
ce6bc346b9 samples: http_server: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
69d8a9dd3a samples: telnet_server: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
103c3bb99a samples: coaps_client: unify prj.conf and cleanup docs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
b92733d47a samples: dns_resolve: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
f69d9b9951 samples: https_client: unify prj.conf
Disable qemu_cortex_m3 due to SRAM limitation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
6bb24976f9 samples: coaps_server: unify prj.conf and cleanup docs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
b8e4464958 samples: http_client: unify prj.conf
tested on frdm_k64f

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
32f41964fb samples: nats: unify prj.conf and add sample.yaml
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
db34c58d1f samples: irc_bot: unify prj.conf
tested on frdm_k64f

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
05e24ea373 samples: mbedtls_dtlsclient: unify prj.conf
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Anas Nashif
562da39f9b samples: dhcpv4_client: unify prj.conf
tested on frdm_k64f.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-08-02 07:31:22 -04:00
Jukka Rissanen
4349895c5d samples: net: echo-client: Add DTLS support
Convert echo-client to use DTLS for UDP connections if DTLS
is enabled by prj.conf file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-01 21:09:59 +03:00
Jukka Rissanen
72ac166429 samples: net: echo-server: Add DTLS support
Convert echo-server to use DTLS for UDP connections if DTLS
is enabled by prj.conf file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-08-01 21:09:59 +03:00
Jukka Rissanen
cee4a624f3 samples: net: irc-bot: Fix Kconfig warning
Duplicate CONFIG_SYS_LOG_NET_LEVEL variable was defined in
config files so removing extras.

.config:58:warning: override: reassigning to symbol SYS_LOG_NET_LEVEL

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 20:55:26 +03:00
Jukka Rissanen
9fee74cdbb samples: net: Remove extra startup thread
Couple of network samples had extra startup thread which is not
needed currently. This was an artifact before moving to using
unified kernel.

Jira: ZEP-2236

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 20:55:26 +03:00
Jukka Rissanen
607f4fffdd samples: net: http: Enable compile tests with Bluetooth config
Run http_server, http_client and https_client compile tests with
Bluetooth config. For http client tests we only use qemu_x86 as
the qemu_cortex_m3 tests failed because of too little memory.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
0134abe368 samples: net: http: client: Enable Bluetooth if configured
If Bluetooth IPSP is enabled, then set the http client to use it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
47be0f4989 samples: net: http: client: Set QEMU flags for Bluetooth connection
Bluetooth needs different QEMU_EXTRA_FLAGS than SLIP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
c724a5730c samples: net: http: client: Use net_buf context pool for TX
If CONFIG_NET_CONTEXT_NET_PKT_POOL is defined, which is the
default for Bluetooth, then create the pool and use it when
sending network packets. This is needed when trying to send
TCP packets using Bluetooth IPSP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
a4cfee8fe6 samples: net: http_server: Set QEMU flags for Bluetooth connection
Bluetooth needs different QEMU_EXTRA_FLAGS than SLIP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
1a16b9decf samples: net: http_server: Remove QEMU memory setting
There is plenty of memory for QEMU currently so no need to
manually set the amount of memory.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Jukka Rissanen
0cdb31136c samples: net: http_server: Use net_buf context pool for TX
If CONFIG_NET_CONTEXT_NET_PKT_POOL is defined, which is the
default for Bluetooth, then create the pool and use it when
sending network packets. This is needed when trying to send
TCP packets using Bluetooth IPSP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-31 11:50:25 +03:00
Aska Wu
c0b5e55e6d net/mqtt: Enable TLS support
CONFIG_MQTT_LIB_TLS is introduced to enable TLS support.

Also, prj_frdm_k64f_tls.conf is added to demostrate the whole idea.

jira:ZEP-2261

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-07-28 11:25:43 +03:00
Aska Wu
fb79837862 net/mqtt: Convert mqtt lib to use net app API
Use net app API since we want to enable MQTT with TLS.
mqtt_connect() and mqtt_close() are added to build and close the
connection to the broker. The caller doesn't need to deal with
the net context anymore and the most of network setup code in
mqtt_publisher is removed.

Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-07-28 11:25:43 +03:00
Inaky Perez-Gonzalez
3d498dd10c build: workaround build bug in tests
When an app uses a construct such as:

obj-y = main.o ../../../../samples/bluetooth/gatt/hrs.o

in its makefile, it causes said object module to be built in the
source tree, not in the object tree.

When building massively parallel, this usually resuls on the files
getting corrupted, leading to bugs such as:

https://jira.zephyrproject.org/browse/ZEP-2316
https://jira.zephyrproject.org/browse/ZEP-2317

src/../../../../samples/bluetooth/gatt/.gap.o.cmd:3: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:4: warning: NUL character seen; rest of line ignored
src/../../../../samples/bluetooth/gatt/.gap.o.cmd:5: *** missing separator.  Stop.

as multiple build are trying to touch the same file in the source tree
and of course, race and causes a build bug.

We have known about this issue for a long time, but it requires
modifications in the build system that there is no time to tackle.

A suggested workaround is to include the source files into a local .c
file, so this is what this patch does, to remove the random noise.

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-07-27 14:09:40 -04:00
Johan Hedberg
ee3b715d1d Bluetooth: samples/mesh: Update generic nRF51 16k configuration
Update the configuration with the latest fine-tuning that was already
present in microbit.conf.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-27 13:51:34 -04:00
Johan Hedberg
28ce610a06 Bluetooth: samples/mesh: Disable unnecessary debug logs
There's no need for debug logs by default in the mesh sample, and it
just contributes excessively to the ROM footprint.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-27 13:51:34 -04:00
Wojciech Bober
ac9a8804b9 net: http_server: Enable Bluetooth stack if configured
This PR enables Bluetooth stack if Bluetooth L2 is
compiled in.

Change-Id: I8f8127031140f0603615af44e0809d203db32f48
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-07-27 16:51:55 +03:00
Anas Nashif
977537107e samples: mesh: build sample where they fit
Not easily done using RAM/ROM filters, configurations need to be adapted
to make this fit on more devices. Limit the target platforms now while
we figure out configurations.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-27 07:47:53 -04:00
Anas Nashif
ca0ad13a61 net: enable SLIP only on QEMU targets
In many networking tests we had to configure SLIP in the prj.conf
leaving those configurations Qemu specific. This change enables SLIP for
QEMU targets automatically and allows reuse of prj.conf for multiple
boards.

Additionally, the TUN options is removed. This option was not used
anywhere.

To enable self-contained networking tests that do not depend on SLIP, we
introduce the new option NET_TEST which disables TAP and allows testing
in QEMU without the need for a host interface.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-26 10:57:48 -04:00
Anas Nashif
9f642c4291 samples: mesh: build only on BLE platforms
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-26 07:23:14 -04:00
Andrew Boie
768e2a9617 mpu_stack_guard_test: fix stack declaration
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-26 05:53:14 -04:00
Andrew Boie
010498da62 samples: net: fix stack definitions
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-26 05:53:14 -04:00
Michael Scott
c58be92208 samples: net: irc_bot: fix stack declarations
kernel APIs have changed to using K_THREAD_STACK_DEFINE to declare stack
memory as well as K_THREAD_STACK_SIZEOF to calculate it's size.

Adjust irc_bot sample to reflect those changes.

This fixes stack related page faults when running irc_bot with
CONFIG_X86_STACK_PROTECTION enabled (which it is by default for qemu).

Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-07-25 18:01:32 -04:00
Johann Fischer
bc2454fa9e samples: usb: add usb.rst and README.rst for CDC ACM sample
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-23 07:41:57 -04:00
Johann Fischer
1ff51986e5 samples: cdc_acm: use Arduino 101 as default board
Be consistent with other usb samples and use Arduino 101
as default board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-23 07:41:57 -04:00
Paul Sokolovsky
4732452a42 samples: bluetooth: ipsp: Bump max number of contexts
This sample includes builtin UDP and TCP echo servers, max
MAX_CONTEXTS=3 as set previously, they just didn't work.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-22 10:33:29 +03:00
Johan Hedberg
0ec2630882 Bluetooth: Mesh: Add initial implementation
Add an initial implementation for the Bluetooth Mesh Profile
Specification. The main code resides in subsys/bluetooth/host/mesh and
the public API can be found in include/bluetooth/mesh.h. There are a
couple of samples provided as well under samples/bluetooth and
tests/bluetooth.

The implementation covers all layers of the Bluetooth Mesh stack and
most optional features as well. The following is a list of some of
these features and the c-files where the implementation can be found:

 - GATT & Advertising bearers (proxy.c & adv.c)
 - Network Layer (net.c)
 - Lower and Upper Transport Layers (transport.c)
 - Access Layer (access.c)
 - Foundation Models, Server role (health.c & cfg.c)
 - Both PB-ADV and PB-GATT based provisioning (prov.c)
 - Low Power Node support (lpn.c)
 - Relay support (net.c)
 - GATT Proxy (proxy.c)

Notable features that are *not* part of the implementation:

 - Friend support (initial bits are in place in friend.c)
 - Provisioner support (low-value for typical Zephyr devices)
 - GATT Client (low-value for typical Zephyr devices)

Jira: ZEP-2360

Change-Id: Ic773113dbfd84878ff8cee7fe2bb948f0ace19ed
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-20 09:30:44 +03:00
Paul Sokolovsky
0e5c365f9a samples: net: sockets: Move socket sample(s) under a subdir
It's expected that there will be few socket-based samples, so move
tehm under samples/sockets/ to not clutter the main dir.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-18 21:46:56 +03:00
Paul Sokolovsky
00e8309f03 samples: sockets: Add async echo server example
Implements asynchronous TCP echo server using non-blocking sockets
and poll, with concurrent connections support.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-18 21:46:06 +03:00
Jukka Rissanen
8f9249cf5c samples: net: coaps_server: Increase mcast addresses
The coaps server sample application did not start because
number of IPv6 multicast addresses was too low. Increased
the address count from 2 to 5.

Jira: ZEP-2359

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-18 09:33:46 +03:00
Luiz Augusto von Dentz
ca9c8a2627 Bluetooth: ipsp: Remove requirements section
All supported driver are HCI based so there is no need have it state on
the README.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-17 17:45:46 +02:00
Johann Fischer
a8d7659a63 samples: dfu: fix usb configuration descriptor length
The macros for calculating the length of the configuration
descriptors have been interchanged, fix it, and use the
correct macro for the length of the DFU mode configuration
descriptor.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-07-15 11:26:40 +03:00
Robert Chou
33c54ee6fd net: zoap: advance block context by checking M bit from block option
According to RFC7959 page 30, "The end of a block-wise transfer is
governed by the M bits in the Block options, _not_ by exhausting the
size estimates exchanges."

Therefore, we should check the M bit instead of total size (which
is not always available, too)

Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
2017-07-14 11:06:54 +03:00
Luiz Augusto von Dentz
94409a14ae Bluetooth: ipsp: Disable debug options
This disable debug options in order for the image to fit in boards
such as arduino_101 and quark_se_c1000_devboard.

For convenience this adds another configuration file with as it was
available previously which can be build using:

make CONF_FILE=prj_dbg.conf

JIRA: ZEP-2378
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-07-12 17:37:45 +03:00
Erwin Rol
507add28c9 samples: net: http_server: Add olimex_stm32_e407 project config file
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2017-07-12 12:53:51 +03:00
David B. Kinder
eeed8ce179 doc: fix wiki board references in non .rst files
Some README files referenced wiki articles that have been
moved to the doc area on the website.

Fixes #668

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-07-11 12:45:35 -05:00
Paul Sokolovsky
52f8cde07b samples: net: socket_echo: Add sample.yaml, update for net_app refactor
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-07-11 10:32:29 +03:00
Andrew Boie
65a9d2a94a kernel: make K_.*_INITIALIZER private to kernel
Upcoming memory protection features will be placing some additional
constraints on kernel objects:

- They need to reside in memory owned by the kernel and not the
application
- Certain kernel object validation schemes will require some run-time
initialization of all kernel objects before they can be used.

Per Ben these initializer macros were never intended to be public. It is
not forbidden to use them, but doing so requires care: the memory being
initialized must reside in kernel space, and extra runtime
initialization steps may need to be peformed before they are fully
usable as kernel objects. In particular, kernel subsystems or drivers
whose objects are already in kernel memory may still need to use these
macros if they define kernel objects as members of a larger data
structure.

It is intended that application developers instead use the
K_<object>_DEFINE macros, which will automatically put the object in the
right memory and add them to a section which can be iterated over at
boot to complete initiailization.

There was no K_WORK_DEFINE() macro for creating struct k_work objects,
this is now added.

k_poll_event and k_poll_signal are intended to be instatiated from
application memory and have not been changed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-07-10 11:44:56 -07:00
Geoff Gustafson
1405627c37 net: context: Use K_NO_WAIT instead of 0 for timeout
Signed-off-by: Geoff Gustafson <geoff@linux.intel.com>
2017-07-10 10:59:28 +03:00
Kumar Gala
5920acef8a samples: mark samples that require usb_device support
Add depends_on usb_device for those samples that need it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-07-07 09:01:01 -05:00
Erwin Rol
3ff4d7409f samples: random: Add sentinel to check for buffer overflows
Initialize the buffer to 0 and read one byte less than the
buffer size. The result should be that the last byte of
the buffer always stays 0. This way it is possible to verify
it the driver does not write outside the buffer.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2017-07-07 07:27:39 -05:00
Jukka Rissanen
6ce9d8e882 samples: net: zperf: Add net tag
This sample app should be tested whenever net tag is specified.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Jukka Rissanen
3604c391e6 net: udp: Remove NET_UDP_HDR() macro and direct access to net_buf
Remove NET_UDP_HDR() macro as we cannot safely access UDP header
via it if the network packet header spans over multiple net_buf
fragments.

Fixed also the UDP unit tests so that they pass correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-07 15:24:00 +03:00
Bogdan Davidoaia
e90064f317 samples: net: ieee802154: add KW40Z prj conf file
The config file for KW40Z has the shell disabled, as available
SRAM memory is limitted to 16kB.

Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-07-06 14:20:32 -05:00
Bogdan Davidoaia
8909be81f9 samples: net: ieee802154: kw41z: reduce log level
Reduce log level to show only error messages.

Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-07-06 14:20:32 -05:00
Anas Nashif
d7154d50df samples: wpanusb: add testcases
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-06 10:34:41 -05:00
Jukka Rissanen
7a31d4b8cb net: app: Fix dual IPv4 and IPv6 support
It was not possible to send IPv4 packets if IPv6 was also
enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-07-06 14:32:37 +03:00
Anas Nashif
c364e06ccb tests: move spi test under tests/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif
c69de8b146 samples: remove reference to nimble
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif
68d7a207ae ethernet: fix Kconfig option for ETHERNET
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Anas Nashif
c01c074b5b net: fix wrong Kconfig
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT should be used instead of
CONFIG_NET_IFACE_UNICAST_IPV6_ADDR_COUNT.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Carles Cufi
c170855825 Bluetooth: hci_uart: Set the UART TX size correctly
Since the controller comes with a transmit buffer size that mirrors the
maximum size of a transmit packet, use that to size the buffers that are
used in the hci_uart application to receive packets from the Host over
the UART.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-07-05 16:59:31 +02:00
Anas Nashif
8aac831e3c samples: mqtt_publisher: fixed typo
Also fix console syntax adding prompt: $

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-04 16:52:40 -04:00
Johan Hedberg
30beef9419 Bluetooth: GATT Introduce BT_GATT_CCC_MAX helper define
The worst-case maximum number of CCC entries we need is actually
MAX_CONN + MAX_PAIRED. Provide a helper define for it and use it
whenever appropriate.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-07-04 17:30:40 +03:00
Anas Nashif
07c0d3d0f0 samples: ipm_mailbox: fix thread creation
We have been starting the same thread twice. Introduced when we moved
from k_thread_spawn.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-03 20:57:44 -04:00
Neil Armstrong
395daba0d4 samples/spi: Enable test on STM32 SoCs
Add support for the STM32 SoCs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Neil Armstrong
394aa8127a samples/spi: Permit specifying low test frequency
The STM32 lower frequency is different, let us specify a different one.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Neil Armstrong
9eb865e03a samples/spi: Make async test optional
Handle the case when the async transceive call returns ENOTSUP.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Vinayak Kariappa Chettimada
6cc00f0ee3 Bluetooth: samples: scan_adv: Select BROADCASTER and OBSERVER
Explicitly select CONFIG_BLUETOOTH_BROADCASTER and
CONFIG_BLUETOOTH_OBSERVER in the scan_adv sample.

If the Controller is included without connections support
then only broadcaster support is compiled in by default,
hence add broadcaster and observer role support explicitly
in the prj.conf file.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2017-06-30 13:42:33 +03:00
Jukka Rissanen
439ceb99c1 samples: net: https: Increase the RAM for client and server
Next two commits will increase the mbedtls ram usage a bit and
https client and server sample test will fail.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
5f9d79f290 samples: net: http: Remove net_app_init() calls
As the net app API is automatically initialized, there is no
need to call net_app_init() by the http client and server sample
applications.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
d14d167188 samples: net: wpan: No need to define IP addresses
Removing CONFIG_NET_APP_SETTINGS from prj.conf file as the
sample does not use or need any IP addresses.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
76e6e32cad net: samples: Convert echo-client to use network app API
This commit will convert echo-client to use the net app API
when creating the connection to peer. Most of the network
setup code will be removed from echo-client by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
2e7c3519a4 net: samples: Convert echo-server to use network app API
This commit will convert echo-server to use the net app API
when creating the listening service. Most of the network
setup code will be removed from echo-server by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Jukka Rissanen
a1be6a8ba9 net: app: Create support for network application API
The network application API is a higher level API for creating
client and server type applications. Instead of applications
dealing with low level details, the network application API
provides services that most of the applications can use directly.

This commit removes the internal net_sample_*() API and converts
the existing users of it to use the new net_app API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-30 06:13:09 -04:00
Kumar Gala
c84e90e7de samples: nfc_hello: limit to uarts that support interrupts
We get some failures to build if we don't filter this test to only
boards that support uart interrupts.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 14:55:43 -04:00
Kumar Gala
fbd1bc2a93 samples: hello_world: remove min_ram requirement
The hello_world sample builds everywhere so remove the min_ram
requirement from samples.yaml.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 11:48:34 -04:00
John Andersen
913e2cdb24 samples: net Documented QEMU_INSTANCE usage
Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
John Andersen
06b92c6611 samples: net: Multiple instances of QEMU
Makefiles which start QEMU (make run) have been changed to operate
off of the QEMU_INSTANCE variable. QEMU_INSTANCE is simply appended
to the pid and sock file names. This makes us able to run multiple
QEMU Zephyr instances of the same sample.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-06-29 07:20:46 -04:00
Kumar Gala
21cf3a6344 samples: Fix filtering on UART_CONSOLE
There were a few different issues with the UART_CONSOLE filtering:
* Filter was incorrect - UART_CONSOLE should be CONFIG_UART_CONSOLE
* platform_exclude was used for drivers that had a #error for lack of
  interrupt support.  We can now use CONFIG_SERIAL_SUPPORT_INTERRUPT in
  the filter for that.  This catches all the various drivers that needed
  don't support uart interrupts, not just the onces that had a #error

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-29 07:07:31 -04:00
Johann Fischer
08df5961b3 arch: intel_quark: use DW device driver when USB is selected
This patch allows more generic USB configuration in the samples
and removes platform dependent driver configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-28 15:14:15 -04:00
Anas Nashif
d1e562c924 tests: replace filters in testcase files
Where possible, replace the use of filter with newly added keywords.
This will speed things up and in some cases add more coverage due to bad
filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-28 09:51:40 -05:00
Paul Sokolovsky
d950ec2981 samples: net: Add socket-based echo server example
The example source code is POSIX-compatible (modulo include files),
i.e. can be built and behaves the same way for Zephyr and a POSIX
system (e.g. Linux). Makefile.posix is available for the latter.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-06-28 16:07:55 +03:00
Johann Fischer
3dd51d52a2 drivers: usb: use generic option name for log level
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-28 09:02:27 -04:00
Jukka Rissanen
cd19a57811 samples: net: mbedtls: Fix server compilation
The code has missing proper conversion from net_buf to net_pkt
that was implemented in commit db11fcd "net/net_pkt: Fully
separate struct net_pkt from struct net_buf"

The sample.yaml had incorrect whitelist string so this is also
fixed here.

Fixes #596

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-27 19:20:53 -04:00
Anas Nashif
6ff291a174 tests: do not exclude quark_d2000_crb
quark_d2000_crb does not build net/bluetooth tests by default now.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Anas Nashif
3c50f7aa12 tests: samples: remove duplicate filtering
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Jukka Rissanen
92fa7ac6ce net: http: Remove mbedtls heap setting from http library
The global mbedtls heap is set automatically now so no need to
set it individually in the http library.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-27 16:42:59 +03:00
Kumar Gala
514a07a9e2 samples: coaps_server: Fix platforms to build coap_server test on
We incorrectly had an arch_whitelist constraint set to 'qemu_x86' that
should have been a platform_whitelist, so fix that and add arduino_101
frdm_k64f to the platform_whitelist as targets that we can test this on.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-06-23 16:03:21 -04:00
Anas Nashif
3afb47887f samples: hci_uart: optimize testcase definition
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-22 09:22:48 -04:00
Anas Nashif
dc36e905b6 samples: environmental_sensing: update filtering
Build only for arduino 101 and update title and description.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-22 09:22:48 -04:00
Carles Cufi
634d3b46a9 Bluetooth: Set hci_uart RAM config to fit privacy
With the introduction of privacy, the system workqueue is now being
linked into the image, growing the RAM footprint considerably.

In order for the sample to fit in QFAA and QFAB variants of the nRF51
(16KB of RAM) we reduce the workqueue stack size to 512 since the RPA
update mechanism doesn't use more than 340 bytes and we stick to 16
connections maximum.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-06-22 14:40:23 +03:00
Johann Fischer
aea4c31722 samples: wpanusb: remove unnecessary condition for ccflags
The condition in src/Makefile is not necessary since the
net_private.h is always included from wpanusb.c and is not
dependent on the transceiver.

Change-Id: I07a0bf599f328bacb8c5677f20eb221a05f30866
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-06-22 07:09:07 -04:00
Anas Nashif
470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif
cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
David B. Kinder
a741c00a08 doc: fix references to moved files
Some recent PRs moved sample files to a new location

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-20 18:26:53 -04:00
Anas Nashif
1618013e52 doc: add MPU samples to index
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-20 10:40:16 -04:00
Anas Nashif
e3806d9766 Revert "Kconfig: Source Kconfig from Zephyr application directory."
This reverts commit 83edd615ca.

Causes the documentation build to fail on Kconfig parsing, needs fixing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-20 10:40:16 -04:00
Michał Kruszewski
83edd615ca Kconfig: Source Kconfig from Zephyr application directory.
Enable application specific configuration to be easily included
and manageable via Kconfig. Add sample.

Signed-off-by: Michał Kruszewski <mkru@protonmail.com>
2017-06-20 08:48:36 -04:00
Sharron LIU
f6bc86db50 samples: appdev: static_lib: added "make flash"
ISSM team wanted to integrate
"samples/application_development/static_lib" app
into their IDE. Al-ashi, Mahmoud <mahmoud.al-ashi@intel.com> found
it failed to "make flash" this app.

Also this patch added "make flash" build targets.

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-06-20 08:30:26 -04:00
Anas Nashif
4ad2746088 samples: demonstrate the use of KBUILD_ZEPHYR_APP
Jira: ZEP-2280
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif
c2a2cfc8c8 samples: move app developemnt samples samples/appdev
Move all application development and build related samples into one
folder.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif
5c3c323069 samples: move all MPU samples into one directory
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif
19e78bcfe1 samples: move quark se power samples to boards/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif
f7c226400d samples: move environment sensing to boards
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-19 21:23:11 -04:00
Anas Nashif
397d29db42 linker: move all linker headers to include/linker
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-18 09:24:04 -05:00
Geoffrey Le Gourriérec
1975ce4f7c samples: gpio: Add support for SensorTag board.
Add extra #defines in samples/drivers/gpio to test
TI SensorTag board.

Signed-off-by: Geoffrey Le Gourriérec <geoffrey.legourrierec@smile.fr>
2017-06-16 16:18:12 -04:00
Johan Hedberg
9703927f84 net: buf: Move net_buf_pool objects to dedicated linker area
Moving the net_buf_pool objects to a dedicated area lets us access
them by array offset into this area instead of directly by pointer.
This helps reduce the size of net_buf objects by 4 bytes.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-06-16 17:05:06 +03:00
David B. Kinder
cbec29ab95 doc: change UTF-8 chars to sphinx inline replaces
Avoiding use of UTF-8 characters (trip up some tools)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-16 07:35:11 -05:00
Luiz Augusto von Dentz
79af35991b Bluetooth: GATT: Add bt_gatt_register_service
This adds bt_gatt_register_service using bt_gatt_service which contains
the attribute array that is then added to the database saving a pointer
in each and every attribute declared.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz
d837a6ec4b Bluetooth: GATT: Add GAP service by default
GAP is mandatory service and now that the db can only be build
dynamically there is no reason to keep the applications registering it.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Luiz Augusto von Dentz
b3cfabab63 Bluetooth: Remove CONFIG_BLUETOOTH_GATT_DYNAMIC_DB
Removes CONFIG_BLUETOOTH_GATT_DYNAMIC_DB in preparation to the
introduction of bt_gatt_unregister.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-06-15 21:53:00 +03:00
Aska.Wu
2970e8beae samples: coaps_server: add prj_frdm_k64f.conf
Be able to test coaps server on frdm k64f board.

Jira: ZEP-1878
Signed-off-by: Aska Wu <aska.wu@linaro.org>
2017-06-14 09:51:34 +03:00
David B. Kinder
d1bdb3e092 doc: fix board/sample broken links
Some files have moved from their original location, or are no longer
available.  For the mbedtls samples, tweak the link to point to a page
where links for current and previous downloads can be found.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-13 20:49:13 -04:00
Andrew Boie
fed3331c9f mpu_stack_guard_test: use k_thread_create()
Issue: ZEP-2270
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-13 11:04:05 -05:00
Leandro Pereira
cf05b11924 samples: net: Do not assume TCP connection was successful
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-13 10:33:41 +03:00
David B. Kinder
342bdda760 doc: spelling fixes in samples/ and boards/
regular spelling check on .rst files

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-06-12 18:28:08 -04:00
Jukka Rissanen
57df515028 samples: net: echo-client: Fix compile error
This commit fixes compile error caused by commit 39962dc9
"samples: use k_thread_create()"

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-12 18:01:50 -04:00
Andrew Boie
e87eacacfa samples: use K_THREAD_STACK_DEFINE macros
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-09 18:53:28 -04:00
Jukka Rissanen
e90f4e1486 sample: net: Add https-client sample application
This https-client sample starts to send HTTP GET/HEAD/POST
requests same way as http-client, to https server that can
be found in net-tools repository.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-09 09:56:21 +03:00
Jukka Rissanen
393ab90785 samples: net: Fix README.rst file documentation
Various network samples contained QEMU slip setup instructions
or those instructions were missing. A reference doc in
doc/subsystems/networking/qemu_setup.rst file already has the
setup instructions for QEMU. So add a reference to that file
in samples/net/*/README.rst files and remove unnecessary slip
setup instructions in relevant files.

Fix various typos in readme files at the same time.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-09 09:55:37 +03:00
Anas Nashif
3405607d9e license: add missing licenses and copyright
We were missing license boilerplate in many files, add them

Jira: ZEP-1464

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-08 10:41:56 -04:00
Sharron LIU
c282811983 samples: static_lib: conditional assign BOARD (?=)
The sample app "static_lib" is very important to Zephyr user, which
demonstrate how to build and link a static lib.
ISSM team wanted to integrate this app in their IDE for quark platforms.
However they find the in "static_lib/hello_world/Makefile" BOARD is
hardcoded as qemu_x86.

This patch supports other BOARD passed from build command.
I have verified this app working fine @Arduino101.

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-06-08 07:55:25 -05:00
Sharron LIU
3970cd4a87 samples: fixed typo in README.rst
Per ISSM team feedbacks:
“demostrating” >> “demonstrating”
“demonstates” >> ”demonstrates”

Signed-off-by: Sharron LIU <sharron.liu@intel.com>
2017-06-07 22:53:54 -04:00
Andrew Boie
489d7475f8 samples: restore cpp_synchronization test
Issue: ZEP-2172
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-06-06 20:37:11 -04:00
Leandro Pereira
cb0f81f25f samples: dns_resolve: Clarify documentation about DNS configuration
Add clarification that the DNS server configuration must be edited in
the respective prj.conf file.

JIRA: ZEP-2040
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-06-03 15:02:14 -04:00
Florian Vaussard
5671c15fee samples: blink_led: Add support for STM32F412
The STM32F412 has PWM output capabilities. Add support to the blink_led
samples.

Tested using a Nucleo STM32F412ZG board (PWM output on pin 28 of the
CN11 Morpho connector and pin 29 of the CN10 Zio connector).

Change-Id: I75fb986fa97bd1c07c6375938430e7963297cd9d
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-06-02 14:11:13 -04:00
Florian Vaussard
acdbf7d093 samples: blink_led: Add support for STM32F413
The STM32F413 has PWM output capabilities. Add support to the blink_led
samples.

Tested using a Nucleo STM32F413ZH board (PWM output on pin 28 of the
CN11 Morpho connector and pin 29 of the CN10 Zio connector).

Change-Id: I3b25b09cab54265b28088ac9681aec588d9d48b5
Signed-off-by: Florian Vaussard <florian.vaussard@heig-vd.ch>
2017-06-02 14:11:13 -04:00
Jukka Rissanen
3616ec145b samples: net: http_client: Increase the number of buffers
The number of RX and TX buffers is increased to 64 as the
earlier limit can cause memory exhaust in some cases.

Jira: ZEP-2223

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-02 12:43:52 +03:00
Jukka Rissanen
bad6e28827 samples: net: dtls_client: Fix Coverity warning
This fix is basically a no-op as the rx_buf pointer cannot be null
in practice, but in order to avoid Coverity complaining about
it add some null pointer checks to the UDP handling code.

Coverity-CID: 170124
Jira: ZEP-2235

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-02 12:34:50 +03:00
Tomasz Bursztyka
cced7fd47a api/spi: Change transceive functions signature
Instead of NULL terminated buffer arrays, let's add a parameter for each
that tells the number of spi_buf in it.

It adds a little bit more complexity in driver's side (spi_context.h)
but not on user side (bufer one has to take care of providing the NULL
pointer at the end of the array, now he requires to give the count).

This will saves a significant amount of bytes in more complex setup than
the current dumb spi driver sample.

Fix and Use size_t everywhere (spi_context.h was using u32_t).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-06-01 10:49:30 -04:00
Jukka Rissanen
7d13261bd9 samples: net: zperf: Fix llvm compiler warnings
Jira: ZEP-1884

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-06-01 10:30:21 -04:00
Leandro Pereira
7a972c0229 samples: mqtt_publisher: Try connecting a few times before giving up
Waiting for an NET_EVENT_IF_UP before trying to connect isn't sufficient
in some cases; for instance, on devices using the MCUX HAL, such as the
FRDM-K64F, the interface will have the NET_IF_UP flag set even though
the link negotiation didn't yet complete.

Executing this sample on such board will produce the following output.
Notice the "Enabled 100M..." message right after trying to connect.

    [dev/eth_mcux] [DBG] eth_0_init: MAC 00:04:9f:6f:91:da
    net_context_connect error Is the server (broker) up and running?
    [publisher:247] network_setup: -60 <ERROR>

    Bye!  [dev/eth_mcux] [INF] eth_mcux_phy_event: Enabled 100M
    full-duplex mode.

Even though the returned error is ETIMEDOUT, increasing
net_context_connect()'s timeout parameter to several seconds isn't
sufficient; other steps performed by network_setup() after the link has
been fully established are necessary.  As a stopgap measure, try
connecting a few times before giving up (more than one connection
attempt should be made by application in most cases, anyway.)

It might be the case that we need events to monitor ethernet link
(re)negotation in addition to the NET_IF_UP bit.

Jira: ZEP-2036
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-31 17:16:28 -04:00
Johan Hedberg
d2ba7950c5 samples: boards/microbit: Use 250 ticks per second for smooth display
To avoid display flickering, use 250 ticks per second instead of the
default 100.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 12:29:11 +03:00
Johan Hedberg
a90735d64c samples: microbit/pong: Disable advertising when connected
The state machine of the game assumes that the user needs to
explicitly re-select multiplayer game when disconnected. We need to
therefore make sure that advertising stays off as soon as the first
connection happens.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 10:11:09 +03:00
Johan Hedberg
eb89db26b5 samples: microbit/pong: Fix disabling sound when ending game
Occasionally the sound might stay enabled for the restart timeout (2
seconds) if the ball would hit the wall right before missing the
paddle. Ensure that it's disabled whenever the game ends.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-30 10:11:09 +03:00
Jukka Rissanen
35ef580389 samples: net: coaps_client: Fix testcase.ini
The platform list was incorrectly set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 17:35:20 -04:00
Jukka Rissanen
5a0b4976d9 samples: net: coaps_client: Fix compile issues
The coaps_client was bit rotted and did not compile
correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 17:35:20 -04:00
Jukka Rissanen
e7c52a492f samples: net: mbedtls_dtlsclient: Fix testcase.ini
The platform list was incorrectly set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:51:35 +03:00
Jukka Rissanen
27990f77e1 samples: net: mbedtls_dtlsclient: Fix compile issues
Some net_pkt API changes were not done for this sample.

Jira: ZEP-2072

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:51:35 +03:00
Jukka Rissanen
eeaa29666b net: http: Handle HTTPS connection closing gracefully
If the HTTPS connection is closed, then properly handle call to
HTTP parser init in case of error and also remove any pending
data that belong to old connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-29 23:50:33 +03:00
Johan Hedberg
1bb9a04912 samples: microbit/pong: Fix refreshing display upon disconnect
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg
190b0d1a10 samples: microbit/pong: Filter out spurious button presses
The buttons on the microbit cause quite easily "ghost" key presses.
Add a simple filter that ignores button presses from the same button
that happen less than 100ms from each other.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg
0b16e8ada5 samples: microbit/pong: Increase ISR stack size
The stuff that the GPIO button callback does (in particular the printk
calls) requires more stack space from the ISR stack. Increase it to 1k
from the default 640.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Johan Hedberg
3357813373 samples: microbit/pong: Analyze kernel stacks periodically
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-29 17:31:30 +03:00
Luiz Augusto von Dentz
f8c4a34663 Bluetooth: ipsp: Enable CONFIG_BLUETOOTH_SHELL
This enabled testing CONFIG_BLUETOOTH_SHELL with configuration other
than btshell and enables ipsp sample to use bt shell module which
allows to disconnect, print metrics, etc.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-05-29 10:42:21 +03:00
Vincenzo Frascino
68f3b71b5d arm: core: mpu: Add core support to NXP MPU
This patch add arm core MPU support to NXP MPU driver.

With this feature it is now possible to enable stack guarding on NXP
MPUs.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-05-28 09:18:54 -05:00
Johan Hedberg
9516d63836 Bluetooth: Remove support for NBLE
NBLE has been deprecated for a few releases now and can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-25 09:03:16 -07:00
John Andersen
7985e917c9 samples: net: mqtt_publisher: fixed formatting
README.rst had formatting which was making things disappear in the
online documentation.

Signed-off-by: John Andersen <john.s.andersen@intel.com>
2017-05-25 18:48:49 +03:00
Johan Hedberg
9e2fb2f3ad samples: microbit/pong: Add basic sound support
Add beeps whenever the ball hits the walls or the paddle. Requires a
piezo buzzer connected to pin 0.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07:00
Johan Hedberg
5e59f13ca3 samples: microbit/pong: Add BLE-based multiplayer support
Add support for connecting two micro:bit devices to play pong between
themselves.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07:00
Johan Hedberg
9a7cb7134a samples: microbit/pong: Add initial draft of a pong game
Add initial draft of a pong game using the display on the micro:bit
and its two buttons. This draft only supports a solo game where the
ball bounces from the "roof" and lets the player play against himself.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-23 14:46:02 -07:00
Jukka Rissanen
11aee50eef sample: net: http: Add Basic auth support to server sample
Basic auth support was missing from HTTP server sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-23 18:01:04 +03:00
Tomasz Bursztyka
0938ccbbc1 samples/spi: Add a quick test for spi_release() API function
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka
d9007a09f8 samples/spi: Add an asynchronous call test
This gives a quicke example on how to use SPI asynchronous calls with
kernel's k_poll API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka
761a1d9429 api: Add asynchronous call support to SPI API
Adding a struct k_poll_signal parameter to driver's API unique
exposed function.

If not NULL, the call will be handled as asynchronous and will
return right after the transaction has started, on the contrary
of current logic where is waits for the transaction to finish
(= synchronous).

In order to save stack, let's move the device pointer to struct
spi_config. So the call is still at a maximum of 4 parameters.

Adapting spi_dw.c and spi driver sample to the change so it still
builts.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka
cd54dc66f2 samples: Add an SPI driver test application
This application intents to test an SPI driver by looping over MISO/MOSI
line where the controller will then send data to itself.

It will test various buffer tx/rx schemes.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Jukka Rissanen
63ca45b222 samples: net: http: Remove Arduino-101 config from server
There is not enough memory to run the HTTP server sample
application in Arduino-101 so remove the config file.

Jira: ZEP-2157

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-19 16:05:38 +03:00
Anas Nashif
51f9318a32 samples: lcd_hd44780: return if binding fails
Coverity-ID: 151980
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 11:19:11 -05:00
Anas Nashif
6aa77e9f3e Revert "net: zoap_server: Unify Makefile and add prj file"
This reverts commit 350d5d4d60.

This change break with many boards and leaves prj.conf unused.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 15:09:15 +03:00
Jukka Rissanen
c9d21ef831 samples: net: http: Remove obsolete files from server sample
There was some left overs from earlier version of http_server
sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-18 15:07:02 +03:00
Wu Jiequan
350d5d4d60 net: zoap_server: Unify Makefile and add prj file
Modify the Makefile to unify with other sample apps and
add the arduino 101 configuration file.

Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-05-17 09:37:40 +03:00
Vincenzo Frascino
8162bb63c4 samples: mpu_test: Add controller specific write
This patch add a controller specific write function and fixes a
documentation error in the mpu_test README file.

Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-05-16 09:28:06 -05:00
Vincenzo Frascino
14a892f7a4 samples: Add mpu stack guard test
This patch adds the mpu_stack_guard_test to the available samples.
The purpose of this test is to exercize the thread stack guard enabled
via MPU on arm platforms.

Change-Id: I4665a20956d9e6d0dd4b5cc862e82040a53afafc
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-05-16 09:28:06 -05:00
Vincenzo Frascino
1a1df7cc64 samples: synch: Add Thread Stack Guards conf
This patch adds the Thread Stack Guards configuration option to the
synchronization sample.

This is meant to be an easy way to prove that the MPU can be dynamically
programmed on the supported platforms.

Change-Id: I77fbe6af3303ff8a2904768abd4cc9797f03c092
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-05-16 09:28:06 -05:00
Paul Sokolovsky
3cb13b9687 subsys: console: Add buffered output support to console subsystem
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-05-15 15:56:56 -04:00
Erwan Gouriou
19a91c0272 soc: stm32l476rg: rename SOC config flag
Rename SOC_STM32L476XX to SOC_STM32L476XG to keep flash
size information.
Aim is to be able to distinguish flash size variants of
the SoC when needed (for instance in dts/arm/st/mem.h file)

Change-Id: I834bb5b83c24c39e90c0492a2b22a7c7802de361
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-05-15 13:22:54 -04:00
Youvedeep Singh
1da0a9eebd cdc_acm : Restrict writing more than 4 bytes into TX USB Endpoint.
Sometime it is observed on the Arduino 101 that when we write more than
4 bytes into TX USB Endpoint, first 4 bytes are getting repeated
(frequency of occurrence ~1/3000).

This patch does following :-

1. In sample application "cdc_acm", it adds capability to
handle partial transfer data incase data is transferred partially
if exceeds maximum data transfer size.
2. It restricts write of more than  4 bytes into TX USB Endpoint.
This is work around to  avoid issue occarance.

Jira: ZEP-2074

Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-13 15:12:27 -04:00
Jukka Rissanen
a174d2eba7 net: http: Add HTTP server library support
This commit creates a HTTP server library. So instead of creating
a complex HTTP server application for serving HTTP requests, the
developer can use the HTTP server API to create HTTP server
insteances. This commit also adds support for creating HTTPS servers.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Jukka Rissanen
19868313fc net: samples: Fix the BT compilation in sample API
The CFLAGS and object path were set incorrectly for Bluetooth.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Jukka Rissanen
d4c5cc10e4 net: samples: Add support to wait both IPv4 and IPv6
The net_sample_app_init() is now able to wait that both IPv4
and IPv6 addresses are setup before continuing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-13 14:30:58 -04:00
Carles Cufi
6c9e563c92 Bluetooth: Move common code to common/
Since more and more code is going to be reused by both the Host and the
Controller, this commit introduces a common/ folder that will contain
everything that is not tied to one of the two components but shared by
them.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-12 12:56:14 +03:00
Andrew Boie
39962dc92c samples: use k_thread_create()
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-05-11 20:24:22 -04:00
Andrei Emeltchenko
bca1077d3c samples: ipm_mailbox: Remove unneeded definitions
Make sample working for other architectures.
SCSS_REGISTER_BASE and SCSS_SS_STS are defined in soc.h

Change-Id: Ie477520d2fb9bfcbbb5038ff42356a56d8180a1f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-05-10 09:08:58 -04:00
David B. Kinder
2f41cb8329 doc: misspelling and UTF-8 fixes
More general spelling fixes, and cleaning up stray UTF-8 characters
such as curly-quotes, em- and en-dashes.  Use replacement strings
for |reg| and |trade|.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-05-09 20:15:49 -04:00
Johan Hedberg
18593e74e1 Bluetooth: samples: Fix passkey display
Passkeys are always 6 digits in length and should therefore be
zero-padded if necessary.

Jira: ZEP-2113

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-05-05 11:25:57 +03:00
Jukka Rissanen
dc0fc57917 net: samples: Common application init API
This creates a common API for network sample applications for
setting up IP addresses etc. The HTTP client application is modified
to use this API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-04 15:58:45 -04:00
Jukka Rissanen
70f334d9f2 http: client: Create a HTTP library
Instead of separate sample application that does everything
related to HTTP client connectivity, create a HTTP client library
that hides nasty details that are related to sending HTTP methods.
After this the sample HTTP client application is very simple and
only shows how to use the client HTTP API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-05-04 15:58:45 -04:00
Carles Cufi
689bd232f8 Bluetooth: Reshuffle Kconfig options
In order to achieve proper sharing of configuration options, everything
that is common to both the Host and the Controller should now be placed
in the top-level Kconfig file, and Controller-only options are in the
controller/ Kconfig one.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-04 11:27:04 +03:00
Erwan Gouriou
7991784297 samples: sensor: hts221
This commit provides sample application for sensor hts221.
By default, it is enabled on board disco_l475_iot1

Change-Id: I535fac8a670fa89cc1cae15ea1abe9cfe4b6c56b
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2017-05-03 13:51:37 -04:00
Justin Watson
558281b096 arch: sam3x: update Kconfig options after move to SAM SoC family tree
The files for the Arduino Due needed to be updated to use the new
configuration when the SoC moved from the atmel_sam3 directory to
the atmel_sam/sam3x directory.

Jira: ZEP-2067

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-05-03 13:51:37 -04:00
Carles Cufi
7a0588ac9f samples: bluetooth: Set DT baud rate for nRF5x boards
Since most of nRF5x-based boards can be used either as a standalone
development kit or as a BLE controller to connect to an external host,
add DT overlays so that the baud rate is correctly set to 1Mbit/s
whenever building the hci_uart sample application.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-05-03 08:43:17 -05:00
David B. Kinder
1d36cfba90 doc: change gerrit references to github
We're moving the project code to GitHub folks, so change references
in the documentation from gerrit over to GitHub:
https://github.com/zephyrproject-rtos/zephyr

Change-Id: Ic491a62ed43fc799eb5698e92435cb6eb4d89394
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-28 21:21:06 +00:00
Paul Sokolovsky
ddf23f3167 samples: net: dns_resolve: Clarify that DNS queries aren't immediate
The sample in its default configuration waits for DNS server
configuration via IPv4 or IPv6 specific means. Until this
information is receives, DNS querying won't even start. Make
diagnostic messages explicit of this fact, because if user
doesn't have required services available in the network, the
sample will appear to just hang.

Jira: ZEP-2061

Change-Id: I56a5b7354a2d1239a35d8334ed95a15ebd19254f
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:12 +03:00
Ravi kumar Veeramally
e4d8900cc6 net: samples: Use correct API to get net pkt length
net_pkt_get_len() is the correct API to get network packet
length.

Jira: ZEP-2076

Change-Id: Ifff6f3d5df28b3684cc8bb3758f9e8bccd5d4534
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-04-28 15:01:11 +03:00
Bogdan Davidoaia
efc3ba6b98 samples: net: ieee802154: add KW41Z config file
Add config file to be used for testing KW41Z's IEEE 802.15.4 driver.

Jira: ZEP-2026
Change-Id: I7042c57ad33ff72b35d24fbf28085b99b2301726
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-04-28 15:01:10 +03:00
Jukka Rissanen
f7d291ea90 samples/dns: Add config file for Arduino-101 and FRDM-K64F
The dns_resolve sample application did not had project file for
two boards that the README file is talking about, so adding them here.

Jira: ZEP-2040

Change-Id: I68e825854a171b09d56df91ab80ce5d9349733f6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-28 15:01:09 +03:00
Paul Sokolovsky
25307d5331 net: net_pkt_append: Refactor to return length of data actually added
For stream-based protocols (TCP), adding less data than requested
("short write") is generally not a problem - the rest of data can
be sent in the next packet. So, make net_pkt_append() return length
of written data instead of just bool flag, which makes it closer
to the behavior of POSIX send()/write() calls.

There're many users of older net_pkt_append() in the codebase
however, so net_pkt_append_all() convenience function is added which
keeps returning a boolean flag. All current users were converted to
this function, except for two:

samples/net/http_server/src/ssl_utils.c
samples/net/mbedtls_sslclient/src/tcp.c

Both are related to TLS and implement mbedTLS "tx callback", which
follows POSIX short-write semantics. Both cases also had a code to
workaround previous boolean-only behavior of net_pkt_append() - after
calling it, they measured length of the actual data added (but only
in case of successful return of net_pkt_append(), so that didn't
really help). So, these 2 cases are already improved.

Jira: ZEP-1984

Change-Id: Ibaf7c029b15e91b516d73dab3612eed190ee982b
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-28 15:01:09 +03:00
Piotr Mienkowski
f9a85815c2 samples: net: remove redundant Kconfig options for sam_e70_xplained
- Manual MAC address settings
- Default ETH driver initialization priority

Change-Id: I6294e2f66623087dfdc131344a94d0e9f2edc6b4
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-28 15:01:09 +03:00
Ramesh Thomas
c759ed1f94 samples: power: Time is passed as milliseconds in tickless kernel
In tickless kernel mode, time parameter of _sys_soc_suspend is in
milliseconds. Based on the kernel mode use the correct
mulitplier to convert to seconds.

Jira:1821
Change-Id: Idf156f56ece79a82729ebb124d1552a5eeb69e25
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-04-27 13:46:35 +00:00
Ramesh Thomas
700712f869 samples: tickless: Enables tickless kernel option in some apps
Adds changes to enable existing kernel and timer tests and samples to
be used to test the tickless kernel feature.

Updated samples/philosophers and tests/kernel/timer/timer_api apps

Run the tests using following commands
make pristine && make BOARD=<board> CONF_FILE=prj_tickless.conf qemu
Board could be any of the following
qemu_x86
quark_se_c1000_devboard

Jira: ZEP-339 ZEP-1812
Change-Id: I1530b19b79ddeb0e2181594caf15f3ac28ff51f4
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-04-27 13:46:33 +00:00
Tomasz Bursztyka
fcb4ea1383 samples/crypto: Use sys_log properly
Sys log already break a line after each line, by default, so removing
the '\n' on log messages.

Enabling support for sys log colors.

Change-Id: Ica3a601aba0bbbd2d9438b41fb7bca0aad9c05f4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:35 +00:00
Tomasz Bursztyka
50151db3c5 samples/crypto: Fix memory leaks
Don't return without freeing the session when relevant.

Change-Id: I9e5903791f8eb54026c4bb2ddda9f1fe9f3f7bb3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:35 +00:00
Tomasz Bursztyka
0b5946e4b7 drivers/crypto: Use a proper driver name for TinyCrypt shim driver
Change-Id: I526677c98fa70e46f92dbb4e4569707e1cb8469a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:29 +00:00
Kumar Gala
5899d750e8 samples: Cleanup uint types in SEGGER SystemView
Convert sample to using new u{8,16,32}_t types

Change-Id: I0f5d9ad6fecef59cd1552e48e0cf02173d631916
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-25 22:09:11 +00:00
Marc Moreno
3376c67691 samples: Add an MPU test suite
This patch contains a MPU test with a set of options to check
the correct MPU configuration against the following security
issues:
    * Read at an address that is reserved in the memory map.
    * Write into the boot Flash/ROM.
    * Run code located in SRAM.

The MPU test application uses the Zephyr shell.

Change-Id: Ib40dc76b082b800884fd636a1509a0712227d681
Signed-off-by: Marc Moreno <marc.morenoberengue@linaro.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2017-04-25 21:53:22 +00:00
Leandro Pereira
6ccfe5aa14 samples: Add SEGGER SystemView sample application
This sample application uses the kernel system logger already present
in Zephyr and publishes events through the SEGGER RTT protocol, so it's
available by the SEGGER SystemView application.

[1] https://www.segger.com/systemview.html?p=1731

Jira: ZEP-1463
Change-Id: If1eba4644b95175660b3040bdc4b2717b2cfc9ad
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-25 02:16:37 +00:00
Kumar Gala
e547533435 samples: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08c682bfc0b80dfa88de859e90a011bcd2db2762
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:53 -05:00
Kumar Gala
a509441210 net: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I4ec03eb2183d59ef86ea2c20d956e5d272656837
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:30:38 -05:00
Jukka Rissanen
da6eba463d Bluetooth: ipsp: Fix compile error in sample app
Some incompatible changes were introduced when net and bluetooth
branches were changed at the same time.

Change-Id: Ifa03f85d26a63ade0fcc029377d54850c0e92451
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-21 15:44:20 +03:00
Tomasz Bursztyka
e5896906f6 net: Rename all *_BUF() macros to *_HDR()
Most of these macros are not exactly exposing a buffer, but a specific
header pointer (ipv6, ivp4, ethernet and so on), so it relevant to
rename them accordingly.

Change-Id: I66e32f7c3f2bc75994befb28d823e24299a53f5c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:51 +03:00
Tomasz Bursztyka
db11fcd174 net/net_pkt: Fully separate struct net_pkt from struct net_buf
- net_pkt becomes a stand-alone structure with network packet meta
  information.
- network packet data is still managed through net_buf, mostly named
  'frag'.
- net_pkt memory management is done through k_mem_slab
- function got introduced or relevantly renamed to target eithe net_pkt
  or net_buf fragments.
- net_buf's sent_list ends up in net_pkt now, and thus helps to save
  memory when TCP is enabled.

Change-Id: Ibd5c17df4f75891dec79db723a4c9fc704eb843d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Tomasz Bursztyka
bf964cdd4c net: Renaming net nbuf API to net pkt API
There have been long lasting confusion between net_buf and net_nbuf.
While the first is actually a buffer, the second one is not. It's a
network buffer descriptor. More precisely it provides meta data about a
network packet, and holds the chain of buffer fragments made of net_buf.

Thus renaming net_nbuf to net_pkt and all names around it as well
(function, Kconfig option, ..).

Though net_pkt if the new name, it still inherit its logic from net_buf.
'
This patch is the first of a serie that will separate completely net_pkt
from net_buf.

Change-Id: Iecb32d2a0d8f4647692e5328e54b5c35454194cd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-21 14:19:50 +03:00
Kumar Gala
3c454017b4 Merge "Merge bluetooth branch into master" 2017-04-20 16:55:36 +00:00
Kumar Gala
789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Johan Hedberg
c52fa3c424 Merge bluetooth branch into master
- newlib related fixes for the AT parser
 - Channel Selection Algorithm #2 support (Bluetooth 5.0 feature)
 - Better tracking of outgoing data (with callback support)
 - Various smaller cleanups & fixes

----------------------------------------------------------------
Carles Cufi (3):
      Bluetooth: HCI: Add Bluetooth 5.0 LE commands and events
      Bluetooth: HCI: Naming consistency tweaks
      Bluetooth: Use event masks instead of bits in controller and host

Johan Hedberg (8):
      Bluetooth: hci_raw: Fix ECC support
      Bluetooth: Add support for tracking transmitted packets
      Bluetooth: ATT: Enforce flow for incoming requests & indications
      Bluetooth: SMP: Track when last key distribution PDU has been sent
      Bluetooth: Introduce a timeout for synchronous HCI command sending
      Bluetooth: ATT: Fix bogus CONTAINER_OF() usage
      Bluetooth: Introduce flow control for outgoing ATT packets
      Bluetooth: ATT: Start response timer only after actual transmission

Kumar Gala (3):
      Bluetooth: AT: use explicit unsigned char to avoid array subscript error
      Bluetooth: AT: Fix building with newlib
      Bluetooth: AT: Unit: Fixup include search path

Luiz Augusto von Dentz (4):
      Bluetooth: ipsp: Add TX pools for TCP
      Bluetooth: L2CAP: Try to allocate segment from the original pool
      net: buf: Add net_buf_reset
      Bluetooth: L2CAP: Reuse request buffer to respond

Vinayak Chettimada (5):
      Bluetooth: controller: Rename channel/chnl to chan
      Bluetooth: HCI: Add Bluetooth 5.0 FeatureSet field's bit mapping
      Bluetooth: Fix missing LE conn param req bit in set LE evt mask
      Bluetooth: controller: Support BT 5.0 feature set bit fields
      Bluetooth: controller: Channel Selection Algorithm #2

 include/bluetooth/hci.h                           | 495 +++++++++++++++--
 include/bluetooth/l2cap.h                         |   2 +-
 include/net/buf.h                                 |   9 +
 samples/bluetooth/ipsp/src/main.c                 |  15 +
 subsys/bluetooth/controller/Kconfig               |   7 +
 subsys/bluetooth/controller/hal/nrf5/radio.c      |   4 +-
 subsys/bluetooth/controller/hal/radio.h           |   2 +-
 subsys/bluetooth/controller/hci/hci.c             |  95 ++--
 subsys/bluetooth/controller/ll_sw/ctrl.c          | 622 ++++++++++++++++------
 subsys/bluetooth/controller/ll_sw/ctrl.h          |  71 ++-
 subsys/bluetooth/controller/ll_sw/ctrl_internal.h |  25 +-
 subsys/bluetooth/controller/ll_sw/ll.c            |  24 +-
 subsys/bluetooth/controller/ll_sw/pdu.h           |  12 +-
 subsys/bluetooth/host/Kconfig                     |  31 ++
 subsys/bluetooth/host/at.c                        |   2 +-
 subsys/bluetooth/host/at.h                        |   2 +-
 subsys/bluetooth/host/att.c                       | 230 ++++++--
 subsys/bluetooth/host/conn.c                      | 111 +++-
 subsys/bluetooth/host/conn_internal.h             |  23 +-
 subsys/bluetooth/host/hci_core.c                  | 163 +++---
 subsys/bluetooth/host/hci_core.h                  |   3 +-
 subsys/bluetooth/host/hci_ecc.c                   |   2 +-
 subsys/bluetooth/host/hci_raw.c                   |   4 +
 subsys/bluetooth/host/hfp_hf.c                    |   2 +
 subsys/bluetooth/host/l2cap.c                     |  79 ++-
 subsys/bluetooth/host/l2cap_internal.h            |  12 +-
 subsys/bluetooth/host/sdp.c                       |   2 +
 subsys/bluetooth/host/smp.c                       | 117 +++-
 subsys/net/buf.c                                  |  12 +-
 tests/bluetooth/init/prj_controller_4_0.conf      |   1 +
 tests/unit/bluetooth/at/src/Makefile              |   2 +-
 tests/unit/bluetooth/at/src/main.c                |   2 +-
 32 files changed, 1695 insertions(+), 488 deletions(-)

Change-Id: I17f9e49e1347a38bc78be3bdcaa596e41d83da56
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-20 18:45:15 +03:00
Anas Nashif
7c81d7f981 samples: remove lsm9ds0 sample code which does nothing
This sensor is supported already with many features, using it to test
SPI and I2C is an overkill. For both basic I2C and SPI samples we have
the FRAM samples supporting both IOs.

Change-Id: I794e584bd540d5fe6353fa3370aac0f1d6d105dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-20 10:31:07 +00:00
Luiz Augusto von Dentz
617842edde Bluetooth: ipsp: Add TX pools for TCP
TCP requires buffers to be acked thus it retain a reference, but L2
driver actually consumes the buffer so it needs a context pool to store
to original ones.

Change-Id: Ie9083ab361d3674c33080f9e7e6c7248aaf7abc3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-20 08:58:09 +03:00
David B. Kinder
30450fea2a spell: fix doxygen comment typos: /boards /samples
Fix doxygen comment typos used to generate API docs

Change-Id: I248d53000d8e57b902b9a18fdcfc9e995142a8b3
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-19 18:38:19 +00:00
Anas Nashif
45a7e5d076 kernel: remove legacy.h and MDEF support
Change-Id: I953797f6965354c5b599f4ad91d63901401d2632
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-19 10:59:35 -05:00
Johan Hedberg
191cb2d0fc samples/boards/microbit: Add sound sample
Add a sample demonstrating sound output using PWM to a piezo buzzer
connected to the external edge connector port P0.

Change-Id: I8c0902fd935f2eb3b9979476a7540e7a0216ca63
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-18 01:55:10 +00:00
Maureen Helm
1928632a97 samples: nfc_hello: Add CONFIG_SERIAL=y to project conf
Most boards enable a serial driver by default, but the hexiwear_kw40z
does not because it uses Segger RTT for the console. This sample
requires a serial driver, so add CONFIG_SERIAL=y to its project conf
file.

Jira: ZEP-1391
Change-Id: Iee813d1054378040fe9ff72a3ca1ea7bd66bcdfe
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-04-14 05:56:53 -05:00
Vinayak Chettimada
9584456fc9 drivers: pwm: Add nRF5x GPIOTE based PWM driver
Add support for nRF5x series GPIOTE based PWM driver
implementation.

Provides upto 3 pins/channels using one HF timer, two PPI
channels per pin, and one GPIOTE config per pin.

Change-id: I6056b199ec2cff595ba8fea9f659a0338ed4635b
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-04-14 01:53:07 +00:00
Anas Nashif
d3af7f75c9 Merge "Merge net branch into master" 2017-04-14 01:43:34 +00:00
Kumar Gala
c7bc909914 tests/ztest: rename assert macros to be zephyr specific
ztest has a number of assert style macros and used a baseline assert()
that varies from the system definition of assert() so lets rename
everything as zassert to be clear.

Change-Id: I7f176b3bae94d1045054d665be8b5bda947e5bb0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-13 21:17:33 +00:00
Tomasz Bursztyka
3a3636ff7f net/ieee802154/samples: Add a Kconfig option to tweak the TX power
This can be useful to override the default value, for testing.

Change-Id: I23b559152c71955ff5aa6fd3643f1f40f5594194
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-13 15:21:46 +03:00
Jukka Rissanen
611ccaaf88 net: dns: Remove dns_client API and sample application
DNS resolving is better done with DNS resolve API so remove
the DNS client API which is quite hard to use.

Change-Id: Ide4973a5be674414ea6e04a35c938195cce40b6a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Jukka Rissanen
abb24bb46b samples: net: irc-bot: Use DNS resolve API
Modify the code to use DNS resolve API instead of DNS client API
as the latter is being phased out.

Change-Id: I6a7618d770621fee1f502d2bc277a162c589108a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-04-13 15:21:45 +03:00
Wu Jiequan
432c750d36 net: coaps_server: add prj_arduino_101.conf file
In order to test the coaps_server sample app on
Arduino 101 board.

Change-Id: I7b393dac03a8020b7bd515c3b5b2fd961940bc21
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:44 +03:00
Wu Jiequan
c84eff0be4 samples: net: http_server: Add bt test and arduino 101 support
Added bt test code in the http_server sample app and in order
to test on Arduino 101 board, added prj_arduino_101.conf file.

Change-Id: Ie68a81ee809e8618f70b5fab6fdbd66692401014
Signed-off-by: Wu Jiequan <jiequanx.wu@intel.com>
2017-04-13 15:21:43 +03:00
Anas Nashif
259949d10e samples: console: fixed filter and add CONFIG_
The filter expects CONFIG_, otherwise it is noop

Change-Id: I2b0a02b6450287a090b69a12324fe7f7cf494999
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-11 03:14:26 +00:00
Anas Nashif
dac15b9b71 samples: shell: fix testcase.ini to be more inclusive
Filter was wrong and sample was not being built on any boards. Exclude
platforms that do not support interrupt based UART drivers.

Jira: ZEP-2014
Change-Id: I84a690e7c93fae52335434830b83086019cfd00d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-11 03:14:25 +00:00
Anas Nashif
c6f4476bf6 sensors: bmg160: fixed wrong Kconfig variable
Change-Id: I3e24420519535310728b3395c3c71a5fb3560f35
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-11 03:14:23 +00:00
Anas Nashif
d7bc60f096 kernel: remove remaining microkernel references
Change-Id: Ie648dbaaf714316c21395bd43e555618013dbd19
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 20:21:05 +00:00
Anas Nashif
3781ed061b samples: usb: remove custom DBG macro and use sys_log
Change-Id: Icc83afe0c48ada9454104f0d1a7487027b1566b3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 16:08:01 +00:00
Sathish Narasimman
1f5a809178 Bluetooth: HFP HF: Add support for RING indication cb
This patch adds support for incoming RING indication callback to
notify application.

> ACL Data RX: Handle 256 flags 0x02 dlen 16   [hci0] 167174.600312
      Channel: 65 len 12 [PSM 3 mode 0] {chan 1}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0xef poll/final 0
         Length: 8
         FCS: 0x9a
        0d 0a 52 49 4e 47 0d 0a 9a                       ..RING...

Change-Id: I0469590a77d619f2a842df647d84f4d56dbd4883
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-04-08 20:11:54 +03:00
Luiz Augusto von Dentz
4d1115ab35 net: Enable context buffer pool in case TCP and 6LO are enabled
The context buffer pool was introduced to deal with TCP holding buffers
when 6LO may modify them, therefore it makes sense to have it enabled
by default when TCP and 6LO are enabled given that the code can deal
with NULL pool in case the application don't implement one.

Change-Id: I600ca31ab40c96ee27937c2e885e332b0cee4995
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-04-07 18:32:18 +03:00
Piotr Mienkowski
afdb0e0a70 drivers: eth_sam_gmac: Fix initialization order
Atmel SAM family GMAC Ethernet driver is implementing zero-copy
networking. As a result it has to reserve a defined amount of RX
data net buffers before bringing up the interface. Since net buffer
pool is initialized by the network stack and this driver was bringing
the interface up in its initialization function the driver initialization
was performed, as a workaround, after network stack initialization. It
is not a clean solution. This patch fixes this by bringing the
interface up in interface initialization function. The driver itself
can now be initialized before the network stack is.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I65886fd6db6f27a10628e393cfabd8e5f78c08ff
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-04-07 12:35:51 +03:00
Maureen Helm
0ab8874fde samples: Add max30101 sample application
Adds a max30101 sample application that polls sensor data and prints it
to the console.

Jira: ZEP-720
Change-Id: I50f28eaf9ea2ff5bfbb9fb6922c4006d5c02e739
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-04-06 11:47:18 +00:00
Johan Hedberg
d7a189d2ec drivers: display: mb_display: Unify image and string APIs
Both the string and image rendering may want to take advantage of
scrolling and sequential display capabilities. Consolidate the APIs so
that there's a single one for images (mb_display_image) and a single
one for strings (mb_display_print). Both take a duration parameter for
the per-frame duration as well as a mode parameter which specifies
sequential vs scrolling behavior as well as an optional looping flag.

Change-Id: Ia092d771e3f1b94afd494c7544dab988161c539e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-06 00:59:30 +00:00
Leandro Pereira
bb4a2eef7f samples: net/nats: Fix parsing of MSG messages
This addresses the issues found by QA in ZEP-1012 and clarify the
documentated behavior as described in ZEP-1859.

Change-Id: I602e5749db7f6f44cf5be449b8e6f0d2ba66b69b
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-04-05 18:24:45 +00:00
David B. Kinder
1a9600b704 doc: add labels to sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: Ie5ff404ac23621dbcf6ca61734ed6f72832c1ce2
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 20:48:08 +00:00
David B. Kinder
0f77021ba7 doc: add labels to board-specific sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: Ib2d9b1cc4144bd84b1b89691a80dffd99212289d
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 20:47:53 +00:00
David B. Kinder
6a7527b5b4 doc: add labels to sensor sample docs for linking
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I37c654fb0bb7ebdf288af01e41ce5497969f8968
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 20:47:35 +00:00
David B. Kinder
7bc4890202 doc: add labels to net sample docs for linking
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I46cd75d714449de806a85dde08756c8e190488dc
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:52:06 +00:00
David B. Kinder
b78ffc0e6b doc: add labels to basic sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: I57d65a8888f78aa61d776f607a5db86bdb35726c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:51:47 +00:00
David B. Kinder
2bfff175ab doc: add labels to bluetooth sample docs
Docs need a label at the top so we can use :ref:`labelname`
to create a link to that doc from other docs.

Change-Id: Ide66f75ca8fac0d5f65fbfc50dc9d130cf45b392
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:51:27 +00:00
Anas Nashif
fb5e9b9283 samples: console: filter boards without console
Change-Id: Ifdf0da9295d54cd1e95386297eff2e5ef3d45858
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-04 19:18:15 +00:00
David B. Kinder
2a05cc1b54 doc: add labels to sample docs for linking
Docs need a label at the top so we can use :ref:`labelname` to
create a link to that doc from other docs.

Change-Id: I7d7b98f3a9d22350ca983b3558bf83f77fd6e379
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-04 19:09:30 +00:00
Johan Hedberg
7e5df0cc02 drivers: display: Enhance BBC micro:bit string output capabilities
Add a new mb_display_print() API which takes printf-style parameters
and outputs scrolling text instead of one character at a time. The
existing mb_display_str() API is renamed to mb_display_string() for
consistency, and now also takes printf-style parameters.

Change-Id: I59c42bcd74c62f05ecb6d097dc808b9e5c1984c5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-04 13:54:00 +03:00
Johan Hedberg
380d24de1d drivers: Add support for BBC micro:bit LED display
Adds a simple driver to access the 5x5 LED display found on BBC
micro:bit boards. The display is so limited that no effort is done to
try to integrate with the existing console (which would likely make
the display unusable). Instead, dedicated mb_display_* APIs are added
that are specific to this display.

References:

 https://www.microbit.co.uk/device/screen
 https://lancaster-university.github.io/microbit-docs/ubit/display/

Jira: ZEP-1990
Change-Id: I431b5b358b5f07592a60d3aed87eaab6ac20ce25
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-04-04 08:14:36 +03:00
Anas Nashif
341d926a04 doc: reduce levels in toc
The level was increased to 3 by mistake.

Change-Id: Ie62e1d1f49a6708c75e2947247279a095082d94e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-03 22:57:40 +00:00
Anas Nashif
7d5be2af73 Merge "Merge net branch into master" 2017-04-01 20:46:11 +00:00
Paul Sokolovsky
542c2b93d0 subsys: console: Add pull-style console API support.
This change introduces console_getchar() and console_getline() API
calls which can be used to get pending console input (either one
char or whole line), or block waiting for one. In this regard, they
are similar to well-known ANSI C function getchar/gets/fgets, and
are intended to ease porting of existing applications to Zephyr, and
indeed, these functions (shaped as an external module) are already
used by few applications.

The implementation of the functions is structured as a new "console"
subsystem. The intention is that further generic console code may be
pulled there instead of being in drivers/console/. Besides the
functions themselves, initialization code and sample applications
are included.

At this time, there're may limitations of how these functions can
be used. For example, console_getchar() and console_getline() are
mutually exclusive, and both are incompatible with callback
(push-style) console API (and e.g. with console shell subsystem
which uses this API). Again, the intention is to make a first step
towards refactoring console subsystem to allow more flexible
real-world usage, better reusability and composability.

Change-Id: I3f4015bb5b26e0656f82f428b11ba30e980d25a0
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-04-01 20:44:17 +00:00
Tomasz Bursztyka
e027645c88 net/samples/ieee802154: Making hw sample simpler
- Let's use samples settings
- Enable both net and 15.4 shell modules
- Change prj_*.conf accordingly

Change-Id: If7e32a42c8dc7026d0580b1e94e819e1eda82e5b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:28 +02:00
Tomasz Bursztyka
d2f8a5a27f net/samples: Add 802.15.4 link-layer security settings for the samples
And use them accordingly in the common code part.

Change-Id: Id91b76e5baea607c0d68eebcde6f84e4e35ca44c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka
7b8af87fdf samples/net: Remove the need for IEEE 802.15.4 stack in wpan serial
It can uses CONFIG_NET_APP_IEEE802154_* options instead.

Change-Id: I2501ca2015cfc1e68c6c384cb32c21084d2cb30d
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka
26a4df620f samples/net: Uses CONFIG_NET_APP_IEEE802154_* options relevantly
In order to simplify when 802.15.4 is selected on these samples, let's
setup the device through a common code.

For this to work, RFD is now the default.

Change-Id: I46590864442f77d83f681cc0e854c94344648856
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:27 +02:00
Tomasz Bursztyka
0f18ce44f9 net: Rename Kconfig.samples and its main option for future changes
s/SAMPLES/APP for name shortening. Applying the change where relevant.

Not only IP addresse will be available as samples settings there but
also IEEE 802.15.4 channel, pan_id, and more for instance.

Change-Id: I05dd24989bd0c804d9588092d67044a3e063bc88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-31 11:24:26 +02:00
Maureen Helm
e09dc931bf samples: fxos8700: Update doc references and sample output
Updates the fxos8700 sample documentation to include board
cross-references and sample output with temperature data.

Change-Id: I8d4e4d8d287806f5480316da09d4072fcf9c05ac
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-30 21:21:22 +00:00
Maureen Helm
07241cafce samples: Add fxas21002 sample application
Adds a fxas21002 sample application that uses the sensor data ready
trigger to periodically print gyroscope data.

Jira: ZEP-1392
Change-Id: Ic9d3803a41f2873aef470a2a73b3f1db44d39b50
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-30 21:19:54 +00:00
Anas Nashif
8c1a073bb1 samples: ipm sample using mailbox for Quark SE
re-add sample that was dropped by mistake and add a top level Makefile
for building and flashing two cores.

Change-Id: Ie22ac1efa7b5373999997489a2c866de19553128
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 15:53:28 -04:00
Anas Nashif
131cfa2043 samples: move ipm samples subsystem folder
Change-Id: I5737e037111f2a5eff5f824bcb72e963b1af22e5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:35 +00:00
Anas Nashif
eaffffd963 samples: move usb samples subsystem folder
Change-Id: Id1696bf18dc77a0afb1180f417b2bb641ad809ab
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:34 +00:00
Anas Nashif
52448f6a2b samples: move shell sample subsystem folder
Change-Id: I9729885ec2c6ceb0367323ed9b1f72f05517b2aa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:33 +00:00
Anas Nashif
da4ccce59e samples: move logger-hook sample to subsystem
Change-Id: I693ce41046bddcef21e3f634d602683f1512f927
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:33 +00:00
Anas Nashif
fdd0cb70ed samples: remove legacy applications
Change-Id: I790d66f2ab14b40dd6c6fe25c59ccd97850602e7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-29 19:35:32 +00:00
Anas Nashif
f475d2cde9 samples: grove: remove duplicate config
Duplicate Kconfig variable in prj.conf causes warning

Jira: ZEP-1880
Change-Id: I941b36a17c550d7e64759ea3266da6957ec3e82c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-26 02:10:24 +00:00
Anas Nashif
2c04055970 Merge "Merge bluetooth branch into master" 2017-03-25 11:25:43 +00:00
Johan Hedberg
93fbca0d16 Merge bluetooth branch into master
- Controller cleanups
 - Refactor controller for a cleaner Link Layer abstraction
 - SDP enhancements
 - Use sys_slist_t API wherever possible
 - Fix race condition in controller
 - Update controller to report Bluetooth 5.0 version

----------------------------------------------------------------
Carles Cufi (6):
      Bluetooth: controller: Remove unused H:4 tag macros
      Bluetooth: controller: Rename downstream API calls
      Bluetooth: controller: Introduce BLUETOOTH_LL_SW
      Bluetooth: controller: Move ll.h to an include folder
      Bluetooth: controller: Remove public address config option
      Bluetooth: controller: Move LL code from driver to ll_sw

Johan Hedberg (11):
      Bluetooth: Make bt_hci_driver instances link-time constants
      Bluetooth: shell: Fix missing initialization of param.own_addr
      Bluetooth: shell: Add command to start continuous passive scanning
      Bluetooth: Move crypto APIs to dedicated header file
      Bluetooth: Controller: Factor out ECB core code from ecb_encrypt()
      Bluetooth: Controller: Introduce big-endian variant for ECB
      Bluetooth: Introduce public big-endian AES API
      Bluetooth: Controller: Increase default TX buffer count
      Bluetooth: Use specific pointer type for conn->channels
      Bluetooth: ATT: Reorder handler struct for compactness
      Bluetooth: ATT: Refactor PDU handling

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Send service search response
      Bluetooth: SDP: Server: Handle ServiceAttributeRequest
      Bluetooth: SDP: Server: Find the attributes in the record
      Bluetooth: SDP: Server: Send ServiceAttributeResponse
      Bluetooth: SDP: Server: Support ServiceSearchAttributeRequest

Luiz Augusto von Dentz (4):
      Bluetooth: ipsp: Fix checking for NULL pointer
      Bluetooth: L2CAP: Use sys_slist_t for connection channels
      Bluetooth: L2CAP: Use sys_slist_t for server channels
      Bluetooth: L2CAP: Use sys_slist_t for fixed channels

Mariusz Skamra (2):
      Bluetooth: L2CAP: Fix TX queueing for LE CoC
      Bluetooth: tester: Fix UART issue on qemu

Matthias Ringwald (1):
      Bluetooth: Controller: Kconfig company id and subversion number

Sathish Narasimman (5):
      Bluetooth: HFP HF: SCO: Handle synchronous_conn_complete
      Bluetooth: SCO: Rename 'conn' to 'acl'
      Bluetooth: HFP HF: SCO: Handle SCO Disconnect
      Bluetooth: HFP HF: SCO Initiate Audio connection
      Bluetooth: AT: Fix reset the state during error

Vinayak Chettimada (16):
      Bluetooth: Controller: Fix RSSI feature conditional compilation
      Bluetooth: Controller: Add advertisement event indication feature
      Bluetooth: Controller: Add Kconfig range check for public address
      Bluetooth: Controller: Version 5.0 and PDU type rename
      Bluetooth: controller: Use explicit paths to internal headers
      Bluetooth: controller: Move bt_rand into separate file
      Bluetooth: Make LE Encrypt helpers public
      Bluetooth: controller: Replace 0 for pointers with NULL keyword
      Bluetooth: Fix checks for changes in connection parameters
      Bluetooth: Support connection parameter update as central
      Bluetooth: shell: Reorder commands in logical order of use
      Bluetooth: shell: Add connection update command
      Bluetooth: controller: Move PDU macros from radio.h to pdu.h
      Bluetooth: controller: Cleanup makefiles
      Bluetooth: controller: Fix mayfly caller id for thread call path
      Bluetooth: controller: Fix race waiting for ticker job to complt

 drivers/bluetooth/hci/h4.c                         |   2 +-
 drivers/bluetooth/hci/h5.c                         |   2 +-
 drivers/bluetooth/hci/spi.c                        |   2 +-
 include/bluetooth/bluetooth.h                      |  15 +-
 include/bluetooth/conn.h                           |  11 +
 include/bluetooth/crypto.h                         |  77 ++
 include/bluetooth/hci.h                            |  24 +
 include/bluetooth/l2cap.h                          |   4 +-
 include/drivers/bluetooth/hci_driver.h             |   2 +-
 samples/bluetooth/ipsp/src/main.c                  |   6 +-
 subsys/bluetooth/Kconfig                           |   2 +-
 subsys/bluetooth/controller/Kconfig                |  39 +-
 subsys/bluetooth/controller/Makefile               |  23 +-
 subsys/bluetooth/controller/hal/Makefile           |   1 +
 subsys/bluetooth/controller/hal/ecb.h              |   3 +
 subsys/bluetooth/controller/hal/nrf5/Makefile      |   3 +
 subsys/bluetooth/controller/hal/nrf5/cntr.c        |   4 +-
 subsys/bluetooth/controller/hal/nrf5/ecb.c         |  64 +-
 subsys/bluetooth/controller/hal/nrf5/radio.c       |  17 +-
 subsys/bluetooth/controller/hal/nrf5/rand.c        |   4 +-
 subsys/bluetooth/controller/hal/radio.h            |   5 -
 subsys/bluetooth/controller/hci/Makefile           |   4 +
 subsys/bluetooth/controller/hci/hci.c              |  76 +-
 subsys/bluetooth/controller/hci/hci_driver.c       | 217 +-----
 subsys/bluetooth/controller/include/ll.h           |  58 ++
 subsys/bluetooth/controller/ll/ll.h                |  29 -
 subsys/bluetooth/controller/ll_sw/Makefile         |   4 +
 subsys/bluetooth/controller/ll_sw/crypto.c         |  54 ++
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c   | 660 +++++++++--------
 subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h   |  54 +-
 .../controller/{ll => ll_sw}/ctrl_internal.h       |   6 +-
 subsys/bluetooth/controller/{ll => ll_sw}/ll.c     | 237 ++++++-
 subsys/bluetooth/controller/{ll => ll_sw}/pdu.h    |  64 +-
 subsys/bluetooth/controller/ticker/Makefile        |   3 +
 subsys/bluetooth/controller/ticker/ticker.c        |  12 +-
 subsys/bluetooth/controller/util/Makefile          |   1 +
 subsys/bluetooth/controller/util/memq.c            |   5 +-
 subsys/bluetooth/host/Kconfig                      |  16 +-
 subsys/bluetooth/host/Makefile                     |   2 +
 subsys/bluetooth/host/at.c                         |   7 +-
 subsys/bluetooth/host/att.c                        | 204 ++++--
 subsys/bluetooth/host/conn.c                       | 148 +++-
 subsys/bluetooth/host/conn_internal.h              |  12 +-
 subsys/bluetooth/host/crypto.c                     | 155 ++++
 subsys/bluetooth/host/crypto.h                     |   8 +
 subsys/bluetooth/host/hci_core.c                   | 150 ++--
 subsys/bluetooth/host/hci_core.h                   |   2 +-
 subsys/bluetooth/host/hci_ecc.c                    |   9 +-
 subsys/bluetooth/host/hci_ecc.h                    |   5 +-
 subsys/bluetooth/host/hci_raw.c                    |   8 +-
 subsys/bluetooth/host/hci_raw_internal.h           |   2 +-
 subsys/bluetooth/host/l2cap.c                      | 202 ++----
 subsys/bluetooth/host/l2cap_br.c                   |  97 +--
 subsys/bluetooth/host/l2cap_internal.h             |   5 +-
 subsys/bluetooth/host/sdp.c                        | 781 +++++++++++++++++++++
 subsys/bluetooth/host/sdp_internal.h               |  14 +
 subsys/bluetooth/host/smp.c                        |  36 +-
 tests/bluetooth/init/prj_controller_4_0.conf       |   1 +
 tests/bluetooth/init/prj_controller_dbg.conf       |   1 +
 tests/bluetooth/shell/src/main.c                   | 137 +++-
 tests/bluetooth/test_bluetooth/src/bluetooth.c     |   2 +-
 tests/bluetooth/tester/qemu.conf                   |   1 +
 62 files changed, 2583 insertions(+), 1216 deletions(-)
 create mode 100644 include/bluetooth/crypto.h
 create mode 100644 subsys/bluetooth/controller/hal/Makefile
 create mode 100644 subsys/bluetooth/controller/hal/nrf5/Makefile
 create mode 100644 subsys/bluetooth/controller/hci/Makefile
 create mode 100644 subsys/bluetooth/controller/include/ll.h
 delete mode 100644 subsys/bluetooth/controller/ll/ll.h
 create mode 100644 subsys/bluetooth/controller/ll_sw/Makefile
 create mode 100644 subsys/bluetooth/controller/ll_sw/crypto.c
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.c (93%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl.h (84%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ctrl_internal.h (98%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/ll.c (58%)
 rename subsys/bluetooth/controller/{ll => ll_sw}/pdu.h (77%)
 create mode 100644 subsys/bluetooth/controller/ticker/Makefile
 create mode 100644 subsys/bluetooth/controller/util/Makefile
 create mode 100644 subsys/bluetooth/host/crypto.c
 create mode 100644 subsys/bluetooth/host/crypto.h

Change-Id: Ic8bee0eb4f15c00ce5ca7b3b80133b1bbd0bdbf5
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-24 23:21:09 -07:00
Jukka Rissanen
c6cad93d8c samples: net: DNS resolving sample application
Change-Id: I4a0283efde4d0dd8ccd0933071acb277431d4a32
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka
3b0769889b net/samples: Add static ipv4 addresses for arduino 101 echo apps config
Jira: ZEP-1444

Change-Id: I689ae6b4b5316e36cdacdf20acbf6e335a10c9e5
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-24 17:31:42 +02:00
Tomasz Bursztyka
d7145b3556 drivers/ieee802154: Remove very old CC2520 left-over from µIP stack
Change-Id: Ief7ef008905e81cedcfc1b7ea2f21702cb68a4ce
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-03-24 17:31:41 +02:00
Jukka Rissanen
4fcf04dde8 samples: net: Remove multicast address setting in echo-client
The echo-server no longer uses multicast addresses itself,
so the multicast address setting can be removed from echo-client.

Change-Id: Ieab069849ced8a850ada6e6618d625695819be8e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:41 +02:00
Jukka Rissanen
35352130b5 samples: net: Remove multicast address setting in echo-server
The multicast address setting in echo-server was not really
used for anything so removing it from the app.

Change-Id: I8069c670388702fc46ae2f31506c982caa28212d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-24 17:31:41 +02:00
Andrei Emeltchenko
2801389a14 wpanusb: Fix using incorrect nbuf in fragment_get()
Fixes using buf instead of pkt.

Change-Id: I21fd84b68a3967bfc701887f01a7b403d04a4504
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Andrei Emeltchenko
0d168bff77 drivers: cc2520: Correct configuration options
At the moment CC2520 configuration options are selected inside "TI
CC2520 Driver RAW channe" submenu like:

           [*] TI CC2520 Driver support  ----

           [ ] TI CC2520 Driver RAW channel  --->

Make RAW channel depends on TI CC2520.

Change-Id: I92879b7f4391f1842c012b6c03c78956e90b9441
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Andrei Emeltchenko
33c2480c09 wpan_serial: Correct system logging domain
Correct logging domain to wpan_serial.

Change-Id: Ic5e99d2fc31ba68c7b211acbf372ee26ab93a62f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-24 17:31:40 +02:00
Inaky Perez-Gonzalez
933366631c samples/net/echo_client: add SAM e70 and FRDM k64f ethernet configurations
These are copied verbatim from the echo_server sample.

Change-Id: I56d1386144967177f889e12d4a173bfb6628f18b
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-03-24 17:31:40 +02:00
Maureen Helm
153017834a samples: fxos8700: Add support for temperature
Enables the temperature sensor in the fxos8700 sample.

Change-Id: I2b4c306d3c5528dc32d940476c00180b5df08187
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:49 -05:00
Maureen Helm
9b715d9128 samples: fxos8700: Switch to generic SYS_LOG_SENSOR_LEVEL
The fxos8700 driver was previously converted to use the generic
SYS_LOG_SENSOR_LEVEL. Update the fxos8700 sample to use it too.

Change-Id: I2ef02342ce3a25e8d3a3d1b13181872ca0abdc16
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-23 09:41:49 -05:00
Luiz Augusto von Dentz
4fb0724a55 Bluetooth: ipsp: Fix checking for NULL pointer
This may cause static analyser error such as the following:

  Null-checking "tmp" suggests that it may be null, but it has already
  been dereferenced on all paths leading to the check.
             if (tmp) {

Change-Id: Id04f8d052d8128003d5b91f7a8303940529ef261
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-03-21 17:05:42 -07:00
Anas Nashif
3dc9af66ca sensors: BME280: added support for SPI communication
Support connection via SPI and keep I2C as the default.

Jira: ZEP-1698
Change-Id: I42a76131577a37429375364deb07e451107f5d81
Signed-off-by: Dario Pennisi <dario@iptronix.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-03-21 10:39:27 +01:00
Inaky Perez-Gonzalez
c9cff15a8a samples/shell: print the actual params passed
The params command is not printing the arguments, which makes this not
so useful to verify how things work, so added it to the sample.

Change-Id: I2d71ee064f12c7353ba83144824ae46803e2ad39
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2017-03-20 21:48:54 +00:00
Jukka Rissanen
3a1a4d3105 samples: net: coaps_client: Fix the parameters when setting callbacks
The RX callback and timeout parameters were reversed in call to
mbedtls_ssl_set_bio().

Change-Id: I285694e57a024ac3ce735e496daad690f94737ac
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:45 +02:00
Michael Scott
081246737c net/http: let HTTP_SERVER, HTTP_CLIENT and HTTP_PARSER select HTTP
Due to commit 8308b9bd2d ("net/http: Add the HTTP/1.1 API")
every user of CONFIG_HTTP_PARSER would need to add CONFIG_HTTP to
their .conf files.  Which is fine for intree samples/tests as they
have been adjusted, but the rest of world working on Zephyr apps
will need to make this changes as well.

Instead, we should have each of the following select HTTP instead of
depend on it, which will make future use of these configs and their
dependencies more intuitive:
HTTP_SERVER
HTTP_CLIENT
HTTP_PARSER

NOTE: As cleanup, this commit also removes the CONFIG_HTTP added to
samples and test .conf files.

Change-Id: I81cfaa19e37333b1bf98778f8147814780e7f77c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-03-17 10:34:45 +02:00
Piotr Mienkowski
c54b3c7e8f drivers: Update Atmel SAM family GMAC Ethernet driver
Networking stack has split one global DATA pool to RX and TX DATA pools
and also added net_buf pool support to each context. Update the driver
to support this new design. Since the GMAC TX descriptor list has a fixed
size but the number of TX DATA buffers is no longer limited updating the
TX descriptor list has to be guarded by a semaphore.

Tested on Atmel SMART SAM E70 Xplained board

Change-Id: I181e1cdd183e173b85d5d1711b6e78cd5165666d
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-03-17 10:34:44 +02:00
Ravi kumar Veeramally
bd1f30a3b9 net: samples: leds_demo: Fix memory leak
Unref the buffer if net_contect_send_to() fails to send.

Change-Id: I182125e64aabd171cd86f42fd9e1de036dd68544
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-03-17 10:34:42 +02:00
Jukka Rissanen
fdccd1caf9 samples: net: zperf: Fix compiler warnings
LLVM/icx compiler gives some warnings for signed vs unsigned
pointers.

Jira: ZEP-1884

Change-Id: Ide57be898ebd1bff49c8a27aac392fa58dcae726
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-17 10:34:41 +02:00
Flavio Santes
876e341570 samples/net/http: Add the HTTP Basic Authentication routine
This patch adds the HTTP Basic Authentication routine "http_auth".
Authentication parameters are defined in the config.h file.

The README file is also updated by this patch.

Jira: ZEP-1543

Change-Id: I2d531966290e87a68c54fc1ac834491ac937df22
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:40 +02:00
Flavio Santes
e1b46bfe29 samples/http: Match header field ctr with Kconfig variable
Set a local define with the value previously defined at the Kconfig
file.

Change-Id: I3ee424c4a1102ca00c0059cb9d0a86498806486f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-17 10:34:39 +02:00
Sergio Rodriguez
ff5178fd22 samples: mbedTLS coap: Cleaning prj.conf for QEMU
Removing unneeded configuration

Change-Id: I72e3714358366de715cb6f47d690a1b0e8f032f5
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-17 10:34:39 +02:00
Sergio Rodriguez
1b48f9fbc3 samples: mbedtls coap: Fixing entropy source
Using a more efficent entropy call and proper output data

Jira: ZEP-1878

Change-Id: Ife738b84c1e56d58784b4fbc61ec0843579c4453
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-17 10:34:39 +02:00
Juan Manuel Cruz Alcaraz
172c031ec9 sample: net: mbedtls ssl: SSL client sample is adapted to TCP API
Jira: ZEP-1798

Change-Id: I790cd49cb7cc5ed207141ca6634999d77d6a19bb
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
695cfff535 samples: net: dtls_client: Fix memory leak in RX path
If we have not yet handled the previous RX buf, then we need
to drop the latest received one, otherwise the earlier net_buf
is leaked.

Change-Id: I1b69e07e8b3a3b87c76d923c847dc8316c128e76
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
3a2bd9a162 samples: net: dtls_client: Fix mem leak in error path
We need to unref the net_buf in error path in RX and TX.

Change-Id: Icb6d43cb6b7411a5135ea09c6ae96742566fafc4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
dc8a019823 samples: net: dtls_client: RX buf count too low
The mbedtls_dtlsclient needs more RX buffers.

Jira: ZEP-1855

Change-Id: I80732c511dfade8fa9139e3bd26e21de73a68acd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Jukka Rissanen
b1aadd0b3a samples: net: http_server: Disable mbedtls
Sanitycheck cannot link the result qemu binary because it is too
large. As a workaround, disable mbedtls to get the linking pass.

.../real-ld: zephyr.elf section `noinit' will not fit in region `RAM'
.../real-ld: region `RAM' overflowed by 192 bytes
collect2: error: ld returned 1 exit status

Change-Id: I543571505ab9412db7eac101848c6032d1550d79
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:50 +02:00
Juan Manuel Cruz Alcaraz
6828412f27 samples: dtls client: DTLS client sample configuration file
The configuration file for Arduino 101 for the DTLS client
sample needs to define IPv4 and IPv6 addresses.

Jira: ZEP-1169

Change-Id: Iabfd5f067d39faaf8796aac84642b630b11ef7f6
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
87bc931826 samples/net: Add the HTTP API to the HTTP client sample application
This patch replaces some routines found at the HTTP client sample
application by the ones defined at the HTTP API.

Jira: ZEP-1824

Change-Id: Id19e3e346c09716ac95b0c488ff6e6949a5fbabe
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
848966be43 samples/net: Add the HTTP API to the HTTP server sample application
This patch removes some routines from the HTTP server sample
application and replaces them by the ones defined at the HTTP API.

Jira: ZEP-1824

Change-Id: Ia5db424d62997e01896294e12224aa65a58db432
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:50 +02:00
Flavio Santes
8308b9bd2d net/http: Add the HTTP/1.1 API
This patch adds the HTTP/1.1 API for Zephyr. This API consists of client
and server context structures enabled via Kconfig variables.
HTTP parser support is enabled via the CONFIG_HTTP_PARSER configuration
variable.

Currently, this API only includes support for writing HTTP requests
(client mode) and HTTP responses (server mode). TLS support is not
considered in this iteration.

Supported HTTP methods:
	GET, HEAD, OPTIONS and POST.

Supported HTTP responses:
	400, 403 404. The http_response routine may be used to write
	any HTTP status code, for example 200 OK.

Jira: ZEP-1701

Change-Id: Ic9ccd4d4578d6d0f3a439976ea332b031644ca7d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
e29202593d samples/net: Add the QEMU x86 prj file to the HTTP client sample app
Add the QEMU x86 project configuration file to the HTTP client sample app.

Change-Id: Ice6ae3f3559680e1d182506671984fd5f946f1d8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
f6d40023b4 samples/net: Fix format warning in the HTTP client sample app
Fix a printk format warning found at the HTTP client sample app.

Change-Id: I9665e3e59595b383d6e809af51fe4cf3cd8f8bd8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Flavio Santes
a561f5e1c7 samples/net/http_client: Cast size_t to int to avoid compiler warnings
Cast size_t to int in the http_client_cb code.

Change-Id: I36133da953669ec133421b5e7fb21bec9807fd06
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:49 +02:00
Marcus Shawcroft
7e6656eb9e samples: net: echo-server: Fix conditional around net_if_ipv4_addr_add()
The invocation of net_if_ipv4_addr_add() should be included within the
conditional code that sets up the address added.

Change-Id: I9b4e76a6b4922b3455bc6b383431b4124d40a49e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-03-09 20:33:47 +02:00
Vinicius Costa Gomes
43ae27fd9b samples/coaps_server: Don't error if the packet doesn't have payload
GET and DEL requests may not have payloads, so it's not correct to
return with an error in those cases.

This was only noticed now that zoap_packet_get_payload() returns the
correct value for all situations.

Jira: ZEP-1754

Change-Id: Ie533041aa7a66855582ff4c5c937d943304bad84
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-03-09 20:33:47 +02:00
Luiz Augusto von Dentz
4db2c941be net: samples: Enable CONFIG_NET_CONTEXT_NBUF_POOL in prj_bt.conf
Bluetooth consumes buffer when transmitting them therefore any protocol
that need to retain them, like TCP, needs to have its own pool to copy
the buffers as they may need to be resent in case they are not acked.

Change-Id: I483c5a3eb4d54fae6b5b2902c69b67e8c2e0be5e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-03-09 20:33:46 +02:00
Leandro Pereira
141c0a5f1a samples: net: NATS protocol sample
NATS is a publisher/subscriber protocol implemented on top of TCP. It
is specified in [1], and this is a sample implementation for Zephyr
using the new IP stack.  The API is loosely based off of [2].

With this sample, it's possible to subscribe/unsubscribe to a given
subject, and be notified of changes asynchronously.  In order to
conserve resources, the implementation does not keep its own track of
subscribed subjects; that must be performed by the application itself,
so it ignore unknown/undesired subjects.

TLS is not supported yet, although basic auth is.  The client will
indicate if it supports username/password if a certain callback is set
in the struct nats.  This callback will then be called, and the user
must copy the username/password to the supplied user/pass buffers.

Content might be also published for a given subject.

The sample application lets one observe the subject "led0", and turn it
"on", "off", or "toggle" its value.  Changing the value will, if
supported, act on a status LED on the development board.  The new
status will be published.

Also worth noting is that most of the networking and GPIO boilerplate
has been shamelessly copied from the IRC bot example.  (Curiously, both
protocols are similar.)

[1] http://nats.io/documentation/internals/nats-protocol/
[2] https://github.com/nats-io/go-nats

Jira: ZEP-1012

Change-Id: I204adc61c4c533661eacfb8c28c1c08870debd91
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-03-09 20:33:45 +02:00
Flavio Santes
760c1f1214 samples/net: Fix error handling issues in IRC bot
Fix the following error:

Calling "transmit(irc->conn, pong, ret)" without checking return value.
It wraps a library function that may fail and return an error code.

Coverity-CID: 163115

Change-Id: I525e1059e6a2ae3896f68760f1a8a6c68ecfc074
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:45 +02:00
Flavio Santes
c406be6360 samples/net: Fix uninitialized variable error
Fix "Uninitialized variables (UNINIT)" error found at the
HTTP client sample app.

Coverity-CID: 163117

Change-Id: I3d350fdc0e49a7bb7bea9d7af04494f6e918d603
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-03-09 20:33:45 +02:00
Jukka Rissanen
aeb08874af net: samples: echo-client: Allow UDP and TCP run at the same time
Run both TCP and UDP to run at the same time. This requires two
extra threads in echo-client sample application.

Change-Id: I450a26d7ab1472150ea8f1309a43897a30bd4d90
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:44 +02:00
Jukka Rissanen
f8c60de061 net: nbuf: Create net_nbuf_frag_del() for tracking allocations
Create net_nbuf_frag_del() so that we can track net_buf frees.
If CONFIG_NET_DEBUG_NET_BUF is not defined, then this new function
will call net_buf_frag_del() directly, and if not, then it will
track memory usage.

Change-Id: I5f382436cebc71fdaf12baf7bf964fb63bee7aca
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:44 +02:00
Jukka Rissanen
5197266768 net: nbuf: Use net_nbuf_get_frag() to allocate a fragment
The code used net_nbuf_get_reserve_{rx|tx}_data() function to
allocate a fragment. Instead of that low level function, use
net_nbuf_get_frag() instead. There are few places this is not
possible or is too big change like in few test programs.

Change-Id: Ied7e2b7db352de998b200ffa6ff82471bfa5ebe3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen
d32503f57e net: nbuf: Split one global DATA pool to RX and TX DATA pools
If we receive lot of packets, it might happen that we exhaust
all the DATA buffers in the system. This would prevent from
us sending anything to the network.
Change this by splitting the DATA buffer pool into RX and TX
parts. This way RX flooding cannot consume all DATA buffers
that needs to be sent.

Change-Id: I8e8934c6d5fdd47b579ffa6268721b5eb3d64b6d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:43 +02:00
Jukka Rissanen
ee0cff9ac7 samples: net: Use context specific net_buf pools in echo_*
Use context specific net_buf pool in echo-server and echo-client.
This will prevent application from allocating all available network
buffers in the system and thus preventing the core IP stack
functionality.

Change-Id: I3dbc64dd81c8a1165241426287a3530d00cbc7bf
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-03-09 20:33:42 +02:00
Sergio Rodriguez
ee8bfe586b samples: mbedtls: Fixing entropy source
Using a more efficent entropy call and proper output data

Change-Id: I2ce71f63b6f22e5ceda79babd2eac802fa4bdf53
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-03-09 20:33:40 +02:00
Johan Hedberg
69d9985429 Merge bluetooth branch into master
- Assert fixes to controller state transitions
 - AVDTP fixes & improvements
 - SDP fixes & improvements
 - HFP improvements
 - GATT fixes
 - New GATT API for getting current MTU

----------------------------------------------------------------
Arun Jagadish (3):
      Bluetooth: AVDTP: Add AVDTP Receive Function
      Bluetooth: AVDTP: Fix discover param struct
      Bluetooth: AVDTP: Rename of variables

Carles Cufi (4):
      Bluetooth: controller: Use direct ISRs
      Bluetooth: controller: Set debug pins with macros
      Bluetooth: controller: Introduce debug pins Kconfig option
      Bluetooth: controller: Report 5.0 compliant controller

Jaganath Kanakkassery (1):
      Bluetooth: SDP: Server: Introduce private define for max services

Johan Hedberg (3):
      Bluetooth: Add support for Bluetooth 5.0 version specifier
      Bluetooth: Relax minimum advertising interval for 5.0 controllers
      Bluetooth: samples: Add combined observer & broadcaster app

Kaustav Dey Biswas (5):
      Bluetooth: SDP: Server: Fix MTU setting after l2cap connection
      Bluetooth: SDP: Server: Set security level to NONE
      Bluetooth: SDP: Server: Refactor data element structure header
      Bluetooth: SDP: Server: Handle Service Search request
      Bluetooth: SDP: Server: Filter records based on requested uuids

Luiz Augusto von Dentz (4):
      Bluetooth: GATT: Use __ASSERT for invalid parameters
      Bluetooth: GATT: Add bt_gatt_get_mtu API
      Bluetooth: L2CAP: Move functions in preparation for queuing
      Bluetooth: L2CAP: Add TX queueing for LE CoC

Maureen Helm (1):
      Bluetooth: samples: Add hexiwear_k64 and frdm_k64f to tests

Piyush Itankar (2):
      Bluetooth: A2DP: Stream End Point Registration
      Bluetooth: A2DP: Added Preset Structure

Sathish Narasimman (4):
      Bluetooth: AT: Fix 'signed' warning
      Bluetooth: HFP HF: Handling AG Network error
      Bluetooth: HFP HF: SCO: Add esco supported pkt type
      Bluetooth: HFP HF: SCO: Accept eSCO conn request

Szymon Janc (9):
      Bluetooth: shell: Fix accessing invalid memory
      Bluetooth: shell: Fix typo
      Bluetooth: SMP: Fix passkey entry for legacy pairing
      Bluetooth: shell: Don't echo LE CoC data
      Bluetooth: Fix connection object leak
      Bluetooth: shell: Simplify indication in gatt-subscribe
      Bluetooth: shell: Fix GATT long write support
      Bluetooth: GATT: Remove not needed variable
      Bluetooth: GATT: Fix subscriptions removal

Vinayak Chettimada (6):
      Bluetooth: Controller: Use direct ISR for Radio IRQ only
      Bluetooth: Controller: Fix LE Ping PDU dispatch
      Bluetooth: Controller: Run all enqueued mayfly before disable
      Bluetooth: Controller: Kconfig option to set public address
      Bluetooth: Controller: Fix assert on role stop/abort
      Bluetooth: Controller: mayfly enable to supercede over disable

 include/bluetooth/a2dp-codec.h               |  73 +++++
 include/bluetooth/a2dp.h                     |  61 +++++
 include/bluetooth/conn.h                     |   2 +
 include/bluetooth/gatt.h                     |  11 +
 include/bluetooth/hci.h                      |  50 ++++
 include/bluetooth/l2cap.h                    |   4 +
 include/bluetooth/sdp.h                      | 103 ++++---
 samples/bluetooth/peripheral_hr/testcase.ini |   2 +-
 samples/bluetooth/scan_adv/Makefile          |   5 +
 samples/bluetooth/scan_adv/README.rst        |  25 ++
 samples/bluetooth/scan_adv/prj.conf          |   2 +
 samples/bluetooth/scan_adv/src/Makefile      |   1 +
 samples/bluetooth/scan_adv/src/main.c        |  75 +++++
 samples/bluetooth/scan_adv/testcase.ini      |   4 +
 subsys/bluetooth/controller/Kconfig          |  15 +
 subsys/bluetooth/controller/hal/debug.h      | 124 ++++-----
 subsys/bluetooth/controller/hal/nrf5/radio.c |   4 +-
 subsys/bluetooth/controller/hal/radio.h      |   2 +-
 subsys/bluetooth/controller/hci/hci.c        |   2 +-
 subsys/bluetooth/controller/hci/hci_driver.c |  22 +-
 subsys/bluetooth/controller/ll/ctrl.c        | 229 ++++++++++++----
 subsys/bluetooth/controller/util/mayfly.c    |  58 +++-
 subsys/bluetooth/controller/util/mayfly.h    |   4 +-
 subsys/bluetooth/host/Kconfig                |   9 +
 subsys/bluetooth/host/a2dp.c                 |  19 ++
 subsys/bluetooth/host/at.c                   |  53 +++-
 subsys/bluetooth/host/at.h                   |  38 ++-
 subsys/bluetooth/host/avdtp.c                |  63 ++++-
 subsys/bluetooth/host/avdtp_internal.h       |  14 +-
 subsys/bluetooth/host/conn.c                 |  60 +++-
 subsys/bluetooth/host/conn_internal.h        |  10 +
 subsys/bluetooth/host/gatt.c                 |  86 +++---
 subsys/bluetooth/host/hci_core.c             |  92 ++++++-
 subsys/bluetooth/host/hci_core.h             |   8 +
 subsys/bluetooth/host/hfp_hf.c               |  15 +-
 subsys/bluetooth/host/l2cap.c                | 319 +++++++++++++---------
 subsys/bluetooth/host/sdp.c                  | 391 +++++++++++++++++++++++++--
 subsys/bluetooth/host/sdp_internal.h         |   2 +
 subsys/bluetooth/host/smp.c                  |   1 -
 tests/bluetooth/shell/src/main.c             |  98 ++++---
 40 files changed, 1728 insertions(+), 428 deletions(-)
 create mode 100644 include/bluetooth/a2dp-codec.h
 create mode 100644 samples/bluetooth/scan_adv/Makefile
 create mode 100644 samples/bluetooth/scan_adv/README.rst
 create mode 100644 samples/bluetooth/scan_adv/prj.conf
 create mode 100644 samples/bluetooth/scan_adv/src/Makefile
 create mode 100644 samples/bluetooth/scan_adv/src/main.c
 create mode 100644 samples/bluetooth/scan_adv/testcase.ini

Change-Id: I94f2f9f4431e21da9aae00c9e32581acb383ad49
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-08 22:21:41 +01:00
Kuo-Lang Tseng
5873fee475 samples: pwm: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is safer because device name can change and
the app does not need to change.

Jira: ZEP-1764

Change-Id: I3c7716fd72e77c99fd29e4e90634c33f47f32e4c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-03-07 23:03:44 +00:00
Andrew Boie
10c41eea00 samples/logger-hook: fix usage of ring buffer
- Ring buffers provide no concurrency control. Since the ring buffer
is being installed as the system log hook, multiple contexts may try
to write to it simultaneously. Lock interrupts to prevent corruption
of the ring buffer.

- NULL pointers were being passed into sys_ring_buf_get() for the
'type' and 'value' parameters, causing undesirable behavior when they
are dereferenced.

- The 'size32' parameter of sys_ring_buf_put() was being passed the
number of bytes, not the number of 32-bit words.

- The 'size32' parameter of sys_ring_buf_get() was not bring correctly
initialized the size of the destination buffer in terms of 32-bit
words. This has been fixed. There is no longer a need to query the
API twice.

Issue: ZEP-1789
Change-Id: I96f9cc74f3711297727b4c5114b6c93510f4a8c1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-03-07 12:40:23 +00:00
Johan Hedberg
9cf9a2f1f2 Bluetooth: samples: Add combined observer & broadcaster app
Add a sample application demonstrating doing continuous scanning and
sending out advertising packets periodically.

Change-Id: I0ce88afd73bed4928ba65472051c0f83ff27a632
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-03-07 12:21:29 +01:00
Maureen Helm
93a6565dc5 Bluetooth: samples: Add hexiwear_k64 and frdm_k64f to tests
The introduction of device tree broke bluetooth sample builds for the
hexiwear_k64 and frdm_k64f boards. Add these boards to the peripheral_hr
test so this doesn't happen again.

Jira: ZEP-1745

Change-Id: I3e61a83db09cbb5834bd510bff851611e43844a8
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-03-07 12:21:29 +01:00
Andrei Emeltchenko
e9b41f764b hci_usb: Add project configuration for tinyTile board.
Makes configuration for tinyTile board.

Change-Id: I823e299dad905387de85fd6d74159c7540bc7edd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-07 11:19:11 +00:00
Andrei Emeltchenko
8ea70851db hci_usb: Fix incorrect length log
Fixes following warning:
...
warning: format '%u' expects argument of type 'unsigned int', but
argument 6 has type 'int32_t * {aka int *}' [-Wformat=]
...

Change-Id: I3ac523b7c8daf08b0c8e7b43aad270306fe5d744
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-03-07 11:18:39 +00:00
Andrew Boie
04c52bf9f9 samples: grove: add missing testcase.ini
These were simply copied from the 'lcd' test case.

Issue: ZEP-1768
Change-Id: Ie5d561c3131b04df2952523cc8dfd5a004dc1960
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-03-06 16:58:31 +00:00
Kuo-Lang Tseng
4a363ff5bf samples: i2c_fujitsu: change hard-coded device name
Change to use the device config name defined by driver's Kconfig
for device binding, instead of hard-coding it which is not
portable.

Jira: ZEP-1764

Change-Id: I61ed7cfd97e20faad8f1e98dacef9384e8fefc73
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:49:48 +00:00
Kuo-Lang Tseng
e90aa43eaa samples: drivers: change hard-coded device name
Change to use the device name defined by driver's Kconfig for
device binding, instead of hard-coding it which is not portable.

Jira: ZEP-1764

Change-Id: I0dc9aa2cdf426af71f1ed6dcef1ec7cec19f4c3e
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:48:30 +00:00
Kuo-Lang Tseng
1980325392 samples: drivers: rtc: change hard-coded device nam
Change to use the device config name defined by driver's Kconfig
for device binding, instead of hard-coding it which is not
portable.

Jira: ZEP-1764

Change-Id: I7af234ada73302eb062340740df2fc7a8539150d
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:46:49 +00:00
Anas Nashif
c78a3485e2 Merge "Merge net branch into master" 2017-02-27 22:32:01 +00:00
Luiz Augusto von Dentz
0dc4dd46d4 lifo: Make use of k_queue as implementation
Once all users of k_lifo migrate to k_queue this should no longer be
needed.

Change-Id: Ib8af40c57bf8feba7b06d6d891cfa57b44faad42
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-27 21:20:53 +00:00
Luiz Augusto von Dentz
e5ed88f328 fifo: Make use of k_queue as implementation
This makes k_fifo functions rely on k_queue and port k_poll to use
k_queue directly.

Once all users of k_fifo migrate to k_queue this should no longer be
needed.

Change-Id: Icf16d580f88d11b2cb89e1abd23ae314f43dbd20
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-27 21:20:52 +00:00
Flavio Santes
c318967c56 samples/net/mqtt: Don't break lines after the "static" keyword
Fix some style issues found at the src/main.c file.

Change-Id: I2023deb5ac4f31b2cf5d14d8313bbcfc03647898
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes
9b381058f5 samples/net/mqtt: Move conf parameters to config.h
Move the client id define to config.h. Update the README file.

Change-Id: I1900c5e4f8c449e14279660d425501e86e07d409
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes
4979accb9f samples/net/mqtt: Improve inline doc
Remove the brief keyword for the mqtt_client_ctx structure's
inline documentation.

Change-Id: Ia3999bbb7e3246495fd1cab0ca828d95f5896835
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Flavio Santes
31f014a56d samples/net/mqtt: Simplify MQTT publisher
Remove the global bluemix flag and use a #define to set the
MQTT publisher topic and its parameters at compile time.

This change will save a few bytes and speed up computations.

Change-Id: I27bfc6b38c73d32c6105f1d506e147e9a5583097
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-27 10:28:55 +02:00
Vinicius Costa Gomes
270673e112 samples/zoap_client: Fix using the wrong timeout for retransmissions
It was assumed that the unit was microseconds, it is in miliseconds,
the same unit that is stored in the timeout field of the pending
transmission.

Change-Id: Ia99f363c7de4ec76a7ed229cb94a9964bcf609aa
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:55 +02:00
Vinicius Costa Gomes
2f574c7db5 samples/zoap_server: Add retransmissions for CON messages
This adds retransmission support for confirmable responses sent by the
server.

Jira: ZEP-1732

Change-Id: I77c0c6375fa666e4cfdda4016ad1e0e90caf4ac9
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
8e304ef2e6 iot/zoap: Fix requiring that the buffer is unchanged for retransmit
It is possible that the buffer waiting for retransmission is modified
after it is sent, for example, it can be compacted by 6lo, and our
assumption of where is the message ID is located in the buffer is no
longer valid.

As the message ID is the only information that is necessary for
keeping track of retransmissions, we keep a copy of it in the pending
struct, as well as the destination address of the retransmission.

Change-Id: Id33d54353404628673541225a1a05e27ee08765f
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
346edff2ca samples/zoap_server: Adds example for the link-format feature
This implements the /.well-known/core resouce and two children
resources (/core1 and /core2) so the link-format feature is better
explained.

Change-Id: I9dd8c69040c952c5d12a9987c1966a71b0257ef2
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
ddb9cf90a7 samples/zoap_server: Add a test case for the observer feature
This adds the resource necessary for the TD_COAP_OBS group of tests.

Change-Id: I33bd09910f74db90ad0d713e4479ab2e3ec343a5
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
8ce3d4ec82 samples/zoap_server: Add more validation tests for block-wise
Add the resource for the TD_COAP_BLOCK_04 ETSI testcase.

Change-Id: Ied901db34ce79d3e1f7f8c7fd55bc398b1f88640
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Vinicius Costa Gomes
da4580dc32 samples/zoap_server: Remove useless return statements
The functions that retrieve net_buf will wait forever until a buffer
is available.

Change-Id: I03ddd1239f50fe4467e86e31c8fbfc9b05c8b190
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-27 10:28:54 +02:00
Tomasz Bursztyka
2b5a343a0f samples/ieee802154: Update qemu based samples
- Let's build it with the various shell modules
- Make use of Kconfig.samples options

Thus: adding prj_server.conf and prj_client.conf to differentiate 2
instances of the app by their IPv6.

Then let's use samples/net/common/Makefile.ipstack

In the end, it is possible to build 2 times the samples this way:
make PCAP=154.pcap CONF_FILE=prj_server.conf server
and
make pristine
make CONF_FILE=prj_client.conf client

On client, or server, or both, shell commands can be used to ping each
other, check the statistics etc...

Once done, the given pcap file (154.pcap for instance) will have
recorded the traffic which can be parsed through:

wireshard 154.pcap

(Note: the "Malformed packet" warnings are not relevant, as the 15.4
frame FCS is a dummy one, it seems to make wireshark a bit lost)

Jira: ZEP-1774

Change-Id: I5590971660ecbfaac75af709124d59e1f98206fe
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-27 10:28:53 +02:00
Jukka Rissanen
1ca310fc93 samples: net: Fix the 802.15.4 monitor pcap saving
By default the net-tools package is expected to be located in
${ZEPHYR_BASE}/../net-tools directory. User can also specify
the directory using NET_TOOLS variable when running the make.

The net-tools package is located in this repository
https://gerrit.zephyrproject.org/r/net-tools

Change-Id: Ibccd7cabd567a630020fb9efbe1ec9e27b653b46
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-27 10:28:53 +02:00
Anas Nashif
87a422896c Revert "samples: i2c_lsm9ds0: change hard-coded device name"
This reverts commit 81f85f4e4b.

Need a better solution for this, the patch itself does not solve any problem
and fails on many platforms that do not have I2C enabled.

Change-Id: I060e3d7a9992db8a1ece6da5e8d3a521f4052395
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-24 06:30:39 -08:00
Andrew Boie
138579a3ad samples: add some missing testcase.ini
Issue: ZEP-1768
Change-Id: Ia59e02bdaf9302b991f0423ef5eba7b0102877b0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-23 13:28:03 +00:00
Kuo-Lang Tseng
e7f261b748 samples: blink_led: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is more portable and safer because device
name can change and the app does not need to change.

Jira: ZEP-1764

Change-Id: If8c14dd4eb186bace863432d454c9122461f2f9c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:25:20 +00:00
Kuo-Lang Tseng
0eed7eefee samples: fade_led: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is more portable and safer because device
name can change and the app does not need to change.

Jira: ZEP-1764

Change-Id: I3287da5c5a9df24507efa84bbf7bbb051726bc2c
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:25:05 +00:00
Kuo-Lang Tseng
e47e85e279 samples: driver: led_apa102c: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is safer because device name can change and
the app does not need to change.

Jira: ZEP-1764

Change-Id: I5a3e16e10f7700ec12edbd07603808cd32f15755
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:24:42 +00:00
Kuo-Lang Tseng
81f85f4e4b samples: i2c_lsm9ds0: change hard-coded device name
Instead of using a hard-coded device name in the device binding
call, use the config name defined by the driver Kconfig as that
is safer and the app does not need to change when the device name
is changed.

Jira: ZEP-1764

Change-Id: I99efc4bcae0d1acae70f7820f69dfffbe17510a6
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:24:04 +00:00
Wojciech Bober
f8c2b2e099 samples/net/ieee802154: Update example with nrf5 802.15.4
This commit updates the 802.15.4 example to work with the
nrf5 802.15.4 radio driver.

Change-Id: I8a4c80a21ebe29ce2616836b764c454979ebb2e9
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Wojciech Bober
4be677fa45 samples/net: ieee802154: Add configuration for nrf5
This commit addes new configuration for examples which use
nrf5 802.15.4 radio.

Change-Id: I0c57334d071fb58bc2282feb3f4e6b949ce5d472
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-22 17:28:24 +02:00
Anas Nashif
fe118c4e95 license: replace APL2.0 license with SPDX
Some files made it through review process with full license header.

Change-Id: I2722b127c40b4b19500042c12e4fde85a165bae9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-20 16:59:46 +00:00
Jukka Rissanen
14034ac515 samples: net: Add README.rst to echo apps
Add a README.rst file to both echo-server and echo-client
sample applications.

Jira: ZEP-1539

Change-Id: I1ee1d02a3de0295697117f448d8e13f5b161e11b
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Jorge Ramirez-Ortiz
c1c5e25bbc net/mqtt: Add support for IBM BlueMix Watson topic format
Change-Id: I044180d9f76a307c1cf4423a9b1d3ee6c540cbc7
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-15 12:20:08 +02:00
Flavio Santes
057f31e7e9 net/mqtt: Remove length computations for some msg fields
Currently, for the following MQTT msg fields:

- client_id
- will_topic
- user_name
- topic

their length is computed inside the routine that receives the MQTT msg.

Although this simplifies development, also imposes one restriction:
data must be null-terminated. Sometimes, data is received from other
sources and not generated by the application, so the null-terminated
constraint may be considered problematic for the user.

This patch removes the assumption that string fields are null-terminated.
Current data structures are already prepared to handle this case, so no
API change is required.

Change-Id: I5a147a5b21e0da49541cbe62baac363c8737cd3e
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-15 12:20:08 +02:00
Flavio Santes
540505757f net/mqtt: Add support for QEMU x86
Add the QEMU x86 prj file to the MQTT publisher application.

Change-Id: I1ba8c3a3bf818d8f6dee7ea94021a83ba5277e5f
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-15 12:20:08 +02:00
Jukka Rissanen
7608fcdb75 samples: net: Remove the README file
This README file is no longer needed as we have separate
README files in various sub-directories.

Change-Id: I38d1c4208e373aa7aa23373149ef1b89fbcda094
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Jukka Rissanen
9bfa9ca058 samples: net: Remove obsolete prj_slip.conf from echo-*
This config file is not needed.

Change-Id: Ib601605805d6c5c0173424b2e282a50a6a1076d6
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-15 12:20:08 +02:00
Anas Nashif
15a6598691 Merge "Merge remote-tracking branch 'origin/core'" 2017-02-15 04:33:25 +00:00
Jithu Joseph
38aaa7c955 samples/drivers/crypto: crypto sample app
A sample application  to illustrate the usage of crypto APIs.
This shows the usage of AES - CTR, CBC and CCM  based encryption
and decryption.

origin: original

Change-Id: I17e4d966a70169b71a754c9cdc3f713a5d0c3ac0
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-15 01:08:16 +00:00
Sergio Rodriguez
de60e4c8cd samples/net/http: Add HTTP over TLS sample application
Add the HTTPS (HTTP over TLS) server sample application on top
of the current HTTP Parser Library and mbedTLS. This code uses
TLS to stablish a secure connection and HTTP parser to identify
the request and the proper response.

Jira: ZEP-799

Change-Id: Ifbbcd0347bec47d12158440e50a82dc2966334d3
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:35 +02:00
Jorge Ramirez-Ortiz
f994efa8c1 net/mqtt: Add BT support to MQTT publisher sample
Change-Id: I56d54c3550a530bf250210e939840e7c7e89c5d9
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
2017-02-14 08:30:35 +02:00
Richard Peters
d502c24a5d samples: net: Add .conf file for qemu_cortex_m3 in echo_*
Added conf files for qemu_cortex_m3, until a better solution
than CONF_FILE=prj_$(BOARD).conf exists in the makefile.

Change-Id: I1edc4f37bb3c49ecb65abf7c93b3c9f4608d601e
Signed-off-by: Richard Peters <mail@richardpeters.de>
2017-02-14 08:30:34 +02:00
Flavio Santes
f40bdd67ac net/http: Improve network configuration routines
Modify the network setup routine to accept the following parameters:
- network context
- accept callback
- server IP address
- server port

This change will allow us to reuse this routine for TLS.

Change-Id: I1fdbaa908783c69f87863cbc597b42f39358762c
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes
79a064fae8 net/http: Add QEMU support to the HTTP server sample app
This patch adds the QEMU prj file for the HTTP server sample
app.

Change-Id: I0b910b5ec9970a7ffe9621e19d9544d899c22132
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Flavio Santes
449cbbd874 net/dns: Update QEMU prj file
Update the IPv4 addresses to 192.0.2.x.

Change-Id: I0eafccfaf691cfd2ffb896e18d3fdcf091837edc
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-14 08:30:34 +02:00
Vinicius Costa Gomes
62a6c9c6d0 samples/zoap-server: Update docs with information about libcoap
Add information about how to run libcoap's[1] implementation of the
ETSI testcases against zoap-server.

Jira: ZEP-1538

[1] https://github.com/obgm/libcoap (branch develop)

Change-Id: I6aa5989575cc15630371aa0761bee98fb6fe1b80
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-14 08:30:33 +02:00
Anas Nashif
d4c9a7d80c net: remove obsolete CONFIG_NET_YAIP
Change-Id: Ie8ef79e7d7a6f229af3771b7786af3db89c5e458
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-14 08:30:33 +02:00
Jithu Joseph
d3455754d3 samples: webusb: fix variable type mismatches
This was reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ib54d43bbfae4c7819b1e2b82d2931bfe1201ecce
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-14 02:13:52 +00:00
Andrew Boie
9f1ff3fd85 REVERTME: cpp_synchronization: disable on Xtensa
Issue: ZEP-1703
Change-Id: I30af7baa78b0d2ed4dd1ac7236c318c47289fa5e
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 11:39:03 -08:00
Anas Nashif
3557d04eb5 tests: net: whitelist boards for telnet server
Change-Id: I141cb9e680584b9b26926eae288ae7a2a85633f8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-11 07:00:39 +00:00
Kuo-Lang Tseng
61452f0e38 samples: bmi160: use correct device name
Binding of the device failed due to incorrect device name. Update
to use the correct device name.

Jira: ZEP-1704

Change-Id: I6ca23a439357592c9c974ca746bccc35e77d996d
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-11 01:28:09 +00:00
Jithu Joseph
720400372b misc: fix more variable type mismatches
These were reported by ISSM compiler.

Jira: ZEP-1179

Change-Id: Ic625749309773611c0c6ba2905e9420e98947dae
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-11 00:14:15 +00:00
Anas Nashif
df16cb92d4 arduino_101: bmi160: use new device name
Use new device name for SPI device

Jira: ZEP-1704
Change-Id: Iec39468bbef54423af2b3a681dd4ae1eee866d1e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-10 16:02:22 +00:00
Marcus Shawcroft
7421928ae5 samples/dhcpv4_client: Switch from private net_sprint_ipv4_addr to public net_addr_ntop
Change-Id: I894c22548aeea4dcb42e457266e7e140acdace0f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:09 +00:00
Marcus Shawcroft
7a903ede9f samples/dhcpv4_client: Increase number of DATA buffers.
Change-Id: I0116613cb63070d08c4cb6ad7a5864d09a014c68
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:09 +00:00
Marcus Shawcroft
571bdbb7c3 samples/dhcpv4_client: Reduce default debug to dhcpv4
Turn down the default logging verbosity on the dhcpv4 frdm_k64f config
to focus on the dhcpv4 implementation.

Change-Id: Ifb450181add653951517a7b128b11657ec2bab62
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:27:08 +00:00
Marcus Shawcroft
15a151a0a0 samples/mbedtls_dtls_client: Fix wild write in entropy_source
The example entropy_source implementation should write entropy to the
output buffer rather than to the context pointer which in this example
happens to be NULL.

Take the opportunity to reorganize the entropy_source to use all of
the entropy provided by a call to sys_rand32_get() rather than just
1/4 of it.

The entropy_source() callback from mbedtls is given a maximum amount
of entropy to return, rather than a minimum amount.  Hence it makes
more sense to deliver exactly one chunk (32 bits) of entropy from the
call to sys_rand32_get() per call and let the mbedtls entropy handler
worry about how much entropy we actually need to collect (ie the threshold).

Change-Id: I57ed438de5cb1223619fde0fb8039d6eca284646
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:58 +00:00
Marcus Shawcroft
8a612c3a44 samples/mbedtls_dtls_server: Use k_uptime_get_32()
The kernel provides an API call to get the least signficant 32 bits of
system time, use it rather than	reaching under the hood.

Change-Id: I98fabdcadfd0a4fe5ae10226dabf4e6d31e88df6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:57 +00:00
Marcus Shawcroft
e2e43774d2 samples/mbedtls_dtls_client: Use k_uptime_get_32()
The kernel provides an API call to get the least signficant 32 bits of
system time, use it rather than reaching under the hood.

Change-Id: I9c303ef949f7670f2a2d9691c342e496873e96e6
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-02-09 14:26:57 +00:00
Ravi kumar Veeramally
f6916acbee net: samples: Unref the buf if app data length is zero
Core stack is not removing the network buffer if app data length
is zero. So memory leak happening here.

Change-Id: I3d354b5e7008396ca7cb977631036871998165b4
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-09 12:29:29 +02:00
Ravi kumar Veeramally
083e112197 net: samples: Unref net_buf using net_nbuf_unref
Using net_buf_unref() technically works but debugging the network buffer
allocations is more difficult if done like that.

Change-Id: Ib8e3f8b412c2f8388315c2f63cae4392f814ea2f
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-09 12:29:29 +02:00
Anas Nashif
31f01f8ed6 Merge "Merge net branch into master" 2017-02-08 12:03:09 +00:00
Johan Hedberg
79883c9834 Merge bluetooth branch into master
- Use k_poll to consolidate all TX threads into a single one
 - Reuse HCI command buffers for storing their response
 - Improvements to SDP client support
 - New "volatile subscription" flag to GATT API
 - Various smaller fixes & cleanups here and there

----------------------------------------------------------------
Arkadiusz Lichwa (8):
      Bluetooth: SDP: Get ProtocolDescriptorList attribute internals
      Bluetooth: shell: Add SDP client support
      Bluetooth: uuid: Fix assigned UDP uuid value
      Bluetooth: SDP: Add API to get ProfileDescriptorList attribute
      Bluetooth: shell: Add getting ProfileDescriptorList attribute
      Bluetooth: SDP: Add API to get SupportedFeature attribute
      Bluetooth: shell: Use SupportedFeature attribute API
      Bluetooth: shell: Add support to retrieve A2SRC record

Arun Jagadish (2):
      Bluetooth: AVDTP: Remove buffer pool
      Bluetooth: AVDTP: Add AVDTP Discover Function Definition

Carles Cufi (1):
      Bluetooth: hci_core: Use nRF5x FICR address

Jaganath Kanakkassery (2):
      Bluetooth: RFCOMM: Fix session timer during acl disc
      Bluetooth: RFCOMM: Use common tx pool for control packets

Johan Hedberg (15):
      Bluetooth: Fix trivial coding style issue
      Bluetooth: Fix checking for invalid public address
      Bluetooth: Fix using correct variable type for interrupt mask
      Bluetooth: Fix buffer leak when HCI driver send() fails
      Bluetooth: drivers/h4: Add support for discarding certain events
      Bluetooth: Add convenience macros for common header sizes
      Bluetooth: Kconfig: Merge headroom reserve variables into a single one
      Bluetooth: Controller: Redesign response buffer allocation for commands
      Bluetooth: Reuse HCI command buffers for the command response
      Bluetooth: conn: Use delayed work for LE connection timeout
      Bluetooth: Merge bt_conn TX threads into a single one with k_poll
      Bluetooth: Merge HCI command and connection TX threads
      Bluetooth: samples: Add missing README.rst files
      Bluetooth: Controller: Use LL_ASSERT instead of BT_ASSERT
      Bluetooth: Fix incorrect checks for command buffer user data

Jonathan Gelie (3):
      Bluetooth: GATT: introduce volatile subscription flag
      Bluetooth: GATT: set subscribe value to zero for unsubscription
      Bluetooth: GATT: fixing unsubscription

Luiz Augusto von Dentz (1):
      Bluetooth: GATT: Fix not removing subscriptions safely

Sathish Narasimman (5):
      Bluetooth: HFP HF: Service level connection completed
      Bluetooth: HFP HF: Enable extended AG Error Result Code
      Bluetooth: HFP HF: Indicate disconnect to application
      Bluetooth: HFP HF: Disconnect rfcomm on SLC error
      Bluetooth: HFP HF: Remove unused variable 'buf'

Szymon Janc (5):
      Bluetooth: Use assert when getting net buf with K_FOREVER
      Bluetooth: Remove some dead code
      Bluetooth: L2CAP: Remove dead code
      Bluetooth: SDP: Make bt_sdp_create_pdu static
      Bluetooth: L2CAP: Make l2cap_br_send_conn_rsp return void

 drivers/bluetooth/hci/Kconfig                   |  13 +-
 drivers/bluetooth/hci/h4.c                      |  93 +++-
 drivers/bluetooth/hci/h5.c                      |  47 +-
 drivers/bluetooth/hci/spi.c                     |  13 +-
 drivers/bluetooth/nble/gatt.c                   |  76 +--
 include/bluetooth/buf.h                         |  13 +-
 include/bluetooth/gatt.h                        |  18 +-
 include/bluetooth/hci.h                         |   9 +-
 include/bluetooth/l2cap.h                       |  20 +-
 include/bluetooth/sdp.h                         |  51 ++-
 include/bluetooth/uuid.h                        |   2 +-
 samples/bluetooth/handsfree/README.rst          |  23 +
 samples/bluetooth/hci_uart/src/main.c           |  11 +-
 samples/bluetooth/hci_usb/src/main.c            |  11 +-
 samples/bluetooth/peripheral_sc_only/README.rst |  26 ++
 subsys/bluetooth/controller/hci/hci.c           | 153 ++++---
 subsys/bluetooth/controller/hci/hci_driver.c    |  23 +-
 subsys/bluetooth/controller/hci/hci_internal.h  |   2 +-
 subsys/bluetooth/controller/ll/ctrl.c           |   2 +-
 subsys/bluetooth/host/Kconfig                   |  10 +-
 subsys/bluetooth/host/at.c                      |   2 +-
 subsys/bluetooth/host/at.h                      |   3 +-
 subsys/bluetooth/host/avdtp.c                   |  81 +++-
 subsys/bluetooth/host/avdtp_internal.h          |   7 -
 subsys/bluetooth/host/conn.c                    | 178 ++++----
 subsys/bluetooth/host/conn_internal.h           |  15 +-
 subsys/bluetooth/host/gatt.c                    | 142 +++---
 subsys/bluetooth/host/hci_core.c                | 285 ++++++++----
 subsys/bluetooth/host/hci_core.h                |   6 +
 subsys/bluetooth/host/hci_ecc.c                 |   6 +-
 subsys/bluetooth/host/hci_raw.c                 |  12 +
 subsys/bluetooth/host/hfp_hf.c                  |  50 +-
 subsys/bluetooth/host/l2cap.c                   |  35 --
 subsys/bluetooth/host/l2cap_br.c                |  49 +-
 subsys/bluetooth/host/l2cap_internal.h          |   7 +-
 subsys/bluetooth/host/rfcomm.c                  |  31 +-
 subsys/bluetooth/host/rfcomm_internal.h         |   5 +-
 subsys/bluetooth/host/sdp.c                     | 584 +++++++++++++++++++++++-
 tests/bluetooth/shell/src/main.c                | 172 +++++++
 39 files changed, 1700 insertions(+), 586 deletions(-)
 create mode 100644 samples/bluetooth/handsfree/README.rst
 create mode 100644 samples/bluetooth/peripheral_sc_only/README.rst

Change-Id: I7589dbad8b97477c72d1b856121593bcf6d11339
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-08 13:03:20 +02:00
Juan Manuel Cruz
5225daad94 mbedtls: add arduino 101 configuration to ssl client sample
Jira: ZEP-748

Change-Id: Ied8c521f80b8f1d4b22497a059ee5c948449613f
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2017-02-08 10:12:36 +02:00
Michael Scott
76551f469e samples: net: irc_bot: add testcase.ini
Change-Id: I61b6373572254cbb63a8170eb2dfd8381a0973a2
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott
92042b25c2 samples: net: irc_bot: fix size_t related build warnings
size_t has different types depending on the arch selected for
building.  Correct format identifier is %zu in this case.

Change-Id: I4388fcd8c5eb8bcd5997bb921bd80b4c2175b24c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Michael Scott
6a3b3f0e46 samples: net: irc_bot: fix build break
Fix build break introduced in commit 6b013c4721c5
("net: nbuf: Add timeout to net_buf getters")

Change-Id: Iaa521c6a49ae740eaee5276936442ab8aa4c47ba
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-08 10:12:36 +02:00
Jukka Rissanen
bd3908b2a9 net: nbuf: Add timeout to net_buf getters
This commit changes the net_buf getter functions in nbuf.h
by adding a timeout parameter. These function prototypes
are changed to accept a timeout parameter.
	net_nbuf_get_rx()
	net_nbuf_get_tx()
	net_nbuf_get_data()
	net_nbuf_get_reserve_rx()
	net_nbuf_get_reserve_tx()
	net_nbuf_get_reserve_data()
	net_nbuf_copy()
	net_nbuf_copy_all()
	net_nbuf_push()
	net_nbuf_append()
	net_nbuf_write()
	net_nbuf_insert()

Following convinience functions have not been changed
	net_nbuf_append_u8
	net_nbuf_append_be16
	net_nbuf_append_be32
	net_nbuf_insert_u8
	net_nbuf_insert_be16
	net_nbuf_insert_be32
	net_nbuf_write_u8
	net_nbuf_write_be16
	net_nbuf_write_be32
so they call the base function using K_FOREVER. Use the
base function if you want to have a timeout when net_buf
is allocated.

Change-Id: I20bb602ffb73069e5a02668fce60575141586c0f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:35 +02:00
Wojciech Bober
573774a9bf drivers/net/ieee802154: Change configuration prefix
This commit changes Kconfig prefix for ieee802154 drivers to
IEEE802154_*. This is done for consistency with config prefixes
used in other subsystems.

Change-Id: Ibbb4d96d2b748f4f13135bde85304ec34c5a90a6
Signed-off-by: Wojciech Bober <wojciech.bober@nordicsemi.no>
2017-02-08 10:12:35 +02:00
Jukka Rissanen
b9ac440d02 samples: net: Fix invalid memory access for TCP
Set protocol family value only after the buf is verified
to be non-null.

Change-Id: I0ce7bab3539087d0f522b4bb3024f46a7eb3c15f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-08 10:12:34 +02:00
Flavio Santes
c2c32d24e3 samples/net/http: Add the HTTP client sample application
This patch adds a basic HTTP client sample application.
The following HTTP 1.1 methods are supported: GET, HEAD,
OPTIONS and POST.

This sample application does not define an API for HTTP,
for more information see ZEP-346.

Jira: ZEP-827

Change-Id: Iee63a53f2ef424964f040eba20326d648249fc24
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-08 10:12:34 +02:00
Ramesh Thomas
632964e010 samples: power: Remove mention of specific versions in README
The README was referring to a specific version of the boot loader.
Since the boot loader version is expected to change in future
and Zephyr code would also correspond to that version, it is better
to not mention any specific version. Instead, the requirement
is to use the latest version of the boot loader.

Change-Id: I04082eec4af16426f6456702c521e8f61bd4e0df
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-02-08 06:28:25 +00:00
Johan Hedberg
46ed7974b3 Bluetooth: samples: Add missing README.rst files
Add missing README.rst files to the last two samples.

Jira: ZEP-1540

Change-Id: I8dfa6489c6c65872594d4416870e2a41e701595d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-07 10:52:08 +02:00
Johan Hedberg
50678b03cb Bluetooth: Reuse HCI command buffers for the command response
Reduce the pressure on the common RX buffer pool by reusing HCI
command buffers also for the Command Status or Command Complete
response to them. This also implies removing the existing Kconfig
variable for the command buffer sizes since the size is also dependent
on maximum Command Complete event sizes. Instead, reuse the RX buffer
size also for HCI Command buffers.

Change-Id: I006b287d64a0c9ca40de741aa9a424a49a927385
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-05 22:39:25 +02:00
Johan Hedberg
743379c21f Bluetooth: Kconfig: Merge headroom reserve variables into a single one
A subsequent patch will start reusing HCI command buffers for
receiving the response, so the distinction of received vs sent data
headroom would just make the code unnecessarily complex. Instead, just
merge these two variable into a single one.

Change-Id: I31d846331939f1a2270df7ed0c75112825e16493
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-02-05 22:39:25 +02:00
Baohong Liu
fd74c0c5a6 samples: bmi160: reduce polling mode sampling frequency
Reduce the accelerometer sampling frequency for polling mode.
So, cpu has more time to fetch the sample.

Also add some waiting time for the new frequency setting to
take effect.

Jira: ZEP-1532

Change-Id: If5c1d8a2b5f30b232a212f2775306ca397b9f80c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-04 20:08:16 +00:00
Baohong Liu
42af60328d samples: spi_flash: remove an unnecessary config symbol
Remove CONFIG_GPIO from the prj config file. It is redundant.

Change-Id: Ife4301e7ce480a9002cadcddfd5eaa569900a391
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2017-02-04 19:45:44 +00:00
Jukka Rissanen
2612b04d80 samples: net: zperf: Set the proper UDP payload
Use a static buffer for sending UDP payload instead of reading
values from memory.

Change-Id: I037db5cd9b8784966d481c36e8cbe92d19760475
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen
517fb19586 samples: net: zperf: Fix compiler warnings
Compiler was giving "Unused variables" warnings if IPv6 was
enabled and IPv4 was not, and vice versa.

Change-Id: I3b17534bb8bdef207512ea5b618e138edb420871
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen
47685ef71f samples: net: zperf: Fix udp.upload command
The IP address and port number were incorrectly parsed if
user used udp.upload command.

Change-Id: Ib37d481012af5e186a1e342c92d10ddef9fe35b1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Jukka Rissanen
1ec6038c48 samples: net: zperf: Initialize address family properly
The IP address family was not set correctly when setting up
the connection. This lead to connectivity error in udp.upload
command.

Change-Id: I598ff2675f97e10e2033763a497f7583c94f3840
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:20 +02:00
Flavio Santes
53e9245b33 samples/net/http: Add the HTTP server sample application
Add the HTTP server sample application on top of the
HTTP Parser Library.

This sample application is based on TCP and HTTP chunk
transfer code found at:

https://gerrit.zephyrproject.org/r/#/c/9977/

A README file with sample output and a detailed
description of this application is also provided.

Jira: ZEP-820
Jira: ZEP-1542
Jira: ZEP-1556

Change-Id: I649104a256190577000bbac118136d5bc21f83bf
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:20 +02:00
Luiz Augusto von Dentz
e89aebc4d5 net: samples: Add CONFIG_NET_L2_BLUETOOTH_ZEP1656
This enables these samples to interoperate with Linux 6LoWPAN over
Bluetooth implementation while that is being fixed, in the long term
we might remove it from the samples once Linux is fixed.

Jira: ZEP-1656

Change-Id: I8ca9fe5a27f43cebc75b6fe5a436a5e8fcee26d5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-02-03 15:59:20 +02:00
Flavio Santes
20bf36601b samples/net/dns: Update README file
The DNS client sample application was updated to use IP addresses
from the prj_*.conf files. This patch updates the README file to
reflect those changes.

Change-Id: Ic72510be8da208aef19fb188560221e1c2386457
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:19 +02:00
Anas Nashif
9051e1ab1d doc: net: use Qemu setup section in current documentation
Fix references to Qemu section and references to boards.

Change-Id: Ib2174ff698d57d3272073eecc71209e047961aaa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-03 15:59:19 +02:00
Anas Nashif
f75462984f doc: update networking with Qemu section
Copy the documentation from the Wiki over here, the cross linking
between online documentation and Wiki and duplication of information was
inconsistent and confusing. Put everything in one place.

Change-Id: Ia3aaec1b431477e2ec54dbec2ccaa655870b0ee3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-03 15:59:19 +02:00
Vinicius Costa Gomes
88405fcd17 samples/zoap_server: Fix errors for GET requests without payloads
It doesn't really make sense for GET requests to have payloads, we
shouldn't even be checking if they have any payloads.

Change-Id: I4bb8cccd6c733a5825c2ca5067a990937c7045a6
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:19 +02:00
Flavio Santes
76785f0bcd samples/net/dns: Improve network configuration
- Reorganize some CONF variables and add the CONFIG_NET_SAMPLES_xxx
  variables to the DNS sample application.
- Remove all the numeric IP addresses
- Use the CONFIG_NET_SAMPLES_xxx variables to define the IP addresses

Change-Id: Ib294d338f163f03ea1b47143b489d916578c532d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes
3a05189284 samples/net/dns: Move conf variables to config.h and delete unused defines
- Move the MAX_ADDRESSES macro to config.h.
  Document the meaning and usage of this macro

- Delete unused defines

Change-Id: I035feb605611e564db15cba77d6a3dce8409ca18
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes
660b0324e0 samples/net/dns: Add the FRDM_K64F board to the testcase.ini file
Add the FRDM_K64F board to the DNS sample app testcase.ini

Change-Id: Iea8f7d09ed0d793711a5807f4bb67ed35ebf52c1
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Flavio Santes
59b1384885 net/mqtt: Add the MQTT Publisher sample application
This commit adds the MQTT Publisher sample application for Zephyr.

The following MQTT API routines are exercised in this sample:

- mqtt_init
- mqtt_tx_connect
- mqtt_tx_pingreq
- mqtt_tx_publish
- mqtt_tx_disconnect

The following MQTT API data structures are used in this application:

- struct mqtt_ctx
- struct mqtt_connect_msg
- struct mqtt_publish_msg

This sample application exemplifies how to send MQTT PUBLISH messages
with different QoS values.

A README file is also included in this patch.

Change-Id: I2b41b276d5178a2cd1b07b031c38bff481885fff
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-02-03 15:59:18 +02:00
Jukka Rissanen
cc9ec3488f samples: zperf: Enable TCP for zperf configuration
Change-Id: I0154c6d890a3bff5be2cad5ea621660bf46a158d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:17 +02:00
Jukka Rissanen
48b9b96d3f samples: zperf: Use native IP stack for TCP support
Enable zperf code to support TCP using the native IP stack
when testing the network throughput.

Change-Id: I3e58754cfff65525ad15e63adf57f1ea22e4559d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-02-03 15:59:17 +02:00
Michael Scott
1a21a36b7e samples: net: irc_bot: add DHCPv4 support
When CONFIG_NET_DHCPV4 is selected, ignore the CONFIG_NET_SAMPLES_MY_IPV4_ADDR
setting and instead used DHCPv4.

NOTE: This commit also adds a placeholder for DHCPv6 behavior which is not
yet functional.

Change-Id: Id31fcb99be46e966babf18f94b5dec151920dedc
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott
fab087e9ba samples: net: irc_bot: add DNS support
When CONFIG_DNS_RESOLVER is active, the PEER config will be ignored and
instead a DNS query for DEFAULT_SERVER will be used.

Change-Id: If2c699944027f3c6a8ae9654f9cda0d7dca387c8
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott
2f10b31431 samples: net: irc_bot: add IPv4 support
NOTE: You must set CONFIG_NET_IPV6=n in the project .conf file for
the CONFIG_NET_IPV4 setting to take effect.

Only 1 IP connection is active at a time.  And when both are active
CONFIG_NET_IPV6 takes precedence.

Change-Id: I34a75f8d44db986810648d82a65d2ed29fc9a940
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:17 +02:00
Michael Scott
8a7e30609a samples: net: irc_bot: add FRDM K64F project .conf
Change-Id: Id16d379629bba2f4663355021c7510170cd42cba
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
2618fcfb3c samples: net: irc_bot: add Linaro copyright
Change-Id: Ic16902e6ce28765ffd8d9cb2f1699a33af19d1ae
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
103c1aff9b samples: net: irc_bot: handle messages across multiple fragments
Often IRC messages are split across multiple netbuf fragments.
Let's fix the message processing to account for this.

Change-Id: I3835af6adf337d27c28a0beeb72848dcc838772c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
50a93d906d samples: net: irc_bot: create semi-unique IRC user names
IRC won't allow 2 users to use the same user name, so let's add
a random number to the end of "zephyrbot" to make it semi-unique.

Change-Id: I56349de21823d8fd2c52646656615b42fc12de5e
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
fc9443209f samples: net: irc_bot: modify disco check in on_context_recv()
Currently, status can be 0 when a NULL buffer is sent to
on_context_recv() so let's not include status in our check.

And in the future, status parameter may be a non-zero value indicating
an error condition.  So modify check to include positive values as well.

NOTE: Also make sure to use NET_ERR in these cases and not NET_INFO.

Change-Id: I8eac9a86d22b3b5624cd7a4e9d99e57afcac035f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
7f90bc7244 samples: net: irc_bot: dont hardcode NET_SYS_LOG_LEVEL
Instead let this be set via the project .conf file

Change-Id: Id8d7b46cc0888b83593b6f82dae619fb42c6ae3f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
65abcd4580 samples: net: irc_bot: use irc parameter's connection
chan->irc won't be set after the "JOIN" transmit succeeds.

Change-Id: I935b0a44c94ec3d2c91b73db92bfd2005c27bb7f
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
f6255a78ae samples: net: irc_bot: fix null pointer deref
samples/net/irc_bot/src/irc-bot.c:368:36:
warning: 'c' may be used uninitialized in this function
[-Wmaybe-uninitialized]
  for (cc = &chan->irc->chans, c = c->irc->chans;
                                   ^
As suggested by Leandro Pereira <leandro.pereira@intel.com>
adjusted to:
  for (cc = &chan->irc->chans, c = chan->irc->chans;

Change-Id: Icd490059e0b97f95408dd7bad3f1783a215c5edb
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
359ef02bdf samples: net: irc_bot: expand some char buffers
Making a bit more room in these buffers.  Some were not big enough
in certain cases, while others needed more room in general.

Change-Id: I47a4bb8c6635305f55dee323f7293b2e4cbed55a
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
267cbd9469 samples: net: irc_bot: simplify connect path
K_FOREVER timeout in net_context_connect() will wait until
SYNACK has been received and we're ready to proceed with socket
communication.

To make the code as clear as possible, let's remove 2 callback
functions and relocate that code inside zirc_connect().

Change-Id: I6c64852ad5f48b24e1e6a58a741981e7d07bfd40
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
36b551edeb samples: net: irc_bot: make some functions more accessible
Due to code restructuring we should move the following
functions higher in the code (above zirc_connect):
zirc_nick_set()
zirc_user_set()
zirc_chan_join()

Also relocate the function declaration for on_msg_rcvd()
to the top of the code.

Change-Id: I3936fb645b709dcbcfcc4212c127db819974c046
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
f75c1fdabf samples: net: irc_bot: use #defines for server and port
Users can locate and edit these easier when they are at the
top as a #define.

Change-Id: Iecb53999cef1e70a80a28c7be5664ccde0fe7acf
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:16 +02:00
Michael Scott
81640ab197 samples: net: irc_bot: make panic() more accessible
By moving panic() function up to the top, other functions can be moved
later and still be able to call it.

Change-Id: I4290d1509cc64fc3f5fc5ec109cc19058090e6dd
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
a1d630398f samples: net: irc_bot: remove sockaddr globals
Instead use helper function where necessary.

Change-Id: Idcb47d02966731d7ef18588d1dccc8031a38d9d0
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
dbe4635368 samples: net: irc_bot: add helper function in_addr_set()
The aim of this helper function is to remove duplicate code for setting
the parameters of in_addr structures.

Change-Id: Id882a5947c47a9b6f92924ce8fb04023540fbb8d
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
01e3c3380f samples: net: irc_bot: remove unneeded typecasts and extra var
From function: zirc_connect

Change-Id: Ie0abc919c62b12995af7605bd080eafa48b48841
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
79dc068bea samples: net: irc_bot: release net_context reference upon error
Change-Id: I69451b3035d09c0de8ae0f448c80b780a09e72bd
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
14a6306069 samples: net: irc_bot: establish privmsg callback typedef
Change-Id: I005fc4d33da7b2c81e2add5e73f11f6c5bd2c42c
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Michael Scott
ed7ea99244 samples: net: irc_bot: run sample process as a thread
This allows for a set app stack and threaded functions to be used later.

Change-Id: I647a3defdf6eb4cca2a4a21192b20641f5bf8d4a
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Leandro Pereira
2bcd700462 samples: net: Add IRC bot example
This is a sample IRC bot program, written using the new IP stack API.
All it does is join an IRC channel, wait for some commands, and react
to them:
	!hello will greet whoever sent the command
	!random will generate a pseudo-random number and send it back
	!led_toggle will toggle an LED in the board [1]
	!led_on will turn the LED on regardless of its current state
	!led_off will turn the LED off
	!rejoin will part the current channel and join again
	!disconnect will quit from the IRC server

As far as the IRC protocol goes, it doesn't do much more than this, but
it should be straightforward to add support for other things (such as
notices, CTCP, DCC, etc) if someone is inclined to do so.  However,
that's way beyond the scope of this sample, which is to show how to use
the network API to write a TCP client.

Some things are still missing as an example of how to use the APIs,
namely DNS resolution, automatically setting up the network with DHCP,
maybe saving settings on EEPROM.  These are good candidates to be added
in the future.

[1] The LED code has been shamelessly stolen from the CoAP sample code.

Change-Id: I7152e97c0726f3559db545579ae8ae8d07bf04cd
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:15 +02:00
Tomasz Bursztyka
bc406fab08 samples/net: Add a simple telnet sample
It will setup IPv4/IPv6 addresses. Telnet is ran in the background,
along with net and kernel shell modules.

See the README.rst for more information how to start and use this
sample.

Change-Id: I3e935014c79b534aab43a6fa8256792b23abb38e
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes
d689c5ee97 samples/zoap_server: Add a 802.15.4 case to the test suite
Allow build-testing zoap-server with support for the CC2520 radio.

Change-Id: I986afd7b15208d477bd79f42a52dd45b217214cb
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes
0ef657904d samples/zoap_server: Allow overriding the BOARD variable
In case the user wants to use BOARD make variable to conveniently use
another board with this sample.

Change-Id: I6dd0656da223218d116dd498c1336c890563b212
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:14 +02:00
Ravi kumar Veeramally
b13f44bcdd net: utils: Add net_addr_ntop() helper function
net_addr_ntop() will convert IPv4|6 address to string form.
Renamed existing net_sprint_ip_addr_buf() to net_addr_ntop()
and adjusted parameters as per API.

Jira: ZEP-1638

Change-Id: Ia497be6bf876ca63b120529acbadcfd9162a96e3
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-02-03 15:59:14 +02:00
Tomasz Bursztyka
227bf97f60 samples/net: Fix a tiny mistake in dhcpv4_client README.rst
Change-Id: I7ce6e9a762f13d3db5d2769301719f17b798a4fe
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-02-03 15:59:14 +02:00
Paul Sokolovsky
63e6b60969 net: echo_server: Enable TCP for frdm_k64f
To match qemu_x86.

Change-Id: I04806d8a8850a76c984f3cda1efaa065bcf4596e
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-02-03 15:59:14 +02:00
Vinicius Costa Gomes
f0f8a99257 samples/zoap_server: Enable support for 802.15.4
This configuration file allows using the device 802.15.4 radio for
IPv6 networks.

Change-Id: I9b3ee9a64acb71e97e4e8f7aae3e619196ad0462
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-02-03 15:59:13 +02:00
Michael Scott
ca6a686495 net: correct in*_addr parameter of net_addr_pton()
Currently, the function accepts a struct sockaddr * but the code
immediately type casts this to either in_addr or in6_addr.  This is
incorrect behavior as the first field in a sockaddr is sa_family_t
and not address data.

So without special knowledge, a developer will use a sockaddr structure
as the parameter and then wonder why the address information isn't being
set correctly.

Let's change this parameter to void * which makes this function similar
to inet_pton().

Jira: ZEP-1616

Change-Id: I1fc9368da999d90feb07c03fac55dcc749d4eba6
Signed-off-by: Michael Scott <michael.scott@linaro.org>
2017-02-03 15:59:13 +02:00
Anas Nashif
0650911a0d samples: philosophers: adjust stack size and build by sanitycheck
Jira: ZEP-1598
Change-Id: I5e2126e946c0a4935d938051acd98702065f458e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-02 14:44:46 +00:00
Piotr Mienkowski
f5b3e2a09b samples: net: echo_server .conf for Atmel SMART SAM E70 Xplained board
Tested on Atmel SMART SAM E70 Xplained board

Origin: Original

Jira: ZEP-1492
Change-Id: If6acbaabf0857425684e0ab2d4db513e5bbc7b77
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2017-02-01 21:01:20 +00:00
David B. Kinder
f3bc4c018d doc: fix .rst headings in new sample docs
Change-Id: I14230acb0fff64936c890478d5bf9bb81dcf9985
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-30 14:54:22 -08:00
Kumar Gala
97d375eead samples: webusb: fix type of bytes_read
bytes_read should be an int, all uses of it in this sample are of type
int.  Lets clean this up so when building with newlib or in the future
when uint32_t might change its definition we don't have issues.

Change-Id: Ief7bfb48948df50cec45b4707ef7676d13173f34
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-30 12:01:49 +00:00
Kumar Gala
c9a4335ad3 samples: zperf: cleanup types for constant arrays
There are a few arrays we use with print_number and parse_number.  These
functions expect a const uint32_t so lets have the arrays for TIME_US,
KBPS, and K match.

Change-Id: I6347b06af2374d702144084bb6b538a478fb8fac
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-30 12:01:48 +00:00
Anas Nashif
66417c0246 Merge "Merge net branch into master" 2017-01-29 04:31:39 +00:00
Johan Hedberg
eb07178236 Bluetooth: samples: Use Kconfig DEVICE_NAME variable when possible
Instead of using a hard-coded string, make the sample use the Kconfig
variable for the device name.

Change-Id: Ib09f594e1cba221f9064318572bd90d38bd2733a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-28 08:43:41 +02:00
Johan Hedberg
4153b6ca1f Bluetooth: Kconfig: Make device name variable generic
Change BREDR_NAME to DEVICE_NAME so it can also be used as the LE
device name.

Change-Id: I9ef55d9dff098372d47d9d5754ad7a7163a65bc0
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-28 08:43:41 +02:00
Bogdan Davidoaia
a45dd12f0c sensor: use SENSOR_CHAN_*_XYZ instead of SENSOR_CHAN_*_ANY
SENSOR_CHAN_*_ANY will be deprecated, so use the new SENSOR_CHAN_*_XYZ
enum values.

Change-Id: I91cf25864613a934feab65588969d10c52fd4fe6
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-27 19:07:17 +00:00
Jukka Rissanen
7ad52b94cf net: echo-client: Add TCP support
This commit enables echo-client application to start to
send data over TCP connection.

Change-Id: I9acdaae7f1e8411952c30caeedc9c1fb07cdd448
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-27 15:06:06 +02:00
Andrei Emeltchenko
6043dddd4a net: Remove unused CONFIG_NET_IPV6_NO_DAD option
Option CONFIG_NET_IPV6_NO_DAD is not used anymore, clean project
configuration files.

Change-Id: I368e076d2f79f1d4bc86edee11ff5befe37362c8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:54 +02:00
Tomasz Bursztyka
83ed3a29be net/ieee802154: Modify radio TX function signature
The cause for this change is TCP. Until now, the radio strategy driver
(ALOHA or CSMA) was providing the actual nbuf, and not the buffer
fragment, counting on the fact that the loop was using
net_buf_frag_del() which made so, iteration after iteration, buffer
framgent to be always buf->frags. The problem with this logic is loosing
the fragments that might be still referenced by TCP, in case the whole
buffer did not make it so TCP can retry later and so on.

Instead, TX now takes the nbuf and the actual frag to send. It could
have been working with just a pointer on the data, and the whole length
of the frame. But it has been avoided due to possible future devices,
that will be smarter and run CSMA directly in the hw, thus it will
require to access the whole buffer list through the nbuf.

Change-Id: I8d77b1e13b648c0ec3645cb2d55d1910d00381ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Andrei Emeltchenko
5794d80c10 net: Remove CONFIG_NET_IPV6_NO_ND config option
The option is no longer used so it can be removed.
Use CONFIG_NET_IPV6_ND option instead.

Change-Id: Ibaa3d3deb52b8b176e85f8b9e1d8c80c1026aea1
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:53 +02:00
Sergio Rodriguez
98d7ff0013 samples/coaps_client CoAP over DTLS client example app using mbedTLS
Jira: ZEP-941

Change-Id: Ia49087b75b33bcedb1b77b6a062368281c41e479
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 12:35:53 +02:00
Sergio Rodriguez
3818af4a7b samples/coaps_server CoAP over DTLS server example app using mbedTLS
Jira: ZEP-942

Change-Id: I810fccfed912d9de62073a9a4e943b7924aa6392
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-27 12:35:53 +02:00
Tomasz Bursztyka
507fa88734 samples/net: Add telnet console support on echo_server with qemu
This is meant to test telnet console easily, as echo_server already
enables net shell module etc.

Change-Id: I045340ae5d6e179ea5ce1416cd7d67c6956bd973
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-27 12:35:53 +02:00
Johann Fischer
ed6712fa23 samples: net: add configs for MCR20A
Add configs for MCR20A device to echo_server and echo_client.

Change-Id: Ic0e310c0eb2eefe6ce5752a20b0c079b7ea8757c
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Johann F
12306df1ad samples: ieee802154: add MCR20A
Add MCR20A to 802154 driver test application.

Change-Id: I18d4178668542c1da197d5a2b3b0b502c9b128c1
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
5e5b187371 net: samples: Fix config option
Only CONFIG_NET_SLIP_TAP will select SLIP, UART_PIPE,
UART_INTERRUPT_DRIVEN and SLIP_TAP. Otherwise apps will crash on
qemu.

Jira: ZEP-1617

Change-Id: Ibefbe708deb05e28b43ed4225211a5af655cec8d
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
5cf134f45a net: samples: Use lighter printk() instead of printf()
Use printk(), snprintk() instead of printf() and snprintf().
CONFIG_STDOUT_CONSOLE is anyway disabled by default so printf()
will not output anything without it.

Change-Id: Ide24e4d669e9821289189ed28e30a596120d9611
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:51 +02:00
Ravi kumar Veeramally
395ad208b1 samples: net: Add DHCPv4 sample application README file
Instructions to verify DHCPv4 client functionality in QEMU and
FRDM_K64F.

Change-Id: I623128186387c0c3237c8e759b949a3d0fde0993
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-27 12:35:50 +02:00
Andrei Emeltchenko
9e092b02e2 wpan_serial: Queue only full packet to RX queue
After queueing full packet to RX queue we set pkt_curr to NULL, if we
get right after that SLIP_END we shall check for pkt_curr to avoid
NULL pointer assignment.

Coverity-CID: 157574

Change-Id: I2be40a652867e73b4a1994f529dc21980ecb35b4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-27 12:35:50 +02:00
Vinicius Costa Gomes
3a666c54ce samples/zoap_server: Also listen on the unicast address
Some applications are not prepared for using multicast address and
specifying the interface, so it may be convenient for the user to be
able to use a unicast address when communicating with the
samples. This aligns this sample with most of the networking samples.

Change-Id: Ic97ea5a346a650751b6e2cbfefad25a3e700278c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-27 12:35:50 +02:00
Vinicius Costa Gomes
c36c3c2883 samples/zoap: Update zoap samples documentation
Samples instructions are to follow the rst format so they are
consistent with the rest of the documentation.

Change-Id: I37f06139484a4632e5b9c720ce1317feab68358b
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-27 12:35:50 +02:00
David B. Kinder
0621eda3a4 doc: fix wiki board reference back to web page
Add a label in the arduino 101 document for the flashing
bluetooth instructions, and link to that instead of the
wiki page (deprecated).

Change-Id: Ie39240cdf4881356f634d21ead1d7ae93ccd60a1
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-26 23:06:04 +00:00
Anas Nashif
11e3d97c99 doc: update bluetooth samples with pointers
Change-Id: I37b653d59f2297619fb92112a418cd2c1ff80cd4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-26 20:02:35 +00:00
David B. Kinder
a24de43f3d doc: fix broken link to board doc
Change hard url into :ref: to board documentation

Change-Id: I9d8a585bb0e7274cf3233eadac2e303cc98ef86a
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-26 19:37:43 +00:00
Maureen Helm
5d5b17b037 samples: fxos8700: Convert documentation to RST
Converts the fxos8700 sample documentation to RST format.

Change-Id: I26084fea4b0eb11d09cd75526c6c52e3fdd76dda
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-26 11:57:23 +00:00
Maureen Helm
1938f5dadb samples: fxos8700: Decimate sensor data before printing to the console
At the default sample rate of 400 Hz, there is not enough bandwidth on
the UART at 115200 baud to print every sample. Fix by decimating the
sensor data by 4 before printing to the console.

This issue was discovered after fixing ZEP-1507.

Change-Id: I451ec9873ca93fe417d5d5a2d6d13b5e921c7611
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-26 11:57:23 +00:00
Anas Nashif
3b8925099e Bluetooth: Move Bluetooth docs to rst
Change-Id: I36009f5acd4016ec47edb6dac29e81e58b1ba24f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-24 17:58:59 +00:00
Anas Nashif
12215b4185 Merge "Merge arm branch into master" 2017-01-24 03:01:03 +00:00
Ramesh Thomas
02f327df5d samples: power_mgmt: Convert README to RST format
Changed README to RST and updated the formatting.

Jira: ZEP-1537
Change-Id: I012854daff6883cf462a3cc0246c73a8767dcd66
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2017-01-23 15:32:41 -08:00
Maureen Helm
4279bf1c03 samples: net: Increase spi log level
Change-Id: Ic067a93c1e24c12c7e531b1df590be252cd2531b
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-23 15:15:54 -06:00
David B. Kinder
2cb045420c doc: fix .rst files canonical heading order
The headings on some .rst files were not following the expected
heading order of using # for h1, * for h2, = for h3, and - for h4
This patch fixes that, and the doc/templates/*.tmpl files created
for folks to use as templates for creating board and sample docs.

Change-Id: I0263b005648558d5ea41a681ceaa4798c9594dd9
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-01-20 16:06:36 -08:00
Anas Nashif
aaf7f7fb91 Merge "Merge net branch into master" 2017-01-20 15:23:09 +00:00
Bogdan Davidoaia
6460e7655d samples: sensor: fxos8700: use floating point for printing sensor values
Printing values as <integer_part>.<fractional_part> gives undesired
results for negative numbers, so print the values converted to floating
point to avoid this.

Change-Id: I871b8461f2d643a2adce67df064e9f5e6d506319
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-20 14:40:39 +00:00
Jukka Rissanen
007e231ff5 net: echo-server: Discard 0 byte received packets
If we receive 0 byte packets from the network, we need to
ignore those as otherwise it is possible to leak network
buffers.

Change-Id: Id4b5b0d03c0b6d1e16634ff2d1960ea4728c8aa1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:21 +02:00
Jukka Rissanen
011b22d64e net: echo-server: Use net_buf_frag_del() return parameter
Because net_buf_frag_del() returns the next fragment in the list,
we can use the return value which makes the code nicer looking.

Change-Id: Ic3d0155417b52a34bfbaa918570ff9af95aee468
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-01-20 16:23:21 +02:00
Andrei Emeltchenko
4a24192529 wpan_serial: Fix possible NULL pointer dereference
Return and clean buffer when fragment can not be allocated.

Coverity-CID: 157590

Change-Id: Ic8844609da4049623a6cf0c2ae037b2b777542e9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-20 16:23:21 +02:00
Ravi kumar Veeramally
724aa3ffbd net: samples: Print assigned address from DHCPv4 server
Print assigned address and other information if client receives
anything from server. E.g. subnet, lease time and router.

Change-Id: I759d59522930401766452eb1fb3d57d1a8295a67
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-20 16:23:21 +02:00
Ravi kumar Veeramally
9b68f18ffb net: samples: Add ENC28J60 pin numbers to documentation
ENC28J60 has numbers on the board. Documentation has information about
signals only. Wiring will be easy with pin numbers.

Change-Id: I0afd6058a9417b679ef6358304737bf256aa3522
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-20 16:23:20 +02:00
Luiz Augusto von Dentz
0918a903b1 net: zperf: Add bluetooth support
Change-Id: I56f2000cef929d5d0ddae0d67bc222d20db06480
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-20 16:23:20 +02:00
Luiz Augusto von Dentz
862b8dcfc6 net: zoap-client: Add bluetooth support
Change-Id: I9bef7f176deca6476e20d97d547b8d91ffc62c83
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-20 16:23:20 +02:00
Tomasz Bursztyka
d9b30d3029 samples: net: Enable buffer warning and errors in echo apps on qemu
These logs are mandatory to spot buffer leaks. Unfortunately, they are
still not detailed enough to spot the actual place where the leak
happen.

Change-Id: If36dfa7a54aa1546fb268301f369b5ecd046e276
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-20 16:23:19 +02:00
Tomasz Bursztyka
c2ed1c1aee samples: net: Fix a format issues in echo_client
To avoid a build warning.

Change-Id: Ic6349c6867f04f5827923a070e8e615ca3bead94
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
ec7d09eccc samples/zoap_server: Do not error if there's no payload or queries
In case of a GET request do not error if there's no payload or queries
parameters.

Change-Id: I29b2225700c83a8a2dad166146288dd55bd8f3de
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
bc70a39ac6 samples/zoap-server: Add support for the "location-query" resource
This resource verify the capability of the server to send a response to
a POST including a Location-Query option.

Change-Id: I4b663e813eb713d7e93a3c2f8cfd58c335b24cde
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
6f57867654 samples/zoap_server: Include a path for the "created" resource
The CoAP test suite expects a specific path included in the
Location-Path option in the response.

Change-Id: Ib7616f9ad318fa93dc862f686429edb5084306e3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
e44dfffba2 samples/zoap_server: Add Content-Format options to GET responses
The Californium tests expects that all GET responses include the
Content-Format information of the response. In our case, all responses
are of type plain-text.

Change-Id: I08844825f31ed8f4c54020a41b9172cef5da6d70
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
0eaeaf2481 samples/zoap_server: Add support for messages with token
So the sample zoap server application is more conformant, include the
token from the request, if any, in the response.

Change-Id: I5aacc1a3f81ebeaf473d327163c952b829489b01
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
db049395f1 samples/zoap_server: Fix responding messages with the wrong type
The Californium test suite considers an error responding a NON_CON
request with a ACK response, even if the spec says it is valid, so add
support for using the correct type of response according to the
request.

Change-Id: I211c8a135b8db83af442a1d645b7ea0826dbbdec
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:19 +02:00
Vinicius Costa Gomes
0e7b9adc5f samples/zoap_server: Add resouce for TD_COAP_BLOCK_03
This allows to verify that the CoAP server is able to handle a
blockwise PUT request.

Change-Id: I801e353a27b10a5266748591d023bcb607db6bb4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:18 +02:00
Vinicius Costa Gomes
6429b1bf2b samples/zoap_server: Add support for blockwise GET tests
This adds support for TD_COAP_BLOCK_01 and TD_COAP_BLOCK_02 tests,
which test that the CoAP server is able to handle GET requests with
blockwise tranfers.

Change-Id: Id0d1703adcf5d4e76dd1bc489c8bcc94a3fd90bc
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:18 +02:00
Vinicius Costa Gomes
bcc8f819e1 samples/zoap_server: Add support for the '/separate' resource
This resource is used to verify that the CoAP server is able to send
responses in two steps: 1. only acknowledge that the request was
received and is going to be handled; 2. The actual response, with the
payload.

Change-Id: Ia77cc0ee9805e6cc120c57f4598c68ad364882a0
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-20 16:23:18 +02:00
Ravi kumar Veeramally
0f6990ac4d samples: net: Fix DHCPv4 config options and run on its own thread
DHCPv4 sample was running on main stack. Updated to run on its own
thread. Update config options (removed unnecessary ones and separated
few options for easy readability).

Change-Id: I3be38ca4cd4bcfa62e2613b90b104679cff2517e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-01-20 16:23:17 +02:00
Flavio Santes
4d93ebf9ec samples/net: Remove legacy configuation variables
This patch removes legacy configuation variables found at the
prj_arduino_101.conf file of the DNS sample application.

Change-Id: I74e370a7be177f809d805525cc18f594a59e38c0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-20 16:23:17 +02:00
Flavio Santes
1c21029237 drivers/ethernet: Update default GPIO pin for the ENC28J60 module
All sample applicatons in Zephyr, using the ENC28J60 driver, set
the ETH_ENC28J60_0_GPIO_PIN Kconfig variable to 19.
However, in the Kconfig.enc28j60 file this variable is set to 24.
That default value, 24, was used only during the first iterations
of this driver and never used again.

In this patch, we set the Kconfig variable to 19 and simplify
project configuration files by removing one line.

Change-Id: I3d5fd9da04a3f10845d2a409de56f5b9c235e995
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-20 16:23:17 +02:00
Flavio Santes
06286f93aa samples/net: Remove redundant configuration variable
Remove CONFIG_GPIO=y for the Arduino 101 board. This configuration
is now set by default in the board configuration file.

See commit 8f96628064.

Change-Id: I6fa73a5785d78c51f03a0af48fc2aa8cc7636c7d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-20 16:23:17 +02:00
David B. Kinder
ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Johan Hedberg
eccf03265f Merge bluetooth branch into master
- New SPI HCI driver for ST BlueNRG modules
 - More memory optimizations through TX buffer pool consolidation
 - Refactoring to take advantage of new IS_ENABLED() macro
 - Fixes to LE L2CAP Credit-based Flow Control
 - Various smaller fixes & enhancements here and there

----------------------------------------------------------------
Arkadiusz Lichwa (2):
      Bluetooth: UUID: Fix format specifier in 128-UUID
      Bluetooth: ATT: Fix redundant sys_slist call

Arun Jagadish (1):
      Bluetooth: AVDTP: Added params to AVDTP Request structure

Carles Cufi (1):
      bluetooth: hci_core: Fix conn params validity check

Jaganath Kanakkassery (1):
      Bluetooth: RFCOMM: Implement Aggregate Flow Control

Johan Hedberg (21):
      Bluetooth: Consolidate most outgoing ACL TX buffers into a single pool
      Bluetooth: Use the controller bt_rand() whenever possible
      Bluetooth: Controller: Rename hci_le_rand to bt_rand
      Bluetooth: hci_uart: Remove redundant idle & ISR stack size values
      Bluetooth: Remove unused bt_hci_driver_unregister() API
      Bluetooth: Add missing documentation to HCI driver APIs
      Bluetooth: GATT: Fix missing connection address comparison
      Bluetooth: ATT: Add new error code from CSSv7
      Bluetooth: Prefer struct bt_le_conn_param over individual values
      Bluetooth: Add documentation for connection callbacks
      Bluetooth: Remove ACL details from BT_BUF_RX_SIZE
      Bluetooth: L2CAP: Remove RECV_RESERVE from BT_L2CAP_RX_MTU
      Bluetooth: Introduce a new connection parameter request callback
      Bluetooth: Take advantage of IS_ENABLED macro for BT_DBG
      Bluetooth: Add __printf_like annotation for bt_log
      Bluetooth: drivers/nble: Remove bogus BT_DBG manipulation
      Bluetooth: hci_core: Take advantage of IS_ENABLED whenever possible
      Bluetooth: conn: Take advantage of IS_ENABLED whenever possible
      Bluetooth: L2CAP: Take advantage of IS_ENABLED whenever possible
      Bluetooth: SMP: Take advantage of IS_ENABLED whenever possible
      Bluetooth: Don't select TinyCrypt RNG for combined builds

Lee Jones (5):
      pinmux/stm32l4: Add support for STM32L SPI1 and SPI3
      pinmux/nucleo_l476rg: Define pinmuxing for SPI1 and SPI3
      Bluetooth: Add HCI SPI driver
      Bluetooth: samples/beacon: Print message at start of sample
      Bluetooth: Kconfig: Specify stack size for Bluetooth SPI

Luiz Augusto von Dentz (4):
      Bluetooth: L2CAP: Fix using CONFIG_BLUETOOTH_RX_BUF_LEN as MTU
      Bluetooth: IPSP: Reuse buffer fragments instead of copying
      Bluetooth: L2CAP: Make sure state is correctly updated
      Bluetooth: L2CAP: Fix always using RX_BUF_COUNT as initial credits

Sathish Narasimman (1):
      Bluetooth: AT: Rename enum at_cmd_type elements

 drivers/bluetooth/hci/Kconfig                   |  81 +++
 drivers/bluetooth/hci/Makefile                  |   1 +
 drivers/bluetooth/hci/h4.c                      |   8 +-
 drivers/bluetooth/hci/h5.c                      |   8 +-
 drivers/bluetooth/hci/spi.c                     | 351 ++++++++++++
 drivers/bluetooth/nble/conn.c                   |   8 +-
 drivers/bluetooth/nble/gap.c                    |  13 +-
 drivers/bluetooth/nble/gatt.c                   |   8 +-
 drivers/bluetooth/nble/rpc_deserialize.c        |  27 +-
 drivers/bluetooth/nble/rpc_serialize.c          |   5 -
 drivers/bluetooth/nble/smp.c                    |   3 +-
 drivers/bluetooth/nble/uart.c                   |   6 +-
 drivers/bluetooth/nrf51_pm.c                    |   1 +
 .../pinmux/stm32/pinmux_board_nucleo_l476rg.c   |  12 +
 drivers/pinmux/stm32/pinmux_stm32l4x.h          |  10 +
 include/bluetooth/att.h                         |   1 +
 include/bluetooth/buf.h                         |   1 -
 include/bluetooth/conn.h                        |  81 ++-
 include/bluetooth/l2cap.h                       |   2 +
 include/bluetooth/log.h                         |  40 +-
 include/drivers/bluetooth/hci_driver.h          | 106 +++-
 samples/bluetooth/beacon/src/main.c             |   2 +
 samples/bluetooth/hci_uart/nrf5.conf            |   2 -
 samples/bluetooth/ipsp/src/main.c               |  35 +-
 subsys/bluetooth/controller/hal/nrf5/rand.c     |   2 +-
 subsys/bluetooth/controller/hal/rand.h          |   2 +-
 subsys/bluetooth/controller/hci/hci.c           |   4 +-
 subsys/bluetooth/controller/hci/hci_driver.c    |  18 +-
 subsys/bluetooth/controller/hci/hci_internal.h  |   1 -
 subsys/bluetooth/controller/ll/ctrl.c           |   1 +
 subsys/bluetooth/host/Kconfig                   |  63 ++-
 subsys/bluetooth/host/a2dp.c                    |   7 +-
 subsys/bluetooth/host/at.c                      |  38 +-
 subsys/bluetooth/host/at.h                      |  10 +-
 subsys/bluetooth/host/att.c                     |  65 +--
 subsys/bluetooth/host/att_internal.h            |   6 +
 subsys/bluetooth/host/avdtp.c                   |  24 +-
 subsys/bluetooth/host/avdtp_internal.h          |  10 +-
 subsys/bluetooth/host/conn.c                    | 157 +++---
 subsys/bluetooth/host/conn_internal.h           |   4 +-
 subsys/bluetooth/host/gatt.c                    |  12 +-
 subsys/bluetooth/host/hci_core.c                | 504 +++++++++---------
 subsys/bluetooth/host/hci_core.h                |   5 +-
 subsys/bluetooth/host/hci_ecc.c                 |  11 +-
 subsys/bluetooth/host/hci_raw.c                 |   8 +-
 subsys/bluetooth/host/hfp_hf.c                  |   6 +-
 subsys/bluetooth/host/keys.c                    |   6 +-
 subsys/bluetooth/host/keys.h                    |   4 -
 subsys/bluetooth/host/keys_br.c                 |   6 +-
 subsys/bluetooth/host/l2cap.c                   | 108 ++--
 subsys/bluetooth/host/l2cap_br.c                |  32 +-
 subsys/bluetooth/host/l2cap_internal.h          |   8 +-
 subsys/bluetooth/host/log.c                     |   2 -
 subsys/bluetooth/host/monitor.c                 |   1 -
 subsys/bluetooth/host/rfcomm.c                  | 148 ++++-
 subsys/bluetooth/host/rfcomm_internal.h         |  15 +
 subsys/bluetooth/host/sdp.c                     |   6 +-
 subsys/bluetooth/host/smp.c                     | 211 ++++----
 subsys/bluetooth/host/smp_null.c                |   7 +-
 subsys/bluetooth/host/storage.c                 |   1 +
 subsys/bluetooth/host/uuid.c                    |   2 +-
 tests/bluetooth/shell/arduino_101.conf          |   2 +-
 tests/bluetooth/shell/prj.conf                  |   2 +-
 63 files changed, 1479 insertions(+), 852 deletions(-)
 create mode 100644 drivers/bluetooth/hci/spi.c

Change-Id: Ic11028e1f02636a48d95cbe03735af37cea94e25
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-18 19:09:51 +02:00
Lee Jones
65cd08d925 Bluetooth: samples/beacon: Print message at start of sample
This is very handy for debug purposes.  It provides us with a reassurance
that at least something is happening, even if initialisation does not
complete (hangs forever).

Change-Id: I6ac1bfec84f8a6694f82d14fdc5d2a27aa1fc634
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2017-01-18 12:24:28 +00:00
Marcus Shawcroft
033b5e9a7d echo_server: Remove unnecessary config from prf_frdm_k64f.conf
The k64f has a random driver the TEST_RANDOM_GENERATOR config is not
necessary.

Change-Id: I73bc4076cac459388d9dd9bf3eb89c8cb5ba7db7
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-17 21:47:32 +00:00
Anas Nashif
3a0ae29991 samples: legacy: enable legacy kernel
Also remove dependency on STDOUT_CONSOLE, it is not being used.

Change-Id: Ib7488b1e2df3892c1daa2e12da05fcc1266ac9aa
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:40 +00:00
Anas Nashif
ae7df93a77 net: zoap_client: fix usage of legacy APIs
Change-Id: Ic3df2fb50897bd07c47ef987698c7fcaadcb6575
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:35 +00:00
Anas Nashif
6b65dcefd2 legacy: Move TICKS_UNLIMITED -> K_FOREVER
Change-Id: Ic1e73959a3444bc6e015e341899c75b1ef850189
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:35 +00:00
Anas Nashif
b52a5450b0 legacy: use k_cycle_get_32 instead of legacy sys_cycle_get_32
Jira: ZEP-1585
Change-Id: Idac4685625f191771b90ce78234d97f5143413f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:34 +00:00
Luiz Augusto von Dentz
d627509185 Bluetooth: IPSP: Reuse buffer fragments instead of copying
The original buffer fragments can be used to send back a reply directly
since Bluetooth doesn't add anything to then.

Change-Id: Ifeac0e6c3abbd527c79912abc5f5b833b0b52171
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-17 15:37:03 +02:00
Benjamin Walsh
ecd209fb16 samples/philosophers: enable demo to run in coop/preempt-only modes
Change-Id: I2ca420767c2744766edb4dcaf5256dcd21e8270a
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
2017-01-17 12:17:27 +00:00
Johan Hedberg
6ddf827d88 Bluetooth: hci_uart: Remove redundant idle & ISR stack size values
The idle stack already defaults to 256. The ISR stack size of 640 was
intended to make the app fit on 16k nRF51 variants and is now the
default, i.e. it doesn't need to be explicitly set anymore.

Change-Id: I8db3c080e1f84c65b27f931fa48c75bd90a2d3cd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-17 08:44:21 +02:00
Flavio Santes
876f751cde samples/net: Improve text indentation and clarify some instructions
HTML documentation shows misaligned text that may be a bit confusing.
This issue was caused by wrong indentation. Furthermore, board specific
instructions to build the image does not include any instruction header.

This commit fixes the above described issues.

Change-Id: Ie965e09f32f46a9d69aac28c4b389084f06b31b6
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-17 02:45:41 +00:00
Anas Nashif
0ad13320cd doc: application porting guide to the unified kernel
Change-Id: I463b50336f6438ed5dc4ae60bf0d3f7b6e1118a5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 18:13:03 -05:00
Anas Nashif
567c294608 samples: doc: remove 'make pristine', it is not needed
Replace 'make qemu' with 'make run'

Change-Id: I62a8ff30ecf713fe2d2fd27d4de321265d9bb3f7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 18:13:03 -05:00
Anas Nashif
430e8e9730 boards: add arduino_due board documentation
Change-Id: Id98671fd0a1e6eddd8368123c60f1452b84f8fde
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 18:13:03 -05:00
Anas Nashif
9811d2bc36 samples: dtls: Fixed layout and titles in documentation
Also fixed typo DLTS -> DTLS

Change-Id: I640afa58841eda48a8b87eb62951daa85fe85c07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 14:04:20 -05:00
Anas Nashif
43b9e7dfe1 net: doc: add section about networking with qemu
Change-Id: I478231b6932c379201deaf4e1ca9ff57b43bd05f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-16 14:04:20 -05:00
Bogdan Davidoaia
d4efb9a21f samples: thermometer: use convert to double function from sensor.h
Remove the convert_to_double function and use sensor_value_to_double
from sensor.h.

Change-Id: I92ef4219057f431917f4c8e9d46d4ee2074b423b
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-16 13:15:14 +00:00
Bogdan Davidoaia
30162aedf1 sensor: remove sensor value type
Remove the type field from the sensor value structure. All values will
have the type previously defined by SENSOR_VALUE_TYPE_INT_PLUS_MICRO.

This simplifies the interface, as apps will know what value type to
expect. Apps that prefer to use double values can optain them using the
sensor_value_to_double function.

Change-Id: I3588d74258030eb16c3f89d8eead13cca4606b18
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
2017-01-15 01:09:33 +00:00
Luiz Augusto von Dentz
fb5ea68762 net: zoap_server: Enable connecting with bluetooth
Change-Id: Iae05264f8677afb49c5060c13ad3e89c86c89929
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 17:05:53 +00:00
Luiz Augusto von Dentz
5ea0612f69 net: echo_client: Enable CONFIG_NET_L2_BLUETOOTH_SHELL in prj_bt.conf
This makes it possible to setup a Bluetooth connection using net_bt shell
commands.

Change-Id: Ie4ae7e61345315ef987a00b6b5a28c0419f6b1c8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:37:53 +00:00
Luiz Augusto von Dentz
a70c65d6ff net: echo_client: Don't start sending packets if interface is not UP
If the interface is not UP wait for MGMT event if that is enabled.

Change-Id: I4866c23d1e6f5b1a7cf212434d794673d7e756ce
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:35:55 +00:00
Luiz Augusto von Dentz
04aaab61ca net: echo_client: Fix using CONFIG_NETWORKING_WITH_BT
CONFIG_NETWORKING_WITH_BT no longer exist, instead
CONFIG_NET_L2_BLUETOOTH shall be used.

Change-Id: Ide353b7620228e431c535768b37749994caf8e8b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-13 14:35:42 +00:00
Tomasz Bursztyka
4695e895c8 samples: net: Fix dhcpv4 building with net mgmt event support
It was missing for arduino_101.

Jira: ZEP-1574

Change-Id: I08fc0961b94f5f7b1b787ebf52e7d9922e38006c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-13 11:38:17 +01:00
Andy Ross
96294b79a7 net: tcp: Signal EOF with a NULL buffer in the callback
TCP didn't actually have a way to signal synchronous receipt of a FIN
packet.  Extend the recv_cb API to allow a NULL buf argument with
status==0 (by analogy to Unix's zero-length read) to signal EOF.

Update docs too, and also echo_server which wasn't prepared to handle
this situation.

Change-Id: I7dc08f9e262a81dcad9c670c6471898889f0b05d
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2017-01-13 10:29:03 +01:00
Kumar Gala
0f2ce02abe net: Remove NET_SLIP choice from Kconfig
The NET_SLIP Kconfig choice option doesn't really do anything for us,
plus we get warnings related to setting CONFIG_NET_SLIP=y in prj.conf
files.

Warnings like:

warning: override: reassigning to symbol NET_SLIP
warning: override: NET_SLIP_TAP changes choice state

So remove NET_SLIP choice and remove CONFIG_NET_SLIP=y in the prj.conf
files.

Change-Id: Ibccf9cf167f4c8a4df480ca0396bf83fcf60df1e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-13 10:29:02 +01:00
Sergio Rodriguez
61ac519e1b samples/mbedtls_dtlsserver DTLS server example app using mbedTLS
Jira: ZEP-1534

Change-Id: Ia4b8bf00182c6281144a44a55b0b45354c1b234d
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
1452eba464 samples/mbedtls_dtlsclient: IPv6 client version
Change-Id: Ifff5afc78ca9a84f62890b7c0d5f57ca30b432b9
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
79aee2e002 samples/mbedtls_dtlsclient: Remove hardcoded IP adresses
Change-Id: I0269809b12881fa32fdd231056c5515ee6c30bc7
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
3940d9d645 samples/mbedtls_dtlsclient: Change Readme files to rst format
Change-Id: Ibf38dc7166687e248cd2ef37d63a67a67f338f28
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Sergio Rodriguez
5d82bc7599 samples/mbedtls_dtlsclient: Using printk instead of printf
Change-Id: Ie6026d261229f16814d9fa0c3477e01c5b8b8de2
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2017-01-13 10:29:01 +01:00
Tomasz Bursztyka
c9a250db11 samples: net: Echo apps need different IP to be able to work
Change-Id: I8d630a568e6520e259b35a4048774355488084c1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-13 10:29:00 +01:00
Johann Fischer
1f6e8cab32 samples: ieee802154: rename cc2520 to hw
Rename cc2520 directory to hw and use it as generic
test application for the 802154 hardware driver.

Change-Id: I1c21505b7eb295279190f011a99c80e762178730
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-13 10:29:00 +01:00
Johann Fischer
ce189f84a9 ieee802154: conf: add common log level
Add common log level for all IEEE802154 drivers.

Change-Id: If92c96b14e630d4482aadf9cacb25662d6663399
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2017-01-13 10:29:00 +01:00
Flavio Santes
cfe4c2cebb samples/net: Update DNS client README file to RST format
Reformat and consolidate the samples/net/README and dns_client/READMExxx
files according to the RST spec.

Change-Id: I735190245204854ac5527e18971cc4c6478423e5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
38594021d6 samples/net: Update the zperf/README.rst file
Update the zperf/README.rst file with the following information:

- Homogenize the usage of "zperf", "iPerf" and "Zephyr"
- Update the Supported Boards section
- Clarify some instructions
- Add the Requirements section

Change-Id: Idfb29e2a5db9a78c19a6a27923f134583ebe5822
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
447796f4f2 samples/net: Rename prj conf files to avoid breaking the build
Rename the project configuration files to pass the build.

The Makefile specifies the following format for the conf file:
prj_BOARD_PROF.conf. However, there are two files with the
following format: prj_BOARD_IFACE_PROF.conf. So, rename them
to avoid build errors.

Change-Id: I75e0d4169db881583b5f9a2b67deee46f66b6c97
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
24c80faa9c samples/net: Update zperf Makefile
Remove commented line in the zperf/Makefile file.

Change-Id: Id869f21e923d3bb39fc31c5216ce29d78a0e1805
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:29:00 +01:00
Flavio Santes
9aa5919dbf samples/net: Update DNS logging info
Remove a blank space.

Change-Id: Ia4028cc26ea0f4fc742ae6232f46a5eb242faeb9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:28:59 +01:00
Flavio Santes
bb542d6b11 samples/net: Remove legacy reference in Makefile
Remove the reference to CONFIG_NET_UIP in src/Makefile.

Change-Id: I960413c17496c4b70b9c171a54ccfca4951b858b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-13 10:28:59 +01:00
Anas Nashif
a1ae7f565b Merge "Merge arm branch into master" 2017-01-12 18:23:39 +00:00
David Brown
016e7b2de6 samples: task_profiler: Be explicit about python
Update these scripts to explicitly call out python version 2.  Some
distributions have started making /usr/bin/python version 3, and other
distros have expressed a desire to do the same.

Also use the

  #!/usr/bin/env python2

construct instead of an explicit path so that the user can more easily
use their own python install by just placing it earlier in the path

Jira: ZEP-1548
Change-Id: I36dccc652353ba8bd58c483dba3ce61d3643de00
Signed-off-by: David Brown <david.brown@linaro.org>
2017-01-12 10:28:17 -07:00
Maureen Helm
4f5c2702da samples: net: Use mcux pinmux driver for frdm_k64f_cc2520 projects
Sample projects that pair the frdm_k64f board with a cc2520 require
additional pinmux settings beyond the standard frdm_k64f pinmux. These
settings used the private k64 pinmux API rather than the public pinmux
API.

Because the mcux pinmux driver now always supports the public pinmux API
(vs. the k64 pinmux driver which only supported it in pinmux dev mode),
we can convert the frdm_k64f_cc2520 projects to use the public pinmux
API and the mcux pinmux driver.

Change-Id: Idfae8393171b007d8629e34bfae64255f55c6792
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:27 -06:00
Maureen Helm
362bdaabeb samples: net: Remove support for the k64 gpio driver
Jira: ZEP-1394
Change-Id: Ib9435109175540e3e2a3ece310e068667e398821
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:27 -06:00
Maureen Helm
1ca06fc9dc samples: net: Add support for the mcux gpio driver
Jira: ZEP-1394
Change-Id: Iff8fc2f10779131e361968ce16e82b248a9e3c17
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:27 -06:00
Maureen Helm
c294ff06f6 samples: net: Remove unnecessary eth_ksdk project settings
Removes unnecessary CONFIG_ETH_KSDK project settings from the net
samples. Some of the configs no longer exist (MAC0-2), some are not
valid (MAC3-5) due to RANDOM_MAC=y, and the rest are already enabled by
default by the SoC and board.

Change-Id: I27079b8bb142ebc507885f3b1de07e282c813506
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-12 09:46:26 -06:00
Anas Nashif
f1d0c2b0ad shell: add stacks command
Change-Id: Ibefface37c38749043602bce29317a315d0b53fd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-11 20:47:10 +00:00
Anas Nashif
36c5167b72 shell: add tasks command to kernel module
Change-Id: I67c497c04e3c92a7f55cc5d95d7d3cfea414b4d8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-11 20:47:09 +00:00
Punit Vara
959988662f samples: basic: Move pwm driver samples
This patch moves pwm driver samples to samples/basic and also convert
documentation of PWM samples to RST.

Jira: ZEP-1536
Change-Id: Ib2b3ff8b1722a26618e9a6fe416e2138d82ca28b
Signed-off-by: Punit Vara <punitvara@gmail.com>
2017-01-11 15:15:31 +00:00
Anas Nashif
eeb6a30f29 samples: apds9960: move under sensors and update docs
Change-Id: I8e5735f15dbba5b9fead8f677104843a947b28ca
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-11 12:24:58 +00:00
Anas Nashif
2bc9d69981 build: abstract emulation and replace qemu goal with run
This will replace the current goal of 'make qemu' with 'make run' and
moves Qemu handling into its own file and into the boards instead of
being architecture specific.

We should be able to add new boards that support some other type of
emulation (by adding scripts/Makefile.<emu type>) and allow the board to
define their own options for the use type of emulation.

'make qemu' will still work, however it will be deprecated, starting
with this commit it is recommended to use 'make run'.

Jira: ZEP-359
Change-Id: I1cacd56b4ec09421a58cf5d010e22e9035214df6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 20:20:47 +00:00
Anas Nashif
7cf2bfe466 boards: add quark_d2000_crb documentation
Change-Id: Idb4ed43c8639cee2673dff24b18ff2ccd76a1396
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-10 02:45:55 +00:00
Kumar Gala
d19910f685 samples/tests: reduce ram & code size for failing tests on nRF5x boards
These samples/tests fail to build on some of the nRF5x platforms.  We
don't need Bluetooth enabled for these tests so we can reduce footprint
by turning it off.

Change-Id: I87e62a1d70f80d2bc22414d6a9e591e36ad9fa06
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-10 02:23:23 +00:00
Anas Nashif
70a2e138b7 kernel: add LEGACY_KERNEL option
Add global option for legacy configurations and enable by default for
backward compatibility. Disable option on tests and keep it on legacy
samples and tests.

Jira: ZEP-964
Change-Id: I0831e2aa74d438b1ac74eb762186cb220a504beb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-09 19:42:13 +00:00
Anas Nashif
d8629bfc01 samples: disco: fix links to boards in README
Change-Id: Ic85eefb2de0afcae1bf2ca68cb2eef9b8f2d7bb9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-09 16:20:05 +00:00
Jithu Joseph
89f4bf7c7e subsys: disk: Refactor disk_access stuff into a directory
Disk IO functions are used by both FS and USB Mass Storage.
This patch refactors those from FS directory to a separate one.
In addition existing, config options were modified to make
stuff meaningful.

Jira: ZEP-1276

Change-Id: Ia2a2e18f3dbbbdb964c3dc0427d8138ad86134cd
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-01-08 20:58:05 +00:00
Anas Nashif
f6e039062a kernel: remove dependency on CONFIG_NANO_TIMERS/TIMEOUTS
Remove legacy option and use SYS_CLOCK_EXISTS where appropriate.

Change-Id: I3d524ea2776e638683f0196c0cc342359d5d810f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-08 18:09:52 +00:00
Marcus Shawcroft
f0da59b062 sensor: Fix samples that assume incorrect sensor_value type.
Various sensor samples are hardwired to expect returned sensor values
are represented as doubles.  In each case this assumption is incorrect.

Introduce a generic sensor_value to double helper function and adjust
the samples to use it.

Change-Id: I89c788686576562b84e07a36064640231340c33b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-08 16:16:15 +00:00
Anas Nashif
e54e66a3d0 doc: add template for sample documentation
Change-Id: I2396f4f95d5ad9abd7ca9a718e0d16bba86a437e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-08 08:48:16 -05:00
Anas Nashif
a1d7794647 samples: minor documentation tweaks
Change-Id: I9efe25dbc808c635d895ffe2893afb68f4088ad1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 18:49:24 -05:00
Anas Nashif
fc6137001b doc: move documetnation context to root directory
This will allow inclusion of documentation files that exist outside of
doc/ and will make it possible to add rst files across the tree,
especially for boards, samples and tests.

Change-Id: I7afcf92d99f504b2bc0b2b7e3452acb2f8e08294
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 22:51:31 +00:00
Anas Nashif
eaa06ac40a net: do not skip sanitycheck on samples
Change-Id: I781a908ad998211b34d5f05f53fbf3471e6b9f1b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 22:08:14 +00:00
Anas Nashif
a6997bbc17 samples: sensors: fix documentation layout of MCP9808 sample
Change-Id: Iab5426a0689fd7ac22933e3c61e22d217af7f067
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 16:32:31 -05:00
Anas Nashif
813df21713 samples: sensors: fix documentation layout of TH02 sample
Change-Id: I140fdd96eea74aaeb0216829024a46f2430fc9c6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 16:32:31 -05:00
Anas Nashif
a2e7706140 samples: disco: convert to rst and expand documentation
Change-Id: I1252e3d95aaee877fa7f8bb4768e07ec75f8769a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 16:32:31 -05:00
Anas Nashif
2b72ff397c samples: button: convert to rst and expand documentation
Change-Id: I8839d565325659ec1c00c9eb513a4dfa29cd6e2d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-06 16:32:31 -05:00
Anas Nashif
4a7c46dc05 Merge "Merge net branch into master" 2017-01-06 21:19:58 +00:00
Benjamin Walsh
09a14d4173 samples: put philosophers stacks in noinit section
Change-Id: Ic17d28ca9b27b2b0c4f9d82221e4d93750870b27
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2017-01-06 17:38:21 +00:00
Benjamin Walsh
4634871832 samples: speed up philosophers demo
Cut wait times by 4, in chunks in 25ms instead of 100ms. This allows to
see what is going on, but with much faster transitions, which makes the
demo slightly less boring.

Change-Id: I32fdd6e41a9af1fe9aa8a8f186de7945986b3a71
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2017-01-06 17:32:56 +00:00
Tomasz Bursztyka
53d8555430 Merge net branch into master
Main changes:

- MQTT improvements
- TCP fixes
- IEEE 802.15.4 RFD preliminary features (active/passive scan,
  association, disassociation), plus a dedicated "ieee15_4" shell
  module.

----------------------------------------------------------------
Andy Ross (3):
      net: tcp: Select correct source address for SYNACK packets
      net: tcp: Swap tcp->context backpointers
      net: tcp: Precompute appdata properly

Flavio Santes (14):
      net/protocols: Remove unnecessary assignement in Makefiles
      net/nbuf: Introduce the net_nbuf_linear_copy routine
      net/mqtt: Make input arguments const
      net/mqtt: Improve indentation
      net/mqtt: Use the right data type
      net/mqtt: Add missing function prototypes
      net/mqtt: Add the mqtt_rx_publish routine
      net/mqtt: Improve buffer error handling in mqtt_tx routines
      net/mqtt: Improve error handling in mqtt_rx_connack routine
      net/mqtt: Add the reception callback
      net/mqtt: Allow an MQTT publisher app to receive msgs
      net/mqtt: Allow an MQTT subscriber app to receive msgs
      net/dns: Introduce the qname_copy routine
      net/dns: Fix documentation issues

Leandro Pereira (4):
      net: tcp: Be more consistent with namespaces for private funcs
      net: tcp: Remove unused `retransmit_timer` field from `net_tcp`
      net: tcp: Store return value of net_buf_frags_len() on a size_t
      net: tcp: Use appdatalen when acknowledging packets

Luiz Augusto von Dentz (2):
      net: if: Add NET_IF_UP flag
      net: l2: Add enable callback

Maureen Helm (1):
      net: samples: Fix stale yaip references

Tomasz Bursztyka (15):
      net: event: Fix misplaced comment
      net: event: Notify on interface being put down or up
      net: ieee802154: Add grounds for passive scan
      net: ieee802154: Integrate beacon frame handling
      samples: net: ieee802154: Once cc2520 is up, let's initiate a scan
      net: ieee802154: Add PAN association request
      net: ieee802154: Integrate MAC Command frames handling
      net: ieee80215: Add Active Scan request
      net: ieee802154: Add PAN disassociation request
      net: ieee802154: Handle disassocation notification from PAN coordinator
      samples: ieee802154: Let's proceed with an active scan
      net: ieee802154: Fix logging primitive in mgmt part
      net: ieee802154: Expose basic network parameters through net mgmt API
      net: ieee802154: Add a shell module named 'ieee15_4'
      samples: net: Add IEEE 802.15.4 shell module on cc2520 sample

 include/net/dns_client.h                           |   7 +-
 include/net/ieee802154.h                           | 116 +++++-
 include/net/mqtt.h                                 |  60 +++-
 include/net/nbuf.h                                 |  16 +
 include/net/net_event.h                            |  21 +-
 include/net/net_if.h                               |  47 ++-
 include/net/net_l2.h                               |   9 +-
 samples/net/dhcpv4_client/src/Makefile             |   1 -
 samples/net/ieee802154/cc2520/prj.conf             |   6 +-
 .../net/ieee802154/cc2520/src/ieee802154_test.c    |  57 ++-
 samples/net/zperf/src/Makefile                     |   2 +-
 subsys/net/ip/ipv4.c                               |  14 +-
 subsys/net/ip/ipv4.h                               |   4 +-
 subsys/net/ip/ipv6.c                               |  16 +-
 subsys/net/ip/ipv6.h                               |   2 +
 subsys/net/ip/l2/bluetooth.c                       |  22 +-
 subsys/net/ip/l2/dummy.c                           |   2 +-
 subsys/net/ip/l2/ethernet.c                        |   2 +-
 subsys/net/ip/l2/ieee802154/Kconfig                |   9 +
 subsys/net/ip/l2/ieee802154/Makefile               |   1 +
 subsys/net/ip/l2/ieee802154/ieee802154.c           |  22 +-
 subsys/net/ip/l2/ieee802154/ieee802154_mgmt.c      | 390 +++++++++++++++++++++
 subsys/net/ip/l2/ieee802154/ieee802154_mgmt.h      |  66 ++++
 subsys/net/ip/l2/ieee802154/ieee802154_shell.c     | 289 +++++++++++++++
 subsys/net/ip/nbuf.c                               |  39 +++
 subsys/net/ip/net_context.c                        |  77 +++-
 subsys/net/ip/net_if.c                             |  89 ++++-
 subsys/net/ip/tcp.c                                |  33 +-
 subsys/net/ip/tcp.h                                |  10 +-
 subsys/net/lib/dns/Makefile                        |   2 -
 subsys/net/lib/dns/dns_client.c                    |  62 +---
 subsys/net/lib/dns/dns_pack.c                      |  66 ++++
 subsys/net/lib/dns/dns_pack.h                      |  22 ++
 subsys/net/lib/mqtt/Makefile                       |   2 -
 subsys/net/lib/mqtt/mqtt.c                         | 351 ++++++++++++++++---
 subsys/net/lib/mqtt/mqtt_pkt.c                     |  16 +-
 subsys/net/lib/mqtt/mqtt_pkt.h                     |   4 +-
 tests/net/tcp/src/main.c                           |  26 +-
 38 files changed, 1746 insertions(+), 234 deletions(-)
 create mode 100644 subsys/net/ip/l2/ieee802154/ieee802154_mgmt.h
 create mode 100644 subsys/net/ip/l2/ieee802154/ieee802154_shell.c

Change-Id: I72434b20cec53c004d7e7c03a24eab03a1d52c25
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 18:29:55 +01:00
Tomasz Bursztyka
20404131aa samples: net: Add IEEE 802.15.4 shell module on cc2520 sample
This is easier to test the 15.4 layer instead of hard-coding sample
logic.

Change-Id: I2376dec3dad9e2ceca3f61bd88bf5709f1bc1390
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 12:27:01 +01:00
Tomasz Bursztyka
db1ee31c04 samples: ieee802154: Let's proceed with an active scan
It's currently hard to find a Beacon enabled network. So let's switch to
active scan for now.

Change-Id: I192e7c3128f9488fb680ea7f23221b2b4aa52188
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:44 +01:00
Tomasz Bursztyka
792c29a376 samples: net: ieee802154: Once cc2520 is up, let's initiate a scan
It will print-out the results, if any.

Change-Id: If988a6dc3c4504a8d4aa947d3d3f949870b638c8
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-06 09:11:43 +01:00
Maureen Helm
87bc9eb010 net: samples: Fix stale yaip references
Fixes two references to yaip that were were left behind after net/yaip
was renamed to subsys/net/ip. The zperf sample needs net_private.h, so
the include path is updated. The dhcpv4_client sample doesn't need it,
so the path is removed.

Change-Id: I189f1b58191524330254a5b7b31a9a4974956728
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2017-01-06 09:11:43 +01:00
Anas Nashif
c0f0dd9734 samples: env sensing: restrurcture and cleanup docs
- move documentation to rst
- add a top level Makefile
- remove obsolete configurations

Change-Id: I8674b67e0383497cbbb0b6e861b78d8c7f7378a5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
6131ed2a01 doc: grove lcd: move to rst syntax
Change-Id: I3b8b1a8f0fc7732c88536ad2667257721dc743fd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
f562349231 doc: philosophers: move to rst syntax
Change-Id: Idc808f062853bc201c22e4c30f0e3687f055265d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
2e293c5172 doc: synchronization: move to rst syntax
Change-Id: I3f3868e213704f2d34ff06bd94d4d62d20881e4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
49bbc4d13d doc: hello world: move to rst and expand docuemntation
Change-Id: Id623dd8d2f97836c0f970424d06d9d549065f7c5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-05 19:56:37 -05:00
Anas Nashif
89e64ee446 Merge "Merge bluetooth branch into master" 2017-01-05 21:55:54 +00:00
Jean-Paul Etienne
1a3de7b4b6 samples: button: set EDGE to SW0_GPIO_INT_CONF if defined
SW0_GPIO_INT_CONF shall allow boards to define the
interrupt configuration for SW0 without having to modify
the button sample app.

If SW0_GPIO_INT_CONF is defined set EDGE to it, otherwise
used default EDGE value.

Change-Id: Ia697e06debc341463ed9cdee1db564f3727d27e3
Signed-off-by: Jean-Paul Etienne <fractalclone@gmail.com>
2017-01-05 16:35:47 +00:00
Carles Cufi
c2a2841212 bluetooth: hci_uart: Allocate 65 bytes for L2CAP packets
With LE Secure Connections the longest packet we require is 65 bytes
long: 64 bytes of Public Key data + 1 byte SMP opcode.
Extend the size of the L2CAP pool blocks so that they can fit such
packets and therefore one can use 70-byte
CONFIG_BLUETOOTH_CONTROLLER_TX_BUFFER_SIZE to achieve LE Secure
Connections pairing without HCI fragmentation.

Change-id: I2f11b4277ec5a24ceba79bccc7d84c64065b6e84
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2017-01-05 11:05:49 +00:00
Sathish Narasimman
55190c90a1 Bluetooth: samples: handsfree application indicator callback
Displays the present value of the indicators in the Handsfree
application.

Change-Id: I666ff2b15e70de8c1a26b902077d79c5c1a9d5fe
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2017-01-05 12:35:21 +05:30
Carles Cufi
4b7cdd499f bluetooth: Tune stack sizes after measuring with hci_uart
The following readings were obtained after running the peripheral and
central_hr apps in qemu combined with the controller (hci_uart) on nRF51
and nRF52:

Main Stack 380
Idle Stack: 68
ISR stack: 532
Controller RX Stack: 388
HCI TX Stack: 516

The numbers set in this change provide a safety margin from the ones
measured empirically.

Change-id: Ice7ad7f081502e0ea1accf856a7937c0bf0783b2
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Luiz Augusto von Dentz
aaf6bbf33c Bluetooth: ipsp: Port sample to native stack
This port ipsp sample to use the native stack so it can be used once
again.

Change-Id: I7975b017b0aa5bd81a1701692ec81527e39d4701
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2017-01-05 08:49:16 +02:00
Carles Cufi
aa150d6f56 Bluetooth: hci_uart: Disable HCI ECC commands temporarily
HCI ECC commands are causing freezes in the controller build. Until
further investigation is done disable them to avoid issues when running
the controller standalone.

Change-id: Ifab0fa362348b72e88adaa5250c914770e4a70ba
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Carles Cufi
80f000ab43 Bluetooth: Rename SEND_STACK to TX_STACK_SIZE
For consistency with RX_STACK_SIZE and the rest of stack sizes, rename
to use the normal naming scheme.

Change-id: Ib8d484482466fa8d629e6329e07b927abdd6f598
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-01-05 08:49:16 +02:00
Johan Hedberg
63f71adc5f Bluetooth: Take advantage of new net_buf_add_mem() API
This helps simplify code that was previously combining net_buf_add()
with memcpy().

Change-Id: If44cf9cd651aba5e544e36567869f147468663eb
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-01-05 08:49:16 +02:00
Anas Nashif
453432539e doc: samples: fix rst layout and use code-blocks
Change-Id: Ic55d66bbfa1df67824b47afe478dcdfbb886fc4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-04 12:24:11 -05:00
Anas Nashif
66cfcc26bc tests: introduce Makefile.test
To customise test builds and support test related features such as time
stamps and a boot banner, introduce a Makefile variant that is dedicated
to testing.

Initially we introduce a new config overlay that is used for all tests, in
this case we enable BOOT_BANNER and BUILD_TIMESTAMP. This will print the
current version and the date, useful when reporting bugs and also an
indicator that the system has booted before the test has started.

For example:

[QEMU] CPU: qemu32
***** BOOTING ZEPHYR OS v1.6.99 - BUILD: Dec 21 2016 19:57:13 *****
tc_start() - Test Nanokernel CPU and thread routines
Initializing nanokernel objects
...
..

Change-Id: I224318cdeb55a301964ea366dbc577e2e3a09175
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-03 17:48:44 +00:00
Anas Nashif
98f9b104cd Merge "Merge net branch into master" 2017-01-03 14:22:15 +00:00
Marcus Shawcroft
52e3eac4d5 Fixup indentation.
Change-Id: I5de6adb995d60e28d3765ef8cfd7de4ca4197d8a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-03 09:33:14 +00:00
Tomasz Bursztyka
a1aa08c288 net: ip: Improve logging by adding a dedicated sys_log level
Let's make net stack having its own level of debugging through sys_log.
It replaces NET_DEBUG by NET_LOG_ENABLED, which is then semantically
better: someone wanting to log the errors might want that not only for
debugging.

Along with it, CONFIG_NET_LOG_GLOBAL option is added, in order to enable
all available logging in network stack. It is disabled by default but
might be found useful when warning/errors need to be logged, so it is
then unnecessary to selectively enable by hand all CONFIG_NET_DEBUG_*
options.

It is possible, locally, to override CONFIG_SYS_LOG_NET_LEVEL by setting
the level one want to NET_SYS_LOG_LEVEL. This can be useful on samples
or tests.

Change-Id: I56a8f052340bc3a932229963cc69b39912093b88
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:20 +01:00
Flavio Santes
ac7300611c net: Restructure network protocols
This commit restructures the network protocols. Changes applied are:

- Move lib/iot/ to subsys/net/lib
- Move network protocol headers to include/net
- Move lib/iot/zoap/link-format.h to include/net/zoap_link_format.h
  and link-format.c to zoap_link_format.c
- Move tests/iot/ to tests/net/lib/
- Adapt sample code
- Adapt build system
- Modify doxygen paths

Change-Id: I37085fa4cc76a8a8e19a499ecb4e87b451120349
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-02 10:03:19 +01:00
Marcus Shawcroft
2fc5eb2f4c net/dhcpv4: Re-instate init_app()
Re-instate the init_app()call which was accidentally removed by commit
commit 34f9391c9cf5 ("dhcpv4: Report address acquisition.")

Change-Id: Ic5ef70fd855a5bcb3ea1171de652994db493f4bb
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:19 +01:00
Tomasz Bursztyka
cbd1609bf6 net: statistics: Provide specific Kconfig options
This will help to track only what's wanted (ipv6, tpc, udp, else...) if
needed to.

Change-Id: I5c2e5e582db629b5d0e1cd98004f693c50f532a4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:18 +01:00
Tomasz Bursztyka
0a1617365f net: buf: Change NET_BUF_DEBUG to NET_BUF_LOG and add a level option
It will be thus possible to enable only the error logging, or the other
sys_log levels.

Change-Id: I0c0ed789f7cfbb4811320e8f8249151288274873
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Tomasz Bursztyka
6158dfdda6 samples: net: STDOUT_CONSOLE is not necessary
printk can do the job properly.

Change-Id: Ib743328e046bdb29be26adfe5cd007aaa758cd64
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-01-02 10:03:17 +01:00
Marcus Shawcroft
eb2d16b2e4 net/dns: Drop unnecessary ETH_KSDK configuration.
Change-Id: I99712e04bfc455156751b70778aee24517eb6d6a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:17 +01:00
Marcus Shawcroft
0be2c3f57c samples/dhcpv4: Add missing NET_MGMT configury.
Add missing NET_MGMT configury for frdm_k64f, accidentally omitted
from: 5267ad94ed10c76b51c7fbba01143616d03e9178

Change-Id: I9a6da75f7a036182f44abe8207c7732030ab187e
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:16 +01:00
Flavio Santes
225dc3f660 samples/net: Fix logging format error
When building the echo_client sample app, the following warning
is found:

echo-client.c:37:
echo_client/src/echo-client.c: In function 'send_ipv4_data':
include/logging/sys_log.h:108:20: warning: format '%d' expects argument
                                  of type 'int', but argument 7 has
                                  type 'size_t' ...

So, this patch changes %d by %zu to remove that warning.

Change-Id: I8a3822bca6d5988e531684d647de93bd77aabf9b
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2017-01-02 10:03:16 +01:00
Vinicius Costa Gomes
65cf8c769a samples/zoap_server: Use the correct option for TAP
When using SLIP for TAP networking between guest and host, the correct
option is CONFIG_NET_SLIP_TAP. CONFIG_SLIP_TAP only enables it on the
SLIP side, it should be enabled on the networking stack, as well.

Change-Id: Ie1dacd07eb5a0891a572b08268a865f05a373690
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:16 +01:00
Vinicius Costa Gomes
6a0190befb samples/zoap_client: Use the correct option for TAP
When using SLIP for TAP networking between guest and host, the correct
option is CONFIG_NET_SLIP_TAP. CONFIG_SLIP_TAP only enables it on the
SLIP side, it should be enabled on the networking stack, as well.

Change-Id: I76226db9c587f1b5e9613244adab8f916ad94013
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2017-01-02 10:03:16 +01:00
Marcus Shawcroft
0637511e68 dhcpv4: Report address acquisition.
Use the network management interface to catch and report IPv4 address
acquisition in the application.

Change-Id: Idd1bcaac90fffbd617600a7713206599e547826f
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-02 10:03:16 +01:00
Andrei Emeltchenko
cdb8133cf5 samples: net: Add echo_client build test for frdm CC2520 configuration
Add build test to sanity_check to get a complex net app being built
for frdm-k64f.

Change-Id: Ib136f7964b65ad2167a3ed4484bff3bfe2a7ebad
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-01-02 10:03:16 +01:00
Anas Nashif
7297f5db88 shell: move shell to its own subsystem
This moves the shell component into its own subsys and groups all
related files and options into a single place.

Additionally, one Kconfig option will now be required to enable the
shell:

 CONFIG_CONSOLE_SHELL=y

The header files was also moved to include/shell/shell.h and can be now
referenced with

 #include <shell/shell.h>

instead of

 #include <misc/shell.h>

Updated documentation as well.

Change-Id: Iffbba4acfa05408055e9fd28dffa213451351f94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-25 19:35:11 +00:00
Anas Nashif
fad7e2dd8d logging: move event_logger to subsys/logging
Jira: ZEP-1337
Change-Id: If1690e19a882cf53caaa3418ccabeb49c783f63d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-25 14:34:43 -05:00
Anas Nashif
c1347b4730 kernel: replace all remaining nanokernel occurances
replace include <nanokernel.h> with <kernel.h> everywhere and also fix
any remaining mentions of nanokernel.

Keep the legacy samples/tests as is.

Change-Id: Iac48447bd191e83f21a719c69dc26233216d08dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-25 14:34:43 -05:00
Flavio Santes
953f7ae45d samples/basic/disco: Add support for Nucleo F401RE and A101
The README.txt file is updated with information about wiring
and building. A testcase.ini file is also added by this patch.

Change-Id: I7354d844ac3dec41f0c9af02ede5da26f3ad0398
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-25 19:16:37 +00:00
Anas Nashif
ef2dd99efb samples: fix path to sanitycheck script
Change-Id: Ic8fae0617faa6495a30bee09b5457a080924172c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-24 17:49:53 +00:00
Marcus Shawcroft
c66adc646d samples: Add random driver sample.
Change-Id: If0552cbd478e49c71bbfa02448113a3a0e3b4463
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-24 16:40:11 +00:00
Baohong Liu
0632bcac25 samples: bmi160: use correct spi dev name
The dev name for spi in the sensor sub-system was changed to
SPI_SS_x from SPI_x recently. Let's use the new name in the
sample app.

Change-Id: I78cdf21fce16290503c303e0de1432b4587486aa
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-24 13:35:43 +00:00
Anas Nashif
4b20b634be samples: fix RST syntax and add headers
Change-Id: Ic94213f97698bd861516de0bd159fb37f9124883
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-22 08:01:49 -05:00
Vinicius Costa Gomes
4085e26cdb samples/zoap-client: Fix using wrong addresses
The addresses used by the client were still made reference to the types
used by the old network stack.

Change-Id: Iaba919cb072e3295c9b371cc8fe493284c5b523b
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-22 02:14:50 +00:00
Baohong Liu
34f735fe60 samples: i2c_fram: update some comments
Change-Id: Ie86f50828df8c5c3f975024c2e3bc4254714fa3c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-22 01:21:54 +00:00
Sergio Rodriguez
71905be857 samples/mbedtls_sslclient: Using native IP stack
The legacy IP stack was removed from the source tree, so this changes
were made to adapt to the native IP stack, but this might not work on
the galileo platform due the ethernet driver not being tested on the
new stack on TCP, but to have the reference application ready when
it gets integrated

Jira: ZEP-1448

Change-Id: Ifa6ea0afb3bc532dfb92b09debbf6eee59e38a25
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-21 19:22:20 +00:00
Flavio Santes
d47abac73d samples: Add the ARG_UNUSED macro
Avoid compiler warnings by incorporating the ARG_UNUSED macro.

Change-Id: Iea567bf5f42d9f609bf68d171e0bc0e03b62b821
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:53 +00:00
Flavio Santes
3ec300fd94 shell: Init structure and add the ARG_UNUSED macro
The shell_cmd structure has three parameters and only two were
initialized. So, this commit initializes the remaining parameter
and also adds the ARG_UNUSED macro to avoid compiler warnings.

Change-Id: I667a4e9839ec5acd526df0bb465beb2062518315
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:53 +00:00
Flavio Santes
f57023934e samples/net/echo_client: Add ARG_UNUSED
Add ARG_UNUSED to some function parameters to avoid
compiler warnings.

Change-Id: I5db5bc536f1eeb084e08d2fbe4a8b0a8456e67a5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-21 12:54:50 +00:00
Anas Nashif
3dc9eb00cf net: remove obsolete net_testing.h
Change-Id: I75dff74912320a9b623667a53dc8e2b617f17572
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-20 13:31:38 -05:00
Yossi Havusha
bdd2e0145c samples/logger-hook: fix ring buffer usage and initialize variables.
1. Fix ring buffer usage according to suggestion in ZEP-1449
2. Redo fix variable initialization for CID 157609

Jira: ZEP-1449

Change-Id: Icce055940f4f82f3d87898f53cfbcae1fe73162c
Signed-off-by: Yossi Havusha <yossi.havusha@intel.com>
2016-12-20 17:00:00 +00:00
Marcus Shawcroft
78a1256646 echo_server: Fix frdm_k64f build in the absence of CC2520
Change-Id: Id8a421ad7862c03be0ac4e7293285fa01e8a93e0
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-20 13:44:41 +00:00
Anas Nashif
0e1022833b samples: remove obsolete KERNEL_TYPE
Change-Id: I9fec01fed0407c53b9b447e2a568bc75351cd61e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-20 01:12:43 +00:00
Anas Nashif
d687a95611 kernel: move kernel code to kernel/ directly
Also remove mentions of unified kernel in various places in the kernel,
samples and documentation.

Change-Id: Ice43bc73badbe7e14bae40fd6f2a302f6528a77d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 14:59:35 -05:00
Anas Nashif
a9e879e273 logging: move sys_log to subsys/logging
Move logging out of misc/ to its own subsystem. Anything related to
logging and any new logging features or backends could be added here
instead of the generic location in misc/ which is overcrowded with
options that are not related to eachother.

Jira: ZEP-1467
Change-Id: If6a3ea625c3a3562a7a61a0ba5fd7e6ca75518ba
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-19 19:58:39 +00:00
Kumar Gala
cd7ea0b56c samples: disable single threaded hello world for configs that fail
If we have Bluetooth or GPIO SCH we need multithreading right now
so disable any platforms that enable these features from running
this test.

Change-Id: I1ea35636e1382aac0f266fe73441619f9ac00d53
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-12-19 10:59:10 -06:00
Marcus Shawcroft
2c3a3ea84c dhcpv4: Adjust prj file selection.
Change-Id: I8e21285bfde33612fd9ded65257195612f880249
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-19 10:29:15 +00:00
Marcus Shawcroft
28aff9506f dhcpv4_client: Remove unnecessary ETH_KSDK configuration.
Change-Id: I18218501949a7a408c8ecd5501e0011204801e6d
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-19 10:29:15 +00:00
Anas Nashif
a99aa34cb5 samples: add configuration for single threaded hello world
Change-Id: Ib7419321a5aa664cfa78e0229cd5add3494a6747
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-17 16:54:45 +00:00
Baohong Liu
db20723da2 samples: bmi160: code clean up
Remove CONFIG_BMI160_TRIGGER_SOURCE_GPIO from prj config
file. It is not being used any more.

Also change CONFIG_STDOUT_CONSOLE to CONFIG_PRINTK. The
whole sample is using printk instead of printf.

Change-Id: I4ac7db37da1e45aed2457ace9e82385e37143c36
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 23:07:55 +00:00
Tomasz Bursztyka
7a19370f84 sample: net: Updating qemu config for 802.15.4 testing
Removing useless options, refining the logging and of course setting the
right IP to make it work.

Change-Id: I0c0c1979d590bc4c4fcb3a1d1a252b87b0153511
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
e7af4b8947 samples: net: Fix echo applications setting for 15.4
When zephyr receives a 15.4 frames it allocates 1 RX buf (nbuf) and 1
DATA (buf), and it gets queued on net stack for post processing.

Problem: receiving a lot of frames is just completely nominal and very
fast (timing is critical in radio, and the rx thread of the radio driver
has a high priority, much higher than net stack's rx post processing).
So guess what happens when CONFIG_NET_NBUF_RX_COUNT=10 though let's say
12 packets are coming in?

The RX buffer pools gets empty and soon the system hangs on getting a
newly allocated one.

This proper CONFIG_NET_NBUF_RX_COUNT tweak fixes the issue, however some
future work will reduce the need of so many RX meta buf:
- l2's recv could be called right away at net_recv_data, before queuing
  the buffer for post-processing, but this could affects reception
  timing on radio side, which is critical.
- An l2 pre-processing (in the middle of what current l2 recv does)
  could be implemented, it would be technology depenedent (aka: not
  mandatory on all l2) and could quickly decide what to do and at best
  drop the whole, or at least drop the RX meta buf (frag would still be
  kept). Let's see.

Jira: ZEP-1427

Change-Id: Ic75b02efa36e35b450c02b3e6439a8d73f03f839
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
afab2530c9 iot/dns: Fix IPv6 compilation issue
Update network context variable to 'net_ctx' and 'type' to 'query_type'

Change-Id: I956b8b5c79af7300ea9edc04c6ffd2a2b654d1ba
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
66a323faf2 iot/dns: Add support for the FRDM K64F board
This patch adds the project file for the FRDM K64F board, it also
updates the README_IPv4 file to include instructions for using the
DNS resolver with the FRDM board.

Change-Id: Ic9b92c2fed2636b56044309dc3be7c829d828d35
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Flavio Santes
56ba584ef1 iot/dns: Update Makefile
Remove legacy KERNEL_TYPE conf variable.

Change-Id: Ibc064d1e222dd9e085f6782f1a3f8e61661b0691
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
d3f587e326 samples: net: mbedtls: Let's enable fastest enc28j60 speed on a101
enc28j60 can work up to 25Mhz, let's set a divider of 2 on the 32Mhz
host clock then. This require to mimic CS with a gpio in the SPI driver.

Change-Id: I98f84fa793a614cdbb566be39a262ff825101255
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:56 +01:00
Tomasz Bursztyka
90dc300f1e samples: net: Add dedicated dhcpv4 prj.conf for frdm k64f board
This will help testing dhcpv4 through frdm k64f ethernet port.

Change-Id: I7cf47d77b79041fe7ab408355d1a9f9332fc1f54
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
cc946bf328 samples: net: Add Arduino 101 dedicated config for dhcpv4_client
This helps to test enc28j60 along with dhcpv4

Change-Id: I884f0aba0a04c3cc0d015d327cb9c100759d45ea
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Tomasz Bursztyka
a2bb2119de samples: net: Remove useless prj.mdef from dhcpv4_client
Change-Id: I2d4b5a78b0a38828318634b48bb8e7c59cf62390
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:55 +01:00
Luiz Augusto von Dentz
cb8f775813 net: echo_client: Fix using CONFIG_NETWORKING_WITH_BT
Removes left over CONFIG_NETWORKING_WITH_BT which has been deprecated.

Change-Id: Ida3a2c2dba6e44f112711170f883c0582c3ee7ed
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 19:14:54 +01:00
Andrei Emeltchenko
e27e1e73e1 samples: net: Fix compile error following frdm pinmux change
Fixes echo_client and echo_server samples.

Fixes compile error:
...
src/built-in.o: In function `fdrm_k64f_cc2520_pinmux_setup':
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
samples/net/echo_client/src/../../common/cc2520_frdm_k64f.c:93:
undefined reference to `_fsl_k64_set_pin'
...

Change-Id: I590f88f6bd083a30deea77fa860f001a3a55b278
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
7d5c9de92b samples/net/README: Add DNS client section
This commit adds the DNS client section to the samples/net/README file.

Added text includes a quick description of the application and
references to documentation already available in the tree.

Change-Id: Ia7ef3aea19069df5be2d8f14344b1afa750b22bd
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
fc24fc293a samples/mbedtls_dtlsclient: Add ARG_UNUSED
This commit adds the ARG_UNUSED macro for the status variable in
the udp_received callback.

Change-Id: I8c592cab72ccf5ba314742ef705e96d4a4d067e9
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
3b64d87cac samples/mbedtls_dtlsclient: Validate destination buffer size
This commit validates the size of the buffer used to store the
incomming datagram in the udp_rx routine.

Furthermore, two expressions related to the rx net_buf are now
executed before returning on error, avoiding a possible memory leak.

Change-Id: I30dc0a2d57dc207590387f1a9ab79945a1157ef5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Sergio Rodriguez
a6dd26a99e samples/mbedtls_dtlsclient: Using semaphore for rx
The DTLS client will use and asynchronous signaling method to
receive, this makes the sample work on QEMU

Jira: ZEP-1233

Change-Id: I28f074c4736f84c10e6be8119a5ba50b138fcc0d
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
c7afecf179 iot/dns: Update sample application
Previously, the domain names used in this application were
not very useful to proof that the DNS client was able to handle
multiple IP addresses.

In this patch, the number of domain names is increased. Some of them
may return multiple IP addresses as shown in the README_IPv4 file.
However, results may vary depending on the network setup.

Change-Id: Ic713ce48b4afa592c1480311f4394de6e57bf3fb
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
44b2f212a1 iot/dns: Use a k_sem for the DNS rx routine
This patch introduces a k_sem that will block until:
- data is received, or
- the user-provided timeout expires

This change allows us to simplify our previous DNS client
implementation.

This change is related to ZEP-1357 because we are refactoring the
DNS client API removing the continuous update of the net_context_recv
routine that seems to be causing issues after the kernel's update.

Jira: ZEP-1357

Change-Id: If01c9274ac8f096f0095a2872f86be2e007212ee
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:53 +01:00
Flavio Santes
0d257a009a iot/dns: Introduce the dns_context structure
This commit introduces the dns_context structure.

This new structure will reduce stack overhead due to
the simplication of the dns_resolve routine signature.

Furthermore, the timeout parameter is now int32_t
instead of uint32_t.

The dns sample application is also updated.

Change-Id: I5d789656bacbd23c4654edce5d116a88dc42c354
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-16 19:14:52 +01:00
Tomasz Bursztyka
89dc7ed78a samples: echo apps: Use Kconfig options to setup IPv6 on cc2520 config
Change-Id: If2e6f577cee53e0a4362c4b6ba12886ff1cfdcdd
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:52 +01:00
Luiz Augusto von Dentz
90be49f1e3 net: echo_client: Enable Bluetooth support
This enables Bluetooth L2 driver with CONFIG_NET_L2_BLUETOOTH and
removes CONFIG_NETWORKING_WITH_BT which has been deprecated.

Change-Id: I6a75c105e45a1b748abf6a70234d415c5121bcdc
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 19:14:52 +01:00
Luiz Augusto von Dentz
88bd2f9560 net: echo_server: Enable Bluetooth support
This enables Bluetooth L2 driver with CONFIG_NET_L2_BLUETOOTH and
removes CONFIG_NETWORKING_WITH_BT which has been deprecated.

Change-Id: I6f8b0e756f6e066b4b9cf9dec22f52fd72155c98
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 19:14:52 +01:00
Tomasz Bursztyka
572f41a464 samples: net: echo apps: Add cc2520 configuration for frdm_k64f
Common code found in samples/net/common
App is built with:
make BOARD=frdm_k64f CONF_FILE=prj_frdm_k64f_cc2520.conf

Note: debug messages are enabled on many parts of the system, and these
are killing the timings. So it's not unusual at all to see rx errors on
cc2520 side. Without most of the debug, much less error will occur (if
any when dbg is fully disabled).

Change-Id: Ib6f0868c300652270661e72e80108804308164ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:52 +01:00
Tomasz Bursztyka
7bd1b6cfeb samples: wpanusb: Removing legacy left-over
Change-Id: I5aeeb239ad425931fd6f87804000d941754e6a05
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-16 19:14:51 +01:00
Julien Delayen
1f26a332a1 power_mgr: Update sample app with ARC DEEP_SLEEP
Add support for resuming from deep sleep on the ARC.

Change-Id: Ic1e17e318a1121ac3c5ac2b6fb86ba00c78fd872
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
2016-12-16 17:01:30 +00:00
Baohong Liu
8b146d48d7 samples: bmi160: replace printf with printk
Change-Id: If1d05242d271ea4f8e4b60de8530984341f43d43
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 15:56:34 +00:00
Baohong Liu
9e4c2e92ca samples: bmi160: use direct GPIO trigger instead of ipm
Directly use AON GPIO trigger instead of IPM.

In the past, SW did not allow arc to receive AON GPIO interrupt.
So, interrupt from BMI160 was routed to x86 cpu. Then, x86 cpu
passed the event to arc through IPM. But, SW was updated and arc
is able to directly receive interrupt from AON GPIO now. So, IPM
is not needed any more. Both IPM and GPIO triggering code is there.
We just need to change the configuration by modifying the prj
config file.

The x86 code will be removed since it will not be used any more.

Change-Id: Ibc4250a34218cc52bf4c726cf70617cfdea3b2e8
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-16 15:56:33 +00:00
Luiz Augusto von Dentz
9791274303 Bluetooth: samples: Add extern "C" { } block to GATT header files
Adds extern "C" { } blocks to header files so that they can be
safely used by C++ applications.

Change-Id: I767a04635b38d8ef7a02e8c7da3a5c99b0bc7709
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-12-16 11:23:33 +02:00
Johan Hedberg
1c9da665c3 Bluetooth: Remove unnecessary runtime kernel object initialization
There are static initializer macros available for most kernel objects
which we should use whenever possible.

Change-Id: I496f4d05d26801eddd21fae53bdd4fcdc3246fe3
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-16 10:27:48 +02:00
Anas Nashif
fe958df4dd libc: rework libc selection and reduce Kconfigs
Moved all libc Kconfigs to where the code is and remove the default
Kconfig for selecting the minimal libc. Minimal libc is now the default
if nothing else is configured in.

Removed the options for extended libc, this obviously was restricting
features in the minimal libc without a good reason, most of the
functions are available directly when using newlib, so there is no
reason why we need to restrict those in minimal libc.

Jira: ZEP-1440
Change-Id: If0a3adf4314e2ebdf0e139dee3eb4f47ce07aa89
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-15 22:31:28 +00:00
Benjamin Walsh
c3a2bbba16 kernel: add k_cpu_idle/k_cpu_atomic_idle()
nano_cpu_idle/nano_cpu_atomic_idle were not ported to the unified
kernel, and only the old APIs were available. There was no real impact
since, in the unified kernel, only the idle thread should really be
doing power management. However, with a single-threaded kernel, these
functions can be useful again.

The kernel internals now make use of these APIs instead of the legacy
ones.

Change-Id: Ie8a6396ba378d3ddda27b8dd32fa4711bf53eb36
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-15 16:17:38 -05:00
Benjamin Walsh
8a894e3109 sample/philosphers: ignore format-security warning
The format string passed to printk is trusted, and this is just sample
code anyway.

Change-Id: I267e1e3a9b6720c4216624bf0c2590ce42c6c681
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-12-15 15:50:02 -05:00
Johan Hedberg
71c7c01819 net: buf: Remove the need for net_buf_pool_init()
In order to keep the initialization process light-weight, remove
net_buf_pool_init() and instead perform the initialization of the pool
and buffers in a "lazy" manner. This means storing more information
in the pool, and removing any 'const' members from net_buf. Since
there are no more const members in net_buf the buffer array can be
declared with __noinit, which further reduces initialization overhead.

Change-Id: Ia126af101c2727c130651b697dcba99d159a1c76
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-15 09:58:02 +02:00
Anas Nashif
af978586d1 Revert "samples/logger-hook: Initialize variable to 0"
This reverts commit 7a74fb0454.

This commit breaks the sample. The sample code has a bug which will be
addressed in a separate patch.

Change-Id: Ic44faeafced4415765fded04e2493e306fc35331
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-14 10:28:51 -05:00
Anas Nashif
418058a123 kernel: remove NANOKERNEL and MICROKERNEL configs
Those are legacy and not needed anymore.

Change-Id: I8113114fd60880b3f538612db7702f6129af0a06
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-14 13:45:52 +00:00
Marcus Shawcroft
954baea90b random: Restructure RANDOM Kconfig
Restructure the RANDOM Kconfig to match the structure used in other
drivers with a single top level menu.  Move the true random number
generators to appear first in the menu, with pseudo generators at the
bottom.  Do not present pseudo generators if a true random generator
is presented.

This change implies that tests, samples and applications that require
the random driver interface must now select CONFIG_RANDOM_GENERATOR.

In order for tests and samples to build (and run) on platforms that
have no random driver it remains necessary to select
the CONFIG_TEST_RANDOM_GENERATOR.

Note that CONFIG_TEST_RANDOM_GENERATOR retains its original purpose of
enabling a random driver that delivers non random numbers for the
purpose of testing only.

Change-Id: I2e28e44b4adf800e64a885aefe36a52da8aa455a
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13 22:50:18 +00:00
Marcus Shawcroft
fe8d044d9a tests: Remove unnecessary CONFIG_TEST_RANDOM_GENERATOR
Remove CONFIG_TEST_RANDOM_GENERATOR from each test and sample where it
is not required.

Change-Id: I949f8e93c2cb1881622a5e48efeb87c43122a170
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-13 22:50:18 +00:00
Bogdan Davidoaia
4946e3e6e6 sensor: remove SENSOR_VALUE_TYPE_INT
Remove SENSOR_VALUE_TYPE_INT as it is the same as
SENSOR_VALUE_TYPE_INT_PLUS_MICRO with val2 set to 0.

Change-Id: If5a9c579b7267701c27f40fd887acae47d64edc5
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:10 +00:00
Bogdan Davidoaia
b584acb0a4 sensor: remove unused Q16_16 value type
Remove SENSOR_VALUE_TYPE_Q16_16 as it is not used by any driver. Future
drivers can use any of the remaining value types.

Change-Id: I984143cc65d6a6fd0477f310ac17c62498cc05b8
Signed-off-by: Bogdan Davidoaia <bogdan.m.davidoaia@intel.com>
2016-12-13 21:51:09 +00:00
Johan Hedberg
c3e08c8fea net: buf: Redesigned pool & buffer allocation API
Until now it has been necessary to separately define a k_fifo and
an array of buffers when creating net_buf pools. This has been a bit
of an inconvenience as well as blurred the line of what exactly
constitutes the "pool".

This patch removes the NET_BUF_POOL() macro and replaces it with a
NET_BUF_POOL_DEFINE() macro that internally expands into the buffer
array and new net_buf_pool struct with a given name:

	NET_BUF_POOL_DEFINE(pool_name, ...);

Having a dedicated context struct for the pool has the added benefit
that we can start moving there net_buf members that have the same
value for all buffers from the same pool. The first such member that
gets moved is the destroy callback, thus shrinking net_buf by four
bytes. Another potential candidate is the user_data_size, however
right not that's left out since it would just leave 2 bytes of padding
in net_buf (i.e. not influence its size). Another common value is
buf->size, however that one is also used by net_buf_simple and can
therefore not be moved.

This patch also splits getting buffers from a FIFO and allocating a
new buffer from a pool into two separate APIs: net_buf_get and
net_buf_alloc, thus simplifying the APIs and their usage. There is no
separate 'reserve_head' parameter anymore when allocating, rather the
user is expected to call net_buf_reserve() afterwards if something
else than 0 headroom is desired.

Change-Id: Id91b1e5c2be2deb1274dde47f5edebfe29af383a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-13 21:41:53 +00:00
Anas Nashif
0859df1eca kernel: disable MDEF by default
Disable MDEF option and set it only in legacy projects.

Change-Id: I2e1f011eb1f876af929140e36f71f0efb5e955c1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-12 20:25:07 +00:00
Baohong Liu
3b831465a4 samples: spi_fram: correct syntax error and update comments
Correct some syntax error and update some comments. There is
no functionality change.

Change-Id: I86c922c8aabcc4464b86f33ad7edf6056b1d765c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-11 11:26:57 +00:00
Baohong Liu
cdf41416bd samples: gpio: use correct gpio driver name
The gpio device driver name for the sensor sub-system was
renamed to GPIO_SS_x from GPIO_x recently. Let's use the
new gpio driver name for the sensor sub-system in the app.

Change-Id: Ie06b072d31e23e74c3ac41a4590845b24a020ed1
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-11 11:24:22 +00:00
Marcus Shawcroft
409b754a15 Remove application calls to sys_rand32_init.
The random driver, if enabled, is initialized by the kernel
initialization function.  There is no need for applications or tests
to re-initialize the driver.

Change-Id: Ib4712dda937a7a83a8079c8aa662cec03c5416f8
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-11 11:18:18 +00:00
Marcus Shawcroft
0bc4b494d7 samples: Add thermometer
Change-Id: Ia561255be4f47dcb2e17bf734af77786fda80d0b
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-11 11:14:06 +00:00
Sergio Rodriguez
a213fb4e27 samples: sensor: fxos8700: Check sample fetch return value
The sample was reading the sample values regardless of return
value of the fetch sample function, now it exits the function and
prints an error message

Coverity-CID: 157576

Change-Id: If9a909ed9b617357a032c5632ac04984846d6744
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-11 04:30:02 +00:00
Baohong Liu
e0359b5b5c samples: aio: fix some coding style issues
Change-Id: I799b8543e50716fec1685d32810419c7c3d94bf2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-10 12:24:30 +00:00
Baohong Liu
fc7dec1e5a samples: spi_flash: remove redundant code lines from config file
Remove two configuration parameters related to gpio used as spi
chip slect from prj config file. since they are already in
arduino 101 board config.

Change-Id: Iebaab605d8a6394e27c70ebbf4bac37a24665522
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-10 02:18:01 +00:00
Flavio Santes
7a74fb0454 samples/logger-hook: Initialize variable to 0
This commit fixes the issue reported by Coverity:
"Uninitialized variables (UNINIT)".

Coverity-CID: 157609

Change-Id: Ied52f83ad31854748c54a92cfa393e186dc619e0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-10 02:14:36 +00:00
Flavio Santes
63e1f4a30a samples/logger-hook: Increase main stack size
This sample fails if the main stack size is 1024, so this patch
increases the value to 1280.

Change-Id: If5e21c09234e2ca8178e8dde684361844fababca
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-10 02:14:36 +00:00
Johan Hedberg
fc21a76db6 net: Fix incorrect logging format specifiers
Fix compilation issues that show up if SYS_LOG is mapped to printk
instead of printf. Unlike printf, printk is annotated so that the
compiler catches incorrect format specifiers passed to it.

Change-Id: Iab7cc6da110e9c98720211a6f773dcf055a3a411
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-12-07 13:15:58 +00:00
Erwan Gouriou
7e631bd07d samples: pwm: update PWM sample to support ST Nucleo boards
Change-Id: I483f70a6b55b42105e9a3366f8735903e23be294
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2016-12-06 10:31:46 -06:00
Vincenzo Frascino
bd2717740a samples/drivers: Add Beetle to Watchdog test
This patch adds Beetle to the Watchdog test case.

Jira: ZEP-1300
Change-Id: I371ca2f89aaec8e07f45cfa04fc2618d009cf487
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-12-06 10:31:45 -06:00
Tomasz Bursztyka
1475322433 samples: net: Leds demo needs GPIO on all platform
Fixing a tiny build error found through sanitycheck.

Change-Id: Iee9a3ac135380ddf70e2902b532f6f28d417715c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-05 16:57:06 +01:00
Anas Nashif
70f9244db7 Merge "Merge net branch into master" 2016-12-05 15:56:26 +00:00
Anas Nashif
5697e9e835 Merge "Merge bluetooth branch into master" 2016-12-04 12:47:50 +00:00
Maureen Helm
23b06ebd8c samples: Add fxos8700 sample application
Adds a fxos8700 sample application that uses the sensor data ready
trigger to periodically print accelerometer and magnetometer data.

Change-Id: I43fef6cd6090b58d8d0168a25558a3a05781ea5d
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2016-12-04 12:37:49 +00:00
Szymon Janc
d1187302e0 Bluetooth: Make bt_send stack requirements a Kconfig option
This allows to fine tune TX stacks size depending on selected HCI
driver. If needed it can be used to tune for monitor too or other
logging mechanism used.

Change-Id: Ib501921da0b786e151083760d85ec58fe3c08b60
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-12-03 17:09:38 +00:00
Szymon Janc
151e37b856 Bluetooth: samples/hci_uart: Use proper stack declaration
Use BT_STACK_NOINIT for tx stack declaration. This makes sure stack
it properly alligned and account for k_thread overhead.

Change-Id: I704958fcc3ce02aba913f6eaee13ae50d2a81591
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-12-03 17:09:38 +00:00
Carles Cufi
b1d02621fc Bluetooth: hci_uart: Fix init order in hci_uart bootup
bt_enable_raw() needs to be called before spawning the tx thread,
otherwise there might be an HCI command processed from the UART
before the HCI driver has been opened and therefore initialized.

Change-Id: I050158bd48bebaf8fa2cf6b11efb54b531f70079
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-12-03 17:09:38 +00:00
Vinayak Chettimada
73a2100bd8 Bluetooth: hci_uart: reduce configured stack sizes
From stack_analyze function, used isr stack is 368 bytes
with the controller build, main stack is 288 bytes and idle
stack is 56 bytes. Hence, configuring sizes of 512, 512,
and 256 bytes for isr, main and idle stacks respectively.

Increased max connections from 16 to 20 utilizing the RAM
free from the reduced stack sizes.

Change-id: I67d073fd1893cafc53d36e89035a6fd931488a46
Signed-off-by: Vinayak Chettimada <vinayak.kariappa.chettimada@nordicsemi.no>
2016-12-03 17:09:38 +00:00
Carles Cufi
3b1baa88ef Bluetooth: Controller: Implement ECC commands
Implement the 2 HCI commands that provide ECC public key
and shared secret generation:

- LE Read Local P-256 Public Key
- LE Generate DHKey

Jira: ZEP-1246

Change-Id: I79388bfdb9f2e28b9377b4bb6ee2caca25f33f3e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-12-03 17:09:38 +00:00
Anas Nashif
29b2ffbb33 samples: usb: remove legacy APIs
Change-Id: I80fa24aaf783451af18d775a6b52c2014d26bd9e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-12-02 15:52:35 +00:00
Tomasz Bursztyka
f3c1b442ba samples: net: echo apps: Add cc2520 configuration for arduino_101
CC2520 is not embedded on an arduino_101, it is however possible to wire
one, and thus it requires to provide cc2520_configure_gpios() function.
This one, being common to a101 is found in samples/net/common.

Change-Id: I86f2734847edb3f6a968522afccc3099ed854d13
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:20 +02:00
Sergio Rodriguez
e6b5239c33 wpanusb: Fix include path
Commit https://gerrit.zephyrproject.org/r/#/c/6971/ changed the
location of some include files, making compilation fail.

Change-Id: I43c124be28b55e550ef2204ca9faa7031665fb4a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:20 +02:00
Flavio Santes
c2f7c907c9 iot/dns: Update sample client application
This commit updates the dns client application to use the
new kernel API.

Change-Id: Ibf920532b02a1561bfb38f69e5dd994ab21574bc
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:41:20 +02:00
Jukka Rissanen
3eaec41ab8 net: Moved net/ to subsys/net
* Moved networking code into subsys/net.
* Renamed net/yaip to net/ip at the same time.
* Fixed the tests/net to compile
* Fixed the Makefiles and Kconfig files in subsys/net
  to use the new location of the IP stack

Change-Id: Ie45d9e8cb45a93fefdf969b20a81e3b1d3c16355
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:20 +02:00
Jukka Rissanen
51da830b5e samples: zperf: Port to native IP stack
Port the zperf network performance tool to native IP stack.

TCP support is missing from this version.

Change-Id: I2648e7d81014bb0cae8cf50854b0ae5f89a6567c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:19 +02:00
Jukka Rissanen
79e2178040 samples: net: Do not quit echo-server if sending fails
If we cannot send a network packet, do not quit as that is
really not necessary here.

Change-Id: I7613d46bdbc849b75aaf0fc71c58beba810fd658
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:19 +02:00
Jukka Rissanen
6c02719125 samples: net: Use qemu_x86 config file by default for echo apps
As the default board is qemu_x86, make sure there is similarly
named config file that can be used by default.

Change-Id: Ibc480d3b4eecc2601e3670c8da19be9c01833c36
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:19 +02:00
Jukka Rissanen
2631995fa9 samples: net: Use board specific conf file for echo apps
Use by default a board specific config files for both
echo-server and echo-client sample applications.
This makes more sense than using the network technology specific
config file that was used earlier.

Change-Id: I155fc138f4b0ed1166f4e25267513afc3fb6fd76
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:19 +02:00
Jukka Rissanen
7ebcf7398a samples: net: Remove prj.mdef file from echo sample apps
Change-Id: I6edb869a5998d47338dfb04e7ed8ee1aee8c1cb8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:18 +02:00
Jukka Rissanen
7048c992fb samples: net: Convert the echo apps config files to native stack
Remove legacy stack artifacts from the echo-server and echo-client
config files.

Change-Id: Icc591b9540495c4ee181517369b0df9bb91972bb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:18 +02:00
Ruslan Mstoi
fed49c7493 samples: net: enable debugging with qemu target
This enables application debugging using qemu target:

export QEMU_EXTRA_FLAGS="-s -S"
make qemu

Was tested with echo_server

Change-Id: I1906dea2fbc5afe03b11729d2edb8f3629a629f8
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen
68ea9377e6 net: Make native IP stack the default
As the native IP stack is now the default, there is no need
for corresponding Kconfig option.

Change-Id: I08e4992f540f928a2b7378e8803e634e38725348
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Flavio Santes
3c28f9c211 net: Remove legacy IoT sample applications
This commit removes the old MQTT and NATS publisher and subscriber
applications that were based on the uIP stack.

Change-Id: I7ba8e155e32ba0aa53c8dec1b6c0cc5170d70943
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen
6b43821f20 net: Remove legacy Contiki based uIP stack
This commit removes the legacy Contiki based uIP stack.
The new native IP stack must be used after this commit.

The commit also removes following things:
- legacy cc2520 driver
- legacy ethernet drivers
- legacy IP stack samples

and changes these things:
- disabled tests that only work for legacy IP stack
- select new IP stack by default
- enable random number generator by default as it is needed
  by the new IP stack

Change-Id: I1229f9960a4c6654e9ccc6dac14a7efb9394e45d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:17 +02:00
Jukka Rissanen
b3077ab4e7 samples: net: Fix echo-server compilation error
My IPv4 address was missing because of complex set of #ifdef's.

Change-Id: I6768587d3e104a57c10756bc43267f26068aa3cb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:15 +02:00
Tomasz Bursztyka
f0c41205db wpanusb: Minimize debug output by default and set proper nbuf size
Nbuf data size needs to be set to 128 bytes, specifically for
wpan sample.

Debug output kills timing, and thus can generate spurious failures on
reception, so limiting it to errors by default.

Change-Id: Ia918361d07369dacbe577e26855d7ef6ed865f7b
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:15 +02:00
Jukka Rissanen
a870dffa7f samples: net: echo apps can use IP address set in config file
The used IPv6 or IPv4 address can be set in the config file.
This way one does not need to edit the source file to setup
the desired IP address.

Change-Id: Ic900bd4694481b4b035026ad0ba7b9280eb84e4a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:14 +02:00
Jukka Rissanen
876b7a9b10 samples: net: Bind to any IPv4 address by default
Let the echo-server listen any configured IPv4 address
by default.

Change-Id: Ib83c5e069ae1e26615c37fa980bc4009b5a5e40c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:14 +02:00
Jukka Rissanen
0cc43a62ac samples: net: Do not use static address in DHPCv4
If user has enabled DHCPv4 support, then do not try
to set static IPv4 address.

Change-Id: Ia359f578044d72b951f53c509c92c09d575207f0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:14 +02:00
Mahavir Jain
eefd912fed samples: net: Use unified kernel interface for sem/queue declaration
Change-Id: I2519a7a35f83d2542f333ca6791a6f22944a42c4
Signed-off-by: Mahavir Jain <mjain@marvell.com>
2016-12-02 12:41:14 +02:00
Vinicius Costa Gomes
8a11cf696d samples/leds-demo: Listen on the ANY address
If we want to receive packets to multiple addresses, the solution is to
listen on the ANY address, and add the address to the interface in
question (already done).

Change-Id: I383cc1401f1236ee05bdb010252a9f9909aa15bd
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:14 +02:00
Vinicius Costa Gomes
9cd6bd9961 samples/leds-demo: Fix not using the LED correctly
Before using the LED we must set the direction of the GPIO pin to
output, and the LED will turn on when that GPIO pin is 'low'. So, for
our purposes, the LED is active low.

Change-Id: If8e6ce05ff2f3ddb7b17a87b172a91f7276194a4
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:13 +02:00
Vinicius Costa Gomes
4723d29e32 samples/leds-demo: Fix missing include file
'board.h' includes the definition of LED0_GPIO_PORT and LED0_GPIO_PIN,
without this include the fallback was used, as if the board in question
didn't have any LEDs.

Change-Id: I78ebdb2e2ffc41dff5011dcf9e33e09d70950e81
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:13 +02:00
Vinicius Costa Gomes
e27c7c02b2 samples/leds_demo: Add config for using 802.15.4
This adds a configuration profile allowing this example to run on a
Quark SE C1000 devboard.

Change-Id: Ic04fd30a91ed0a1fc8c3a3b3a6e397f0722f50b1
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:13 +02:00
Tomasz Bursztyka
d02a9692ff wpan_serial: Minimize debug output by default and set proper nbuf size
Nbuf data size needs to be set to 128 bytes, specifically for wpan
sample.

Debug output kills timing, and thus can generate spurious failures on
reception, so limiting it to errors by default.

Change-Id: Ia0b8c904e0bc66a7922af4f317db623db6c51462
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:13 +02:00
Mahavir Jain
847432e7dd sample: dhcpv4_client: use unified kernel APIs
Remove legacy kernel APIs and use unified interface

Change-Id: I5ef9a31635aa4862640272353003c0c337509a97
Signed-off-by: Mahavir Jain <mjain@marvell.com>
2016-12-02 12:41:12 +02:00
Leandro Pereira
2543b2f6ee samples: net: Finish TCP support in echo server
This adds the required code to echo server so that it works with TCP as
well.

Change-Id: Ib45dd91a52a60ddb4d8f0ae11175ceb52199c398
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2016-12-02 12:41:12 +02:00
Vinicius Costa Gomes
b3dc2f8ecd samples/zoap_server: Using unified kernel API
Dropping legacy API.

Change-Id: If01eb40b7dfd9fac322ab8c001b7ebe37c0fed43
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:12 +02:00
Vinicius Costa Gomes
19087b8eca samples/zoap_client: Using unified kernel API
Dropping legacy API.

Change-Id: I8df78bc33550467b8558f8e58a6c390ce84f3b12
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:12 +02:00
Andrei Emeltchenko
b0aee95eda wpanusb: Log INF about upper layer start/stop
Change-Id: Ibb841afb94150ccc73b5e80a41a2ca9c949a25c8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:12 +02:00
Andrei Emeltchenko
17b6c45e79 wpanusb: Include shell to the sample
Including shell allows to execute some kernel commands and make sure
system is not crashed.

Change-Id: I6157229614655dc7e523f1cf0f84ee7c58d7a717
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:11 +02:00
Tomasz Bursztyka
640ba28793 samples: net: No need of full debug output on cc2520 in echo client
Change-Id: I6ffe5e5c9e8f4baa55386c2f5f430c2765e6f6ab
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:11 +02:00
Andrei Emeltchenko
82ac4f68f7 wpan_serial: Correct file description
Correct leftovers from CDC sample.

Change-Id: I337440a4f9a9016bb0635f49e205c1b6fee56e96
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
fd57ca6f23 wpan_serial: Use unified API for wpan_serial sample
Convert API to unified.

Change-Id: Ie00eb84441295a8311181186cbb117837a0fd3ca
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
3f2db79cd2 wpanusb: Use unified API for the wpanusb sample
Convert to unified API.

Change-Id: I8f400fe5fca6411f3c3da40d409cff49a05da619
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
cf66ddfd39 wpanusb: Use INFO default logging level
Due to huge delays with DEBUG log level change it to INFO.

Change-Id: I81caf78fc6e9e064c2ed8e18caa99351028af62a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
b2d2c7fe06 wpanusb: Send zero sequence for unsuccessful transmit
In a case transmit is failed send ack to the driver with zero sequence
number which is not used for valid seqs.

Change-Id: I1047de9ab5de636c5a8983f31376046757c4dc0c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:10 +02:00
Andrei Emeltchenko
5ceb1133c4 wpanusb: Allow retransmission when cc2520 transmit not done
Following replacing semaphore with timeout semaphore transmit may not
be finished returning error after which communication stalls. Allowing
3 retransmits solves the issue.

Change-Id: Ibad05c2eac43dd6bb0ed72aaf16a7a2ef4185067
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:09 +02:00
Tomasz Bursztyka
0bb17f9639 samples: net: Put a proper stack size for echo-client
Having 1024 bytes was really unsufficient and creating a lot of weird
bugs everywhere.

Change-Id: Ib642744fa6dfc9f3a699a0dc2f0c1783dc6f87b2
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:09 +02:00
Tomasz Bursztyka
1e7a92f7da samples: net: Fix how k_sem_take is used in echo_client
Semantic has changed in k_sem_take in comparison with legacy
nano_sem_take.

Change-Id: I06129b6f15f66266919bf371c2358e5634109156
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:09 +02:00
Tomasz Bursztyka
2dd1b5df0f samples: net: Use uart-pipe for 802154 iface in echo apps
This is meant to test echo applications with 802.15.4 L2 directly in
qemu.

Change-Id: I0edccd8c39360421dc77e0064147221d86877bdf
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:09 +02:00
Jukka Rissanen
26ea431c5f samples: net: echo apps: Do not set preferred IPv6 address
Previous commits support auto configured IPv6 addresses so no
need to manually tweak the address settings.

Change-Id: Ie641212981a04229721c84990a54876977d9cfc4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:08 +02:00
Jukka Rissanen
7e9eaaacb9 samples: net: Fix echo-server UDP packet sending
This commit fixes the case when we receive large amount of
data and then copy it into new fragments. If the MTU is larger
than the fragment size, then it is possible that we might
overwrite net_buf memory and crash. This is typical in ethernet
network.

Change-Id: Ib1c65819c3bc718ec04f558e3df235246b5655dd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:08 +02:00
Sergio Rodriguez
8a7ca107b5 samples/mbedtls_dtlsclient: Using unified kernel thread spawn API
Change-Id: I760183861e458f3daf8d419a5234332141a732dc
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:07 +02:00
Sergio Rodriguez
67ce715d0d samples/mbedtls_dtlsclient: Removing unnecessary files
The DTLS client will not longer use the legacy IP stack.

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I7402a188fc7501873d98d3b6cb2f03ee51f3506b
2016-12-02 12:41:07 +02:00
Jukka Rissanen
f836032d39 samples: net: Bind any IPv6 address by default in echo-server
This commit allows echo-server to listen all defined addresses
specified to its network interfaces.

Change-Id: I52874210f6987c75d7921e514399a9eda55911bb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:07 +02:00
Tomasz Bursztyka
3964a6cef3 samples: net: echo apps: Using unified kernel API
Dropping legacy API.

Change-Id: Ib1f2fbffddde02ea97ad2cb665d7fda77248d936
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:07 +02:00
Andrei Emeltchenko
3d67b5badb wpan_serial: Correct SLIP buffer size
SLIP buffer size depends on maximum IEEE 802.15.4 frame size and start
byte.

Change-Id: I1cb0a848dce6b0c85bf11408733d777f7a3b03c9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:06 +02:00
Andrei Emeltchenko
f0e819faea wpanusb: Update wpan protocol document
Remove unneeded SET_HW_ADDR_FILT since it is handled by other
commands and add missing opcodes.

Change-Id: I4b6488e6cee742b79c16789e817795138506dc77
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:05 +02:00
Tomasz Bursztyka
acc7e6a011 samples: net: Do not set nbuf data size on 802.15.4 samples
It's 127 by default as soon as 802.15.4 l2 is selected.

Change-Id: I6c29d88bb3277a15fe54693027caf320bc3d9fc4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:05 +02:00
Vinicius Costa Gomes
432c6b9997 samples/net: Add a simple demo for the link-format feature
This demo showcases how to expose resources that are exposed using the
link-format feature.

Change-Id: Iad9421082fae3212cae58e6d6e9b88fa170678b8
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:41:05 +02:00
Tomasz Bursztyka
d604bb98c3 samples: net: Add CC2520 dedicated prj.conf files for echo apps
Change-Id: I264a1577a176d37793a475e9605694d9d988fc69
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:04 +02:00
Jukka Rissanen
1aeea63d17 net: apps: Set the IPv6 source address preferred for echo-client
Forcefully set the IPv6 address in echo-client so that we
can use that address when sending data. Normally this should
not be done like this as the system should autoconfigure itself.

Change-Id: Id24f9aa84b30a3da941bb6b9e4522c7218687e12
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:03 +02:00
Sergio Rodriguez
51c61dcd50 samples/mbedtls_dtlsclient: mbedTLS sample DTLS compile on unified kernel.
Makefile modifications to be able to be compiled with the unified kernel

Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
Change-Id: I0fce5d3f6b28df0cff4b7c0b554a787996e8c966
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
f416f615bd wpan_serial: hexdump and interrupt debug to VERBOSE_DEBUG
Print packet hexdump and interrupt related debug only when
VERBOSE_DEBUG is enabled.

Change-Id: Ieb997e3537a9a2316d1435372948004dd93babab
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
a239abeb5c wpan_serial: Update README
Update information related to simple web server info.

Change-Id: Ib0155c116a3d53b374a7401eb6e9d1599390dba3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Andrei Emeltchenko
c275f0756e wpanusb: Decrease amount of debugs
Print packet hexdump only when VERBOSE_DEBUG is enabled and remove
debug print in empty functions.

Change-Id: Ifd3ae59001233f0237c4b7575bd92607c93e2ea0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:41:03 +02:00
Jukka Rissanen
06a408e16c net: apps: Set the IPv6 source address preferred for echo-server
Forcefully set the IPv6 address in echo-server so that we
can use that address when sending data. Normally this should
not be done like this as the system should autoconfigure itself.

Change-Id: I99041539c50f994f5d3ddaabaf5cac8599d82078
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:41:03 +02:00
Tomasz Bursztyka
3e23b2b824 samples: ieee802154: L2 debug Kconfig option has changed
Change-Id: I81e23038947e9423b38391943298b67c83a7a221
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:41:01 +02:00
Sergio Rodriguez
0b56b4066f samples/mbedtls_dtlsclient: mbedTLS sample DTLS client app on Arduino 101.
This is a sample app using ECJPAKE crypto algorithm on DTLS, using mbedTLS,
native IP stack and the enc28j60 SPI Ethernet Driver

Change-Id: I658c3d9a54cfdd164a4147903125400f223c6e0a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:41:01 +02:00
Vinicius Costa Gomes
098bdc0741 samples/zoap_server: Fix wrong reference count
It is the responsibility of the callback to release the buffer.

Change-Id: Id80f5f9ca190868a7c173994bb7ec7ee7f6251b7
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:58 +02:00
Vinicius Costa Gomes
d51e682f5c samples/zoap_server: Fix retrieving the wrong address
When retrieving the address of a peer from the net_buf, care should be
taken so it happens before the 'data' pointer of the buffer is modified,
which causes the macros to retrieve the address from invalid positions.

Change-Id: I466fb989119ab5f7d0ac3899979670675bdaa946
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:58 +02:00
Tomasz Bursztyka
7fb317321b samples: ieee802154: Fragmentation is now supported so enabling it
Change-Id: Ibddde76f82da4b40fdb9f62d9b2a481ee7feec3c
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:57 +02:00
Jukka Rissanen
5f3f331d48 net: Adapt to new behavior of net_buf_frag_add v2
This change is related to patch called
"net: Adapt to new behavior of net_buf_frag_add"

This version removes extra net_nbuf_unref() from
the code. The unref was done because net_buf_frag_del()
did not remove the double ref from the list element.

Because of the other patch, the list does not have
double ref any more, so we need to remove the extra
unref in couple of extra places.

Change-Id: If90e01c24b9b4e68afbfa283850d2a1ecb3065ed
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:54 +02:00
Andrei Emeltchenko
899df8742f wpanusb: Add wpanusb syslog domain
Change-Id: I06f2df88678658a495b3ae0064b542f4697161a9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:54 +02:00
Andrei Emeltchenko
3c75cc9c9c wpanusb: Correct definition names
Change definition name suffix to WPANUSB

Change-Id: I3456ebff061866a67b7a07b33f6ff83a31a2d7a8
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:54 +02:00
Andrei Emeltchenko
cb77016c23 net: samples: Add samples overview for wpanusb and wpan_serial
Change-Id: I05f6ce9a823cb8a5466bd02739386f23e9266cc2
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:54 +02:00
Flavio Santes
fd2e2f2f5e iot/dns: Update README files
This commit updates the README files to reflect that ZEP-1036
is already solved.

Information about ZEP-1097 and ZEP-1098 is now included.

Change-Id: I3c83160962d308d374823e086bbf083dca988606
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:52 +02:00
Flavio Santes
ffb6ae0dda iot/dns: Improve support for additional boards
This commit modifies the conf and Makefile files of the DNS client
application.

Inside the Makefile, the CONF_FILE variable is updated to include
the BOARD name, therefore prj_'board_name'.conf is used from now on
to refer to the conf file. The right conf file is selected by passing
BOARD='board_name' to make.

Configuration variables at the conf files are also homogenized.

Change-Id: I6f5aaad0b52d458bceb90b315aba2b31f085c0a0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:52 +02:00
Andrei Emeltchenko
408d0c2124 wpanusb: Improve debug for wpanusb
Change-Id: I90201df4a50f81cd9a479539826456a6ffb62bb9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:52 +02:00
Andrei Emeltchenko
9bbfaef4a1 wpan_serial: Implement 802.15.4 serial radio protocol
Implement serial-radio protocol used in Contiki-based border routers
to interact with 802.15.4 devices connected over serial or USB-serial.

Change-Id: I938b34ca32ae7a08e5d48e3bea585cda6c98c113
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:52 +02:00
Andrei Emeltchenko
7b4acbff25 wpanusb: Add wpan radio protocol specification
Change-Id: I4ab00d87de50a9efa5b715649d4b5154e37ce1c0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:52 +02:00
Jukka Rissanen
ddda50c214 net: tcp: Initial TCP functionality
This creates initial TCP handling logic but does not yet
enable fully working TCP connection.

Some of the connection logic is taken from FNET TCP
implementation.

Origin: FNET 3.6.1
URL: https://github.com/butok/FNET/blob/master/fnet_stack/stack/fnet_tcp.c

Change-Id: I1e100d9fa9c91437562b933d94d0bd3db1a5885e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:51 +02:00
Paul Sokolovsky
4de34b3914 net: apps: Fix echo-server where IPv6 TCP context was used instead of IPv4
Apparently a copy-paste error.

Change-Id: I55aac4231384cbd95394f08a4c4f9c717aae5248
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-12-02 12:40:51 +02:00
Ravi kumar Veeramally
c689fd6f1a net: Rename net_nbuf_write to net_nbuf_append
Current net_nbuf_write() api just appends data to last fragment. And
doesn't write data based on offset. That's why renaming this api.

New net_nbuf_write() apis based on offset will be coming soon.

Change-Id: Ie8e13e5f6091a279b62b6d8b0b3928a5187e75b0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:51 +02:00
Flavio Santes
8d001fa5cb iot/dns: Add support for Arduino 101 and ENC28J60
This commit adds support for the Arduino 101 board with the
ENC28J60 Ethernet module.

Change-Id: Ib852e9cfb2b3b2188d3320e00d6bc24620e187f5
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:51 +02:00
Sergio Rodriguez
05aded096e samples/mbedtls_dtlsclient: mbedTLS sample DTLS client app.
This is a sample app using ECJPAKE crypto algorithm on DTLS, using
mbedTLS, and native IP stack

Jira: ZEP-900
Jira: ZEP-943

Change-Id: Ica17b047aab11b989d3e8c8f6ac1b79e3041053a
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-12-02 12:40:51 +02:00
Vinicius Costa Gomes
46be4f4907 samples/zoap_client: Use token generator helper
Change-Id: If3dfe80deb8ff753fecae539032399deb15279ee
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:50 +02:00
Vinicius Costa Gomes
dc45748d50 iot/zoap: Port to the native stack
This ports zoap to the native stack.

Just for reference, and totally not scientific, here are the numbers
using the old stack:

$ size outdir/qemu_x86/zephyr.elf
   text	   data	    bss	    dec	    hex	filename
  34657	  10316	  16916	  61889	   f1c1	outdir/qemu_x86/zephyr.elf

With yaip:

$ size outdir/qemu_x86/zephyr.elf
   text	   data	    bss	    dec	    hex	filename
  30575	   9148	   6164	  45887	   b33f	outdir/qemu_x86/zephyr.elf

Jira: ZEP-818

Change-Id: I7992a3e2af7d419081ee5a64d7cc2d49fb628ead
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-12-02 12:40:50 +02:00
Juan Manuel Cruz Alcaraz
92539f21fc enc28j60: Modify echo server and client samples to support enc28j60
Extends the echo server and echo client samples to work with YAIP
network stack with ethernet L2 layer and ENC28J60 ethernet device
on Arduino 101 boards.

Jira: ZEP-859

Change-Id: I242e5555aff18741bf00a551424b081b5396f4b3
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-12-02 12:40:50 +02:00
Flavio Santes
552dfaeaa7 iot/dns: Add DNS Client sample app
This commit adds the DNS Client sample app on top of the new native
IP stack. This sample app supports IPv4 and IPv6. See README_IPv4 and
README_IPv6 files.

Origin: Original

Jira: ZEP-793
Jira: ZEP-855
Jira: ZEP-975

Change-Id: Id78bd634c44e216fd45b395c91d95b71ef68c976
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:49 +02:00
Flavio Santes
eb03404bce iot/dns: Remove legacy DNS client sample code
This commit removes the legacy DNS client sample code.

This patch is part of a commit series that will add support for
DNS client services on top of the new native IP stack.

Jira: ZEP-793
Jira: ZEP-855
Jira: ZEP-975

Change-Id: Ieb3366b21a365b8f77e576109c64c0fc4218aabb
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-12-02 12:40:49 +02:00
Jukka Rissanen
146f0e7b87 net: sample: echo-client ported to use the new IP stack
Change-Id: I1666d0634af124fc7a01027187916f427b7c98f8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:46 +02:00
Jukka Rissanen
35c9098c82 net: sample: Make sure echo-client is compiled by sanitycheck
In some cases the BT header files are missing and the compilation
will fail when done by sanitycheck script.

Change-Id: I484e1f0c23975053e947bc57ff3c9f4042fad71e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:46 +02:00
Andrei Emeltchenko
3bc58717a1 wpanusb: Export ieee802.14.5 over USB
Export ieee802154 radio over USB to be used in other Operation Systems
like Linux. In this scenario Linux SoftMAC driver would be used
implementing ieee802154 stack inside Linux.

Currently tested to work with Raspberry Pi and addon ieee802154 board.

Change-Id: Iabcbbfcaad8e3935a63faca50a19fb624e78a351
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-12-02 12:40:46 +02:00
Tomasz Bursztyka
dd7b967f2d samples: quark_se_devboard has been renamed to quark_se_c1000_devboard
Change-Id: I38942fad17b9955ca4c6e25414284eab465225df
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:27 +02:00
Ravi kumar Veeramally
a026c615ff net: apps: Add DHCPv4 client sample application
Change-Id: Ia0366a24c2bc18cbd9278b7dc7d4a155df6521fb
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:26 +02:00
Ravi kumar Veeramally
eff902b4c7 net: tests: Add include dir only when specific options enabled
Change-Id: I2119c6e08b0d13c6a6849b46f210196b07b8d51e
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2016-12-02 12:40:26 +02:00
Tomasz Bursztyka
203be13f83 net: samples: Add a simple Qemu sample for testing off-line 802.15.4
This will use the dedicated UART pipe driver to send/receive IEEE
802.15.4 "radio" frames.

- make
On one console:
- make qemu1
On a second console:
- make qemu2

Note:
net-tools is needed, cloned into net/tools
https://gerrit.zephyrproject.org/r/#/admin/projects/net-tools

Change-Id: I833cd40238b0653bb5b9a9b462fb4d5d2a3504b9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
60c71f4d90 samples: net: Qemu make utilities update
- net tools directory is now in net/tools
- fixing the 80 chars line limit

Change-Id: I079880fa3449beffb326369ab23550dcba3ccf20
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
49dffe2669 samples: net: Moving the current ieee802154 sample
More samples will come. Current one is meant to test ieee802154 with
cc2520 on quark_se_devboard target. Some future sample will show how to
use the Qemu uart pipe fake 802.15.4 radio driver for testing on one
host.

Change-Id: Idea2b16cde091c7da926ca8aa71912fbfd0a3d62
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
73d8c7c443 net: drivers: cc2520 ieee802154 drivers select relevant options
If no IP stack is seleceted, selecting one of the 2 cc2520 driver will
automatically select the relevant stack.

Change-Id: Icca22da190dc790ce6d302e14c45732f902e02ae
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Tomasz Bursztyka
becf74743b net: Split debug Kconfig options from legacy to new stack
- new stack options are renamed and placed in their respective menus
- new stack Kconfig gets normalized (tabs vs spaces, etc...)

Change-Id: Ia68f6589fed464bbdd76dc0812775684b2f94a58
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:24 +02:00
Jukka Rissanen
58a7ada44c net: Add network address length to user API
Add socklen_t addrlen parameter to net_context_bind(),
net_context_sendto() and accept callback.

Currently the address length option is not really mandatory
as we can figure out the length from the address family.
But if we are going to support other protocol address families
it might be needed.

Change-Id: I59206465c3259050c469c5b2150221646a9a08d7
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:24 +02:00
Paul Sokolovsky
5d7be031f3 net: samples: Fix the echo-server IPv4 address
When running echo-server in the Zephyr device (either a real
device or qemu), set the IPv4 address to be 192.0.2.2. The host
IPv4 address should be set to 192.0.2.1 in this case. This change
is similar to IPv6 address change made earlier (now both IPv4 and
IPv6 addresses on device side end with "2", on host side, with "1").

Change-Id: I639b7be4403b4b2f38f01675d0ef56eaabf0f82c
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2016-12-02 12:40:23 +02:00
Jukka Rissanen
9231f41f52 net: samples: Fix the echo-server IPv6 address
When running echo-server in the Zephyr device (either a real
device or qemu), set the IPv6 address to be 2001:db8::2.
The host IPv6 address should be set to 2001:db8::1 in this case.

Change-Id: Ia967cecabece4b06a2f5a12b11c68a9de4aeb2af
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Jukka Rissanen
0be446ba5f net: samples: Fix slip config for echo-server and echo-client
The prj_slip.conf file should be used for qemu-to-host
communication only. It is not usable for testing between
two qemus.

Change-Id: Id06813a1b36f33f585e06df3f29479891ea3d2d8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Jukka Rissanen
6258dc8e87 net: samples: Fix the location of net-tools project files
Fix the correct location of net-tools project files to
samples/net/README file so that the user can test the
echo-server and echo-client apps using SLIP and Qemu.

Change-Id: Ic34fa6e67da916c63e4f138e1e0def5d7632c80c
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
b84e62f269 samples: Build ieee802154 sample with 6lo support
Debugging messages in 6lo are enabled as well.

Change-Id: I8fea044216e3c4e60d742ebc7256489832ae09ac
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:22 +02:00
Tomasz Bursztyka
ba4dda1703 samples: ieee802154: Debugging needs new Kconfig option
Change-Id: Iad9e5b9a2fda5b2c26697239d5437ff8ae75743a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:21 +02:00
Jukka Rissanen
44e2ce92f5 net: Fix the debug prints in echo-server
Change-Id: I1bda06e3b8727544727d0929aa180022b7a162d5
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:19 +02:00
Tomasz Bursztyka
93ac4a2520 net: Sample code to play with ieee 802.15.4 stack
Meant to setup a real 802.15.4 device, changing channel, pan id, etc...

Change-Id: I221ad197aa221bc8f9ec67d0fd523da2023f7979
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:18 +02:00
Jukka Rissanen
84edd8f2f1 net: apps: Fix echo-server to use the new user API
Echo-server no longer reverses the data as doing it
when we have a fragment chain is quite challenging.

Change-Id: I298669f3ddba67000672320e7b3b14f72e9f12d4
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:16 +02:00
Tomasz Bursztyka
f51d84d93b samples: Fix echo_server for native IP stack
net_context.h is missing and one variable had a wrong name.

Change-Id: I4aac2f5c12cea39553fb86d1bd497c88f0ef1963
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:13 +02:00
Tomasz Bursztyka
260d3b95d7 net: Make net_core.h include the least amount of necessary header
net_core.h is the ground brick of the IP stack, and thus should not
include other headers that might include net_core.h also: this would
create circular dependencies.

Change-Id: I70c17b736788528e4e0b4b5b2c478098b049c9b1
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2016-12-02 12:40:06 +02:00
Jukka Rissanen
73b57414a7 net: Setting static IP addresses for echo-server
This allows to test things between qemu and host when
using slip.

Change-Id: I27e17de9f0d8c2c8406f0afdd66c295e827f87a0
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:05 +02:00
Jukka Rissanen
2f76da194d net: Make echo-server to use documentation IPv4 addresses
Use 192.0.2.0/24 address space that is specified in RFC 5737.

Change-Id: Iff2545f5b0f4817c99813c986d57801e166967a3
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:05 +02:00
Jukka Rissanen
d24f673248 net: Receive IPv4 packet
Check if we have received IPv4 packet and call a handler
function to process it.

Change-Id: I9f9e5f0888d2c3b91401c98f4925647ddce09962
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:02 +02:00
Jukka Rissanen
e6d92ecdcf net: apps: Create a skeleton echo-server for new IP stack
This echo-server does not yet do anything useful.

Change-Id: I317051b3a2bfb0a80584ad385c2f308978a243cd
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-12-02 12:40:00 +02:00
Sudarsana Nagineni
4b7bdf25be usb: Add WebUSB enabled custom class support.
This implements a modified version of CDC ACM class driver
in a WebUSB compatible way. It adds the WebUSB descriptors,
custom and vendor requests handlers so that the host OS and
browsers can get the required BOS descriptor and supported
origins from the device. It also adds a custom interface
class so that the interface will not be claimed by the host
CDC ACM driver.

A simple echo app also included in this commit to demonstrate
how to create and use a WebUSB interface, as well as the
communication between browser and WebUSB enabled device.

WebUSB Spec: https://wicg.github.io/webusb/

Origin: Based on CDC ACM device class driver in Zephyr

Jira: ZEP-744

Change-Id: I2eac10bd718e8fce35cda52e7c2ac425c3210e23
Signed-off-by: Sudarsana Nagineni <sudarsana.nagineni@intel.com>
2016-12-01 01:00:12 +00:00
Baohong Liu
120bc132d1 samples: usb: use unified kernel API
Change-Id: Ie6f74e7d8796190edf5a818d981efcdfbf8ca6ce
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-01 00:41:05 +00:00
Anas Nashif
e868a80a5c samples: tests: tag all legacy test cases and samples
Tag all legacy kernel tests and samples as such.

Change-Id: I43b24acb71c282ed14ff6e6ef06c9542bad86f6a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 21:45:22 +00:00
Anas Nashif
55fa31196e samples: remove legacy usage and convert to unified APIs
Change-Id: Idf281b0bbb7c8f6f1eff74e275d5ebb4e427cd2f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-30 21:45:21 +00:00
Sergio Rodriguez
b0c0548ad6 samples: drivers: current sensing : Exit from testcase if device not found
Exiting from the test case when the i2c device is not found, this
to avoid a null pointer dereference

This issue was reported by Coverity

Coverity-CID: 151982

Change-Id: Ib11224ef2a78170f6e4d20545f645b4f2ea4a181
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-29 03:45:39 +00:00
Sergio Rodriguez
710f9a22a8 samples: drivers: led_apa102c: Exit from testcase if device not found
Exiting from the test case when the gpio device is not found, this
to avoid a null pointer dereference.

This issue was reported by Coverity

Coverity-CID: 151980

Change-Id: I7aafbc993674c8874a16b5a9213108f5769114ec
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-28 17:49:31 -08:00
Jithu Joseph
a3db0d1313 samples: event_collector: Remove redundant check
Removes a redundant check flagged by coverity.

Coverity-CID: 152005

Change-Id: I8cc3a64c42e04a2d52deed11d9022ed4a49baaa7
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-11-28 20:51:44 +00:00
Yossi Havusha
85b954dc4c logging: add exeternal hook to sys_log
By adding external hook to sys_log we will allow applications
the flexibility of using various output mechanism such SPI,
flash, FS etc.

Jira: ZEP-1172

Change-Id: Ie32a5e52c3946ada0349b75a35cc107bb29385a1
Signed-off-by: Yossi Havusha <yossi.havusha@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-27 23:07:35 -05:00
Flavio Santes
328ecb8dfd samples/sensors: Update README files
Remove nano kernel references found at the README files.

Change-Id: Id42f4797561f3d7674110bb84531b5f6e487decd
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-26 10:46:10 +00:00
Flavio Santes
5f52743f09 samples/nfc: Update sample app
This commit updates the nfc_hello sample application:

- Use new kernel API
- Update testcase.ini platform whitelist
- Coding style issues

Jira: ZEP-1348

Change-Id: I2c17e40d654e33a46af02ee2f20d4a88136fcf2d
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-25 16:50:20 +00:00
Flavio Santes
90fefd6dd4 samples/nfc: Update README file
This commit updates the README file adding:

- Build instructions
- Sample output

Jira: ZEP-1348

Change-Id: If2ade8ad505bd24e7fd76f5b835355cf398d8e82
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-25 16:50:20 +00:00
Flavio Santes
c7fe8f2193 samples/nfc: Remove x86 asm code
This commit replaces the x86 asm line:

__asm__ __volatile__ ("bswap %0" : "=r" (x) : "0" (x));

by the sys_cpu_to_be32 macro.

By removing the x86 asm instruction, the nfc_hello sample app
can run on other platforms.

Jira: ZEP-1348

Change-Id: I440e96cd06e70a88552d179a2288c9918e6ca0b0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-25 16:50:19 +00:00
Anas Nashif
9f884155ab Merge "Merge bluetooth branch into master" 2016-11-19 01:52:15 +00:00
Benjamin Walsh
dd2f554239 samples: configure philosophers with more than 32 priorities
To have one project use more than 32 priorities. The preempt priorities
are also aligned so that they straddle two priority bitmaps.

Change-Id: I0f0862110d876e40fde45a0d105b769e8603d644
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-18 23:45:35 +00:00
Juan Manuel Cruz
ec27d03ed4 sensor: fixes program hangs in the apds9960 sample
If an i2c transaction fails the sample will hang the program into
an infinite circle.

This commit will remove the infinite circle and report back the
error code from the i2c transaction.

Change-Id: I38d350a805af6bec43f2fa8d4af6ce4e3cc27662
Coverity-CID: 151991
Coverity-CID: 151992
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:17:30 +00:00
Juan Manuel Cruz
2936f0e00e sensor: fixes dead code in the apds9960 sample
If the gpio or spi devices are not found there is no
need to keep the device busy in a loop for this particular
sample.

Since it is not possible to continue execution it is better
to simply end the application.

Change-Id: Ie25ea970a479db2a2f339ca2b37f88541a45ef97
Coverity-CID: 151973
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:17:29 +00:00
Inaky Perez-Gonzalez
ee387f0b6e samples/kernel_event_logger: initialize variable
Fix usage of an uninitialized variable detected by Coverity.

In theory GCC should pick up this situation, but it does not. I've
experimented with adding -Wextra and -Wuninitialized but I cannot get
GCC to complain. I might be missing something else, but in the
meantime, this is a simple fix to remove this issue.

Change-Id: I6fec37719719dfaf7077ce1f464605c93efa8ea2
Coverity-ID: 152054
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-18 19:44:11 +00:00
Johan Hedberg
2469bd6f87 Bluetooth: Use convenience macros for timeout durations
Using the K_* macros makes it easier to read what exactly the various
timeouts are.

Change-Id: Ia405d3760b8e600af7e33a7221ef6ec717708973
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-18 07:47:50 +02:00
Baohong Liu
5e892b7e1e samples: grove_lcd: stop the app if device binding fails
Proceed to LCD programming only if device binding succeeds.
Otherwise, dereferencing a NULL pointer will happen. This
was caught by Coverity.

Coverity-CID: 151986

Change-Id: Ibdb658f530203428aa3e53f358e0788fc1502b06
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-18 02:07:14 +00:00
Baohong Liu
2ca689da91 samples: button: stop the app if device binding fails
Stop the app from running if device binding fails. Otherwise,
dereferencing NULL pointer will happen. This was caught by
Coverity.

Coverity-CID: 151988

Change-Id: I8245d938498a51123249fbd069935900ad660314
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-18 02:01:22 +00:00
Baohong Liu
b18e4307b6 samples: net: fix a memcmp len error
The memcmp is a comparison between two strings or buffers.
So, the length should be the buffer length, not the length
of the pointer to the buffer. This was caught by LLVM.

Jira: ZEP-1179

Change-Id: I7fd6b199686b19e7f4a2e1288897483e69ad091e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-18 00:20:12 +00:00
Jithu Joseph
091048172f samples :usb : Check return value fix
This commit fixes a missing function return check reported by
Coverity.

Coverity-CID: 151949

Change-Id: Iedf090b7f2ded9f20ff6d796f1cd5c02990b0a4e
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-11-18 00:12:23 +00:00
Sergio Rodriguez
b03ddf491f samples: drivers: gpio: Exit from testcase if device not found
Exiting from the test case when the gpio device is not found, this
to avoid a null pointer dereference

This issue was reported by Coverity

Coverity-CID: 151980

Change-Id: I44f13131d44c7c093781e1f11f8481e7ef8175c9
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-18 00:05:31 +00:00
Sergio Rodriguez
41004171d3 samples: drivers: i2c fram : Exit from testcase if device not found
Exiting from the test case when the gpio device is not found, this
to avoid a null pointer dereference

This issue was reported by Coverity

Coverity-CID: 151982

Change-Id: Ifaed47b2b48359dacfdb3111ca2895d5912779e6
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-18 00:01:34 +00:00
Sergio Rodriguez
02902df44b samples: aio comparators: Use expected pointer type in printf
The data structure member being used  is character array,
dereferencig this array gives **char instead of the expected
*char type.

This issue was reported by Coverity

Coverity-CID: 152030
Coverity-CID: 152033

Change-Id: Ied67e4b2d47017e6ad5e40b9b6fca1b496c483ed
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-17 14:23:13 +00:00
Flavio Santes
5f818bfcd3 sensors/mcp9808: Evaluate sensor_channel_get return code
The sensor_channel_get return code is now evaluated.

Change-Id: Ib931d6caba65af7195bad53c62e6e5a3033b49e8
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-17 01:30:00 -06:00
Flavio Santes
0e20d45272 sensors/mcp9808: Evaluate sensor_sample_fetch return code
sensor_sample_fetch return code is now evaluated.

Coverity-CID: 151957

Change-Id: I79b9f44c79ac13e8d7da55c9e3866ad504a4a450
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-11-17 01:25:12 -06:00
Ramesh Thomas
1b1068a2b4 samples: power_mgmt: Remove platform filtering of testcases
Remove redundant platform filtering and only use SOC filtering

Change-Id: Ib823e076a874ce61a235eca63eebb7f19d2fdd30
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-11-16 02:18:27 +00:00
Baohong Liu
36b398f89f samples: button: fix variable type mismatching issue
The variable type mismatching was caught by LLVM.

Jira: ZEP-1179

Change-Id: I084406601badc64c257cbdd82b9c8b7509549303
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-16 02:09:11 +00:00
Baohong Liu
8bbff61874 samples: usb: fix variable type mismatching issue
The variable type mismatching was caught by LLVM.

Jira: ZEP-1179

Change-Id: I402c348af142342e37e93619c4da6e3a5bfd82da
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-16 01:27:29 +00:00
Ramesh Thomas
e46d125e07 samples: power_mgmt: Remove redundant sample power_hooks
This sample was created intially when there were no other
samples in place to enable the CONFIG flags to build code
inside those flags. However, those CONFIG flags are now
guarded with corresponding "SUPPORTED" flags which are
enabled based in Kconfigs of socs based on their support
for that power feature. This app is for x86 and those
features will not get enabled for this configuration. If
it is still required, then we would need to fake such
support in Kconfig.board of qemu_x86. Removing it, because
those flags will get enabled by sample and test apps of
socs that support the power features, causing code inside
them to get built.

Change-Id: I647be9289a49d69880811abee499a4efd61bbc6a
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-11-16 00:23:02 +00:00
Ramesh Thomas
3e1ee1b8e4 samples: power_mgmt: Cleanup and update with new pm interface
Cleaned up and removed some unnecessary code to avoid
distraction from main sample implementation. Updated some
logic based on new PM interface in soc area. Updated README
to indicate it supports x86 and ARC and updated sample
output of both architectures.

Change-Id: I1c9c8348dae403b7ca6fe17ab867e3fbef06ae60
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-11-16 00:20:27 +00:00
Anas Nashif
ae09e0761b samples: ipm: convert sample to use unified APIs
Change-Id: Ibeadd2e8d9efa2380f21a091ab5645c4b69a4841
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-13 13:53:53 +00:00
Johan Hedberg
1e20e8dc04 Bluetooth: Fix left-over usage of TICKS_NONE and TICKS_UNLIMITED
Switch left-over usage of TICKS_NONE and TICKS_UNLIMITED to the new
unified kernel counterparts K_NO_WAIT and K_FOREVER.

Change-Id: I2f2a16360e816f9f8791eb216deb3c70b8cc87df
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-12 19:27:34 +02:00
Daniel Thompson
560afde9c3 build: Document outputexports
In addition to providing documentaton, we also modify the static_lib
example to use outputexports instead of the double-include
Makefile.toolchain trick. For this to work well we need to fix a tiny
bug in the dependency handling in Makefile.inc.

Change-Id: I6571bc681bc34155f37cff1eccc2ea12ed52ef07
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-11-12 02:08:08 +00:00
Jithu Joseph
2589d8b815 samples : usb: sample to demo USB UART console output
Sample to show the USB UART console output.

Jira : ZEP-775

Change-Id: I70220daf8e63a0847b10cc094665ef6a4bc38907
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-11-12 01:39:30 +00:00
Anas Nashif
3fe2575f0d drivers: sensors: use unified kernel threads
convert all sensor drivers to use threads and the unified kernel API and
remove all legacy APIs.

Change-Id: Ica43ea74ecbbf85273f718f182c413a9dcd8abc6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 21:00:19 +00:00
Ramesh Thomas
8367056efa power_mgmt: Rename _sys_soc_resume notification disabling API
The API to disable _sys_soc_resume notification is currently
called _sys_soc_disable_wake_event_notification. This is
misleading because it is possible that the ISR from which
_sys_soc_resume is called could be from a different interrupt
with higher priority that happened before interrupts were
enabled. More accurately, it is a notification of exit from
kernel idling after pm operations.

Jira: ZEP-1271
Change-Id: I83747f2cacac1bc17f135d12f4aa4478970fc02d
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-11-11 20:40:54 +00:00
Anas Nashif
f528c09276 samples: task_profiler: move to legacy applications
Change-Id: Ib0e97106ccb835331b423b42052aafa23b76ad84
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 20:28:03 +00:00
Anas Nashif
25565e5408 samples: logger: move to legacy applications
Change-Id: I5d6bb0d36fedc626026bc5c3b7355f2c852b2869
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-11 20:28:03 +00:00
Johan Hedberg
35376eed13 Bluetooth: samples/hci_ecc: Switch to using k_thread_spawn()
Switch from fiber_start() to k_thread_spawn(). Also switch to
k_yield() from fiber_yield() in the same go.

Change-Id: I2dc480310f981112063651b61b0ceedf38601bee
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 10:57:23 +02:00
Szymon Janc
2b16287286 Bluetooth: Use proper timeout defines for net_buf_get_timeout
Use defines from k_fifo intead of legacy API.

Change-Id: Ib8cf0d88240ef145da550b8cf83d2580e7140521
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 06:00:28 +00:00
Szymon Janc
2f45faba8c net: buf: Use unified k_fifo API for FIFOs
Only net_receive() is using non-special value for net_buf_get_timeout
so this change is included here. Other users are using special values
which are already correctly handling ticks vs ms change.

Change-Id: Ib12d34ac5a546b36fa7b35615f082c82a256bd07
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 06:00:17 +00:00
Szymon Janc
051f97bd7a Bluetooth: samples: Fix use of deprecated sleep API
Use new sleep API or remove sleeps where not needed.

Change-Id: I88c0973e57eb4970b68b3f4fa428683191b1a7f0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 07:59:15 +02:00
Szymon Janc
0a38788c92 net: buf: Use new API for checking if executing from ISR
CC      net/buf.o
zephyr/net/buf.c: In function 'net_buf_get':
zephyr/net/buf.c:103:2: warning: 'sys_execution_context_type_get' is
     deprecated [-Wdeprecated-declarations]
  if (buf || sys_execution_context_type_get() == NANO_CTX_ISR) {
  ^

Change-Id: I580469d4958451cfa05f56c579eae340ec003a3d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 07:59:15 +02:00
Szymon Janc
619d7bafd9 Bluetooth: samples: Fix using nano_delayed_work in eddystone
This fixes warnings related to the use of nano_delayed_work.

Change-Id: Ie20fb47fc6d5c486ff885ad583354eb715d12c1b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 07:59:15 +02:00
Szymon Janc
47eaaf9f96 Bluetooth: Use unified k_fifo API for FIFOs
Change-Id: I6ddc24575e4bf3c3040945a2bdb62f153b15cdb3
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-11 07:59:15 +02:00
Johan Hedberg
3062516a1a Bluetooth: Controller: Improve default RX/TX buffer counts
Currently the ideal buffer counts for a controller-only build are 6 RX
buffers and 7 TX buffers: ATT_MTU of 158 bytes can be sent in one
connection interval of 6 tx/rx -es wherein connection interval is
7.5ms

Change-Id: I64b4620c5e8e7db8d7ed72fa1db82e266e121f27
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 07:59:15 +02:00
Johan Hedberg
a3c057a5e9 Bluetooth: samples/hci_uart: Remove redundant semicolon
Remove redundant semicolon from the end of a while loop.

Change-Id: I02cef7879efe0d6eeae59595e14fb1d9b00a6d52
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 07:59:15 +02:00
Johan Hedberg
a8506f7814 Bluetooth: samples/hci_uart: Declare assert handler only when needed
If support for the controller assert handler isn't enabled the
function shouldn't exist.

Change-Id: I72076eb1001980f102a0404c91d22e41582ced25
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 07:59:15 +02:00
Johan Hedberg
a69996210f Bluetooth: samples/hci_uart: Remove dependency on controller
Don't use a controller define if controller support is not enabled.

Change-Id: I837b3b66f010dfbdf2d9099acd85fa29fce954b7
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 07:59:15 +02:00
Johan Hedberg
c583a9f43b Bluetooth: Kconfig: Restructure for a more logical hierarchy
Restructure the Bluetooth options more logically.

- Both host and controller are now behind the same high level
  CONFIG_BLUETOOTH.

- Selecting controller support disables other HCI driver selection, so
  the controller isn't in the same list as HCI drivers any more.

- Under the top-level there's a "Custom stack" option, which when
  enabled opens up the option of choosing CONFIG_NBLE.

There are various other cleanups and simplifications in this patch as
well, since splitting these up would have been fairly tricky while
making sure all test cases still build.

Change-Id: I5bb715cb9d20201cb8b72fbd149c8a09a4b2d7d2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 07:59:15 +02:00
Carles Cufi
f7d313b154 Bluetooth: Controller: Add ASSERT info dump on HCI builds
When building Zephyr in the controller-only configuration,
assertions that happen in the Link Layer code are not visible
to the Host which is running on another HCI and connected via
UART or USB to it. This patch allows the Controller code
to output the assertion line number when in such a configuration,
allowing the Host to view the event to help debugging.

The event format used is temporary and will be replaced by a
standardized Vendor Specific specification to come at a later
time.

Change-Id: I013ca6783a3fdedc47b171132919dd4798c66285
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-11-11 07:59:15 +02:00
Johan Hedberg
3fc4fd53f6 Bluetooth: samples/hci_uart: Add micro:bit configuration
The BBC micro:bit doesn't have UART HW flow control, so it needs to be
disabled to build for the board. The baudrate is also lowered to
115200 since 1Mbps is likely to be unreliable without flow control.

Change-Id: I1725a2a1e46cfbc0f57b4f5c4ee57ff52d9670e9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-11 07:59:15 +02:00
Julien Delayen
f540cbc5c5 power: Add ARC power states and update sample
Add Low Power States support to the power shim layer
and show the usage in the quark_se sample.

States are defined as follow:
- SYS_POWER_STATE_CPU_LPS: SS2 with LPSS enabled
- SYS_POWER_STATE_CPU_LPS_1: SS2 with LPSS disabled
- SYS_POWER_STATE_CPU_LPS_2: SS1 with LPSS disabled

Jira: ZEP-994

Change-Id: Ie4b93f6e539cb53fc035be00280b66b2cb0d9fea
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
2016-11-11 03:28:54 +00:00
Sergio Rodriguez
d56714b1c7 samples/net: mbedTLS TCP client use unified thread spawn API
Change-Id: Ic0c5f9abf94c593ce4aad09faff0b7bcac4e2cd8
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-11 02:51:32 +00:00
Sergio Rodriguez
fdc93c4733 samples/net: mbedTLS TCP client use unified kernel
Removing unnecesary flags

Change-Id: I2c72678dc8ba38ae0bd85459c2ea97d0de676314
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-11 02:51:31 +00:00
axy
c4546589fb Revert "build: Document outputexports"
This reverts commit d4d9ac2d21.

This is broken:
core:static_lib(master): sanitycheck -T .
Generating LALR tables
Cleaning output directory /home/nashif/Work/zephyr/sanity-out
Selecting default platforms per test case
Building testcase defconfigs...
1 tests selected, 28 tests discarded due to filters
total complete:   1/  1  failed:   0
1 of 1 tests passed with 0 warnings in 0 seconds
Traceback (most recent call last):
  File "//home/nashif/Work/zephyr/scripts/sanitycheck", line 1887, in <module>
    main()
  File "//home/nashif/Work/zephyr/scripts/sanitycheck", line 1879, in main
    ts.testcase_report(LAST_SANITY)
  File "//home/nashif/Work/zephyr/scripts/sanitycheck", line 1551, in testcase_report
    rowdict["ram_size"] = goal.metrics["ram_size"]
KeyError: 'ram_size'
core:static_lib(master): find -name *elf
core:static_lib(master): make pristine
make -C mylib clean
make[1]: Entering directory '/home/nashif/Work/zephyr/samples/static_lib/mylib'
Makefile:19: *** $(O) is not set.  Try `make all-mylib` from hello_world.  Stop.
make[1]: Leaving directory '/home/nashif/Work/zephyr/samples/static_lib/mylib'
Makefile:37: recipe for target 'pristine' failed
make: *** [pristine] Error 2

Change-Id: I61700b0df34790aef94a6700c7c7e0605343787f
Signed-off-by: axy <anas.nashif@intel.com>
2016-11-11 01:14:51 +00:00
Daniel Thompson
d4d9ac2d21 build: Document outputexports
In addition to providing documentaton, we also modify the static_lib
example to use outputexports instead of the double-include
Makefile.toolchain trick.

Change-Id: Iafe045ccc5dbbbd4063f836cc63057b4b06f7727
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
2016-11-10 23:19:32 +00:00
Baohong Liu
933e34621b samples: spi_fram: add spi FRAM sample app
Add a sample app to demonstrate the usage of Fujitsu SPI
FRAM.

It uses SPI 1 on quark spi controller and gpio 20 as CS.

Change-Id: I30c83bdd8312ca0cab7a62e397c0cb4ade0821cb
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-09 20:33:04 +00:00
Sathish Narasimman
46972b1822 Bluetooth: Sample: handsfree sample application
Samble bluetooth application for handsfree profile

Change-Id: I280a313afef4c842896c6470a473127e03dacd88
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2016-11-09 08:57:52 +02:00
Johan Hedberg
87e18b4fbb Bluetooth: samples: Use consistent naming for HCI apps
The convention for Zephyr sample names is to use _ instead of - for
delimiting words.

Change-Id: I08a63e9f600deb38183f81ddb8f8bf407b6eec2e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 08:57:52 +02:00
Jithu Joseph
cc9cdadeae samples: usb: Sample to demo USB Mass Storage support
Sample to put the device in USB mass storage mode via
config options.

Change-Id: Icaf4839d8e8ac0526d1b723adc87607d6b4df9d7
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2016-11-09 02:45:47 +00:00
Benjamin Walsh
0d5f541052 samples: remove useless prj_unified.conf from kernel logger sample
Change-Id: I67c8afd4ba7b89953a1d4adb19febba2f0ae8165
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-08 23:38:41 +00:00
Andrew Boie
252144f6e8 samples: remove old kernel support
Change-Id: I89ab1e1926e2e8f07f8c8d5538a7587a605cb36b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-07 11:34:18 -08:00
Andrew Boie
ef09f8dd5f tests: remove errant -O0
Should never be necessary.

Change-Id: I8c7d1be3e9c9279e12ed6f26d8ab8404ee7d6cb0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-07 19:29:01 +00:00
Sergio Rodriguez
ddd47e2292 samples/net: mbedTLS TCP client use unified kernel
Use unified kernel.

Change-Id: I533321e908de999d9da9bd26adfc6215175a0cd9
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-05 13:01:21 +00:00
Benjamin Walsh
8cf56bcac7 unified: dissociate system workqueue from common workqueue module
Making a reference to the common work queue code should not necessarily
drag in the system workqueue, since it is possible to use a workqueue
that is not the system workqueue. This is done by moving the system
workqueue into its own code module.

Moving the system workqueue to its own code module allows removing the
NANO_WORKQUEUE and SYSTEM_WORKQUEUE kconfig options, and compiling the
common workqueue code and system workqueue all the time. They are only
linked in the final image if a reference to them exist, same as the
other kernel modules.

Change-Id: I6f48d2542bda24f4702e7c2e317818dd082b3c11
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-11-04 22:39:54 +00:00
Johan Hedberg
ac844cf687 Bluetooth: Remove misleading NBLE mentions from sample README files
The README files provided with the samples contain references to NBLE,
which is not a publicly supported solution for Bluetooth. Simply
remove these files. If the need arises to provide application-specific
information in the future we can add back per-application README
files.

Jira: ZEP-1183

Change-Id: I81b3ea5491d50fb16062ccd5a421ddc8fcb7ea42
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-04 22:05:05 +02:00
Anas Nashif
d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Sergio Rodriguez
fdf77e56bc samples: aio_comparator: use unified kernel
Use unified kernel for AIO comparator sample app.

Change-Id: Id6a9016a9c00d7400395dfbc431d7438804ffe37
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-04 17:26:16 +00:00
Anas Nashif
213b972f97 samples: shell: remove useless ifdefs
Change-Id: Ic164b952205dcadb80f9d9765f9618a6bcb487b5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 13:48:16 +00:00
Anas Nashif
b27d3a8a60 shell: split kernel shell into separate module
Add kernel functions to kernel module and make it part
of the shell sample.

Change-Id: If5e8ff8ce7b8edbbb8d62509964700b007eaf88b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 13:48:15 +00:00
Baohong Liu
611420ced4 samples: spi_lsm9ds0: use unified kernel
Use unified kernel for lsm9ds0 (spi) app.

Change-Id: Ibd559b6879984d3964ba9e3f3d49d88e85291d8c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-04 01:39:49 +00:00
Ramesh Thomas
2375f05f2e samples: power_mgmt: Fix README inconsistent info
Update outdated content in the README file

Change-Id: I2f2576bd63915f4e471d4c9185b82aa2ab57bc24
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-11-03 14:48:38 -07:00
Ramesh Thomas
b21f2fad3d samples: power_mgmt: Make samples unified kernel based
Port the sampe apps to use unified kernel and its apis.

Change-Id: Iee0a21df8008f27cfdbc9db50b66bd183d531f9c
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-11-03 14:43:50 -07:00
Julien Delayen
fec01af64a power: Update Quark SE PM layer with QMSI 1.3
QMSI 1.3 natively supports restoring the SoC and peripherals
after sleep.

The Zephyr Power Management shim layer is updated
in order to support QMSI functions.

The following functions have been added:
void _sys_soc_set_power_state(enum power_state);
void _sys_soc_power_state_post_ops(void);

In order to fully support deep sleep, the function
_sys_soc_set_power_state now support saving and
restoring CPU context and returns to the application.

_sys_soc_set_power_state function also abstracts
QMSI cpu states and enable the application to choose
between C1/C2 or C2LP states.

The QMSI power states are mapped as follows:
SYS_SOC_POWER_STATE_CPU_LPS -> power_cpu_c2lp
SYS_SOC_POWER_STATE_CPU_LPS_1 -> power_cpu_c2
SYS_SOC_POWER_STATE_CPU_LPS_2 -> power_cpu_c1
SYS_SOC_POWER_STATE_DEEP_SLEEP -> power_soc_deep_sleep
SYS_SOC_POWER_STATE_DEEP_SLEEP_1 -> power_soc_sleep

The following functions have been removed:
void _sys_soc_set_power_policy(uint32_t pm_policy);
int _sys_soc_get_power_policy(void);
FUNC_NORETURN void _sys_soc_put_deep_sleep(void);
void _sys_soc_put_low_power_state(void);
void _sys_soc_deep_sleep_post_ops(void);

Those changes are propagated to the samples.
All calls to QMSI are removed.

Jira: ZEP-1045, ZEP-993, ZEP-1047

Change-Id: I26822727985b63be0a310cc3590a3e71b8e72c8c
Signed-off-by: Julien Delayen <julien.delayen@intel.com>
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-11-03 21:31:30 +00:00
Sergio Rodriguez
a770264ef3 samples: sensor_apds9960: convert to and build with unified kernel
Change-Id: I73863da2e9539fbcde79b39561badcd24c0bda80
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-03 21:00:41 +00:00
Kumar Gala
6f6632ddc5 tests: Mark a bunch of testcases that are memory (RAM) limited
These testcases can't build on common platforms with 16K or less of
memory.

Change-Id: Iade2aa423f42a1f174a5ebb5d183b362917f503e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-03 19:20:19 +00:00
Baohong Liu
f960e0fa08 samples: w25q80bl: remove the sample app
Remove this sample app. The component is no longer on the
board (quark_se_c1000_devboard).

Change-Id: I342616781e6f343cfc66b89cbdf85de5844f6f4a
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 12:03:08 -07:00
Baohong Liu
3a8d3dd07d samples: lcd_hd44780: use unified kernel
Use unified kernel for lcd hd44780 app.

Some delays were rounded up to multiples of millisecond, since
k_sleep only takes multiples of millisecond. Based on the lcd
datasheet, this should not cause any problem.

updated some comments based on what the code is actually doing.

Change-Id: I533c822dbaea0246dcd62a76cc23ce0d8edd4630
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 01:46:11 +00:00
Anas Nashif
30c5be3f10 sensors: grove temp: convert to and build with unified kernel
Change-Id: I836802a97b83c31494f617f8f3ed6f6ffea592b7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:52 +00:00
Anas Nashif
8d78938a97 sensors: light: convert to and build with unified kernel
Change-Id: I05f1e7af66b7dec5616db449459bb07a445fe2a0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:51 +00:00
Anas Nashif
629393192f sensors: tmp112: convert to and build with unified kernel
Change-Id: I8ba57652db533fc19ebecf213dccf1564ba85f61
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:51 +00:00
Anas Nashif
79232914c9 sensors: th02: convert to and build with unified kernel
Change-Id: Idcdce36314dce4bfe9f6cf627c38b9f350b19355
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:50 +00:00
Anas Nashif
bf169afd46 sensors: sx9500: convert to and build with unified kernel
Change-Id: Ic3e8d0c59eda97759f1d56127f42120b0c0a6def
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:50 +00:00
Anas Nashif
5d3634d0b1 sensors: mcp9808: convert to and build with unified kernel
Change-Id: I8bd15fd5c353c2040ffb99e759b7739d435f2829
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:49 +00:00
Anas Nashif
ee23f1464b sensors: max44009: convert to and build with unified kernel
Change-Id: I024d00dfd264b9ca8afb682f4146176678440ed8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:49 +00:00
Anas Nashif
1dc946bda1 sensors: magn_polling: convert to and build with unified kernel
Change-Id: Ib0c364c1e9faa95adf8e7a5dde8d6aa1214d9771
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:48 +00:00
Anas Nashif
159b27f3c5 sensors: bmg160: convert to and build with unified kernel
Change-Id: I4571cc371dcbbfaaf1a6b3a9abacac1f4b6e2821
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:48 +00:00
Anas Nashif
9a82a81d58 sensors: bmi160: convert to and build with unified kernel
Change-Id: I63bf181b6ec84e21a2e83bb5bce4ffb57b3affe8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:47 +00:00
Anas Nashif
221bb6979b sensors: bme280: convert to and build with unified kernel
Change-Id: I721ae3a9b982ff4571e7e9bc966df8c79c4dc6c3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-03 01:45:46 +00:00
Sergio Rodriguez
cce647bf54 samples: watchdog: use unified kernel
Use unified kernel for the watchdog sample app.

Change-Id: I6b53f066033a451c3aafe7f3a528c7f3461ae305
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-03 01:39:52 +00:00
Sergio Rodriguez
3b0ecfa283 samples: current sensing : Use unified kernel for the current sensing app.
Change-Id: I739374a8134963bdca99f6de419809033a8a983e
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-03 01:39:34 +00:00
Sergio Rodriguez
7a0504e303 samples: soc_flash_nrf5: use unified kernel for SOC flash
Change-Id: I6f7a66d69919fe8d44b91ae52cb6f0aae6a3c7ba
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-03 01:39:17 +00:00
Baohong Liu
4b270bb544 samples: led_apa102c: use unified kernel
Use unified kernel for the led app.

Change-Id: Iadfcf9970bfa6a13f61b3b1833de2cf1d4af4b0b
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 17:32:11 -07:00
Baohong Liu
f70bf9366f samples: gpio: use unified kernel
Use unified kernel for gpio app.

Change-Id: I08a85212ef4a06ba702eb0e7654855a9bac559a4
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 00:25:51 +00:00
Baohong Liu
f3d0887fb0 samples: i2c_lsm9ds0: use unified kernel
Use unified kernel for i2c device lsm9ds0.

Change-Id: I1d8626571785bfc856e162bf5e1524a6530fe8e5
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 00:25:33 +00:00
Baohong Liu
4af945ed76 samples: rtc: use unified kernel
Use unified kernel for rtc app.

Change-Id: Ifafe48eb9d955b2954de9341c372e1fbc5538cf1
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 00:25:15 +00:00
Baohong Liu
8a2fbd8c90 samples: spi_flash: use unified kernel
Use unified kernel for spi flash app.

Change-Id: I723841ffd49ec7e36ad8c1aa19b168ba879a122e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 00:25:01 +00:00
Sergio Rodriguez
df605abea4 samples: i2c Fujitsu fram: use unified kernel for fram app
Use unified kernel for i2c Fujitsu FRAM breakout sample app.

Change-Id: I7c6f532850c7944bf1b7470e75fe19bc323b9fbc
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-02 23:20:15 +00:00
Baohong Liu
6dd7080ffb samples: pwm: use unified kernel for servo control app
Use unified kernel for pwm servo control app.

Change-Id: I08106f774f6c7fa2a4cd1fb909529f84905b5ea2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 23:20:00 +00:00
Baohong Liu
dd273ffe7d samples: pwm: use unified kernel for RGB led app
Use unified kernel for pwm RGB led app.

Change-Id: I1b6d62d420371a34a5bada5769bcbea1bc1a9a6a
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 22:14:47 +00:00
Anas Nashif
21a0c5973a samples: cpp synchronization: move to legacy/
Change-Id: I7cc7842238c9e7cca00b45171d90026abfd4e00d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 22:05:29 +00:00
Anas Nashif
886677c3de samples: synchronization: move to legacy/
Change-Id: I72d6fcba0c747e27c0e9cb9fade7abcf8bd077bc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 22:05:29 +00:00
Anas Nashif
269d38bcda samples: philosophers: move legacy applications to legacy/
Change-Id: Id67ecd44e44be4821bad8894154cfbcbdcea0634
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 22:05:28 +00:00
Baohong Liu
c5a5397804 samples: pwm: use unified kernel
Use unified kernel.

Change-Id: Ifd7f6d9779759bd78fef734519fd48f0d0c5fc4a
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 20:54:05 +00:00
Baohong Liu
94bf561cf1 samples: pwm: use unified kernel
Use unified kernel.

Change-Id: I9602ccde67a3f77addedd8ce9470795d9502c020
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 20:53:34 +00:00
Yael Avramovich
d5db35204a console: shell: Support multiple modules
Ability to use Zephyr shell by multiple modules simultaneously, each
module for its own usage.

Old shell implementation enabled the user to call only one module
commands, not all of the modules simultaneously.

Change-Id: I0ef8fa2fd190b7490c44fe91d1016363258302c9
Signed-off-by: Yael Avramovich <yael.avramovich@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 00:23:18 +00:00
Johan Hedberg
142b75fddb Bluetooth: samples/hci-uart: Fix minor style issues
Fix minor style issues with excessive whitespace for alignment and
lack of 'static' for the tx_fiber_stack.

Change-Id: I0c761e94e6a6789a3772b08b0774cd1a5e73c2ef
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
1b804f9d74 Bluetooth: samples/hci-uart: Fix up configuration files
Right now the hci-uart samples doesn't really work anywhere else than
nRF5x, so make that the default configuration. Also rename the old
prj.conf to generic.conf to give a generic starting point for creating
configurations for other targets.

Change-Id: I1c940339b457d0e77c8ddad4b2474fc7e5b12a51
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Carles Cufi
20952b75e3 Bluetooth: uart: Fix UART TX stall condition
In 3 of our UART driver implementations the ISR is exclusively
used and enabled for the RX path. The existing logic was
susceptible to a stall situation where a polled out transmission
would be interrupted by a reception and then the ISR code
would loop forever due to the TX event being signalled (although
the interrupt itself was disabled) causing the ISR to keep
looping for an RX interrupt.

Change-Id: Ic379e58b1c974aca3cee37d2d81f12c3726fb160
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-11-01 21:40:39 +02:00
Johan Hedberg
a3a74de6ba Bluetooth: samples/hci-uart: Remove unneeded hci_driver.h include
There's no need for this app to use the HCI driver API directly.

Change-Id: Ie5acfbfb09fc3f86c3f29f22fbf7da7db1ff2127
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 21:40:39 +02:00
Johan Hedberg
900fbc20ba boards: x86: Don't default to 'y' with NRF51_PM and WAIT_NOP
These options were only needed for a MyNewt-based nRF51 firmware on
these boards (the MyNewt BLE stack is called Nimble, hence the
prj_nimble.conf sample config files). With a Zephyr-based nRF51
firmware these options are no-longer needed, so it's not appropriate
to have them default to enabled. Instead, if they are needed, require
the app-specific configuration to enable them.

Change-Id: Iefbee4d97590af4e11bcedea05fe61f32a147b83
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-01 19:37:26 +00:00
Anas Nashif
0ad8e7c21a samples: convert to unified applications
Change-Id: Ic65886b9144e4c8b738f94ab228541ef4a34dea3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
ea607625a3 samples: synchronization no need to set unified_capable tag
We are building for unified kernel by default. This avoids running the test
twice.

Change-Id: I2951464f448b3019c236ce5943df55c052b427d9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 13:42:17 -04:00
Anas Nashif
b4dc970a7c tests: convert loopback test to unified kernel
Make it run on Qemu only, this test is not intended for HW.

Change-Id: I842d7456f9238221ef5b661749136f4418d5ab16
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-01 10:24:55 -04:00
Anas Nashif
a32579749b ztest: move ztest to unified kernel
ztest was not working with unified kernel and v1 APIs and not many tests are
using ztest right now, so instead of making it work with old APIs, convert it
to unified kernel completely so that new tests written using ztest would be
unified kenrel based.

Change-Id: Ibfcc7783dcb266abbd388662ba61c4b55d32b10c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 21:38:04 +00:00
Anas Nashif
6043c30aa4 tests: samples: exclude quark_d2000_crb from large applications/tests
Change-Id: I108639966d5bb66fb08d745155d692b82c304de1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 16:10:45 -04:00
Baohong Liu
9824608935 samples: pwm: use new API and add rgb led app
Add a new pwm app (rgb led) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to drive a rgb led is added. It will use the new API
pwm_pin_set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Origin: Original

Change-Id: If8e5d8ab22dcf8b7cf3665e38949715c61ca9c03
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:02:23 +00:00
Baohong Liu
22a10c3b6c samples: pwm: use new API and add motor control app
Add a new pwm app (motor control) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to drive a servo motor is added. It will use the new
API pwm_pin_set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Origin: Original

Change-Id: I65857848e64d0478c4e12d1317b2089cdd1ecf5c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:02:06 +00:00
Baohong Liu
0273ddff24 samples: pwm: use new API and add fade led app
Add a new pwm app (fade led) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to fade led is added. It will use the new API pwm_pin_
set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Change-Id: I8d929a21f7de88307c47b52f98f131e00b2fdbe7
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:01:28 +00:00
Baohong Liu
e1db5f2019 samples: pwm: use new APIs and rename the app
Replace existing APIs which will be deprecated by
the new API in this app and rename the app.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

Since the two existing APIs (pwm_pin_set_period and
pwm_pin_set_values) used by this app will be deprecated,
this change is to replace them with the new API
pwm_pin_set_usec().

To demonstrate the usage of the new PWM APIs, more apps
will be added. All the apps will be located in their own
sub directories. The existing app is actually one to
blink LED. So, it is moved the "blink_led" sub directory.

Jira: ZEP-745 ZEP-1029

Change-Id: Icc3fbf6b6c25db9590c63bc08f40ec62c87c0f16
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:01:05 +00:00
Anas Nashif
4d090e09d6 usb: move usb subsystem to subsys/usb and cleanup header inclusion
Change-Id: I5bdfd2cf5fee62af2ca772d778477f4f378a6a55
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 19:21:42 +00:00
Anas Nashif
fe5f1a51c6 grove: lcd: convert to a unified kernel application
Some minor cleanup and rename of c file to main.c

Change-Id: I8635c9c044f194c5527cd696e9065656403d10c4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-31 15:15:57 +00:00
Johan Hedberg
f4d7538187 Merge bluetooth branch into master
Main changes:

 - Fixes to build with unified kernel
 - Switch to unified kernel for all Bluetooth samples
 - Fixes to controller HCI interface
 - Fix net_buf leak in controller
 - Initial skeleton for AT command support (for Hands-Free Profile)
 - Rename bt_driver API to bt_hci_driver

----------------------------------------------------------------
Anas Nashif (2):
      Bluetooth: cleanup testcase.ini and adapt to current platforms
      Bluetooth: tests optimize testcase.ini for shell and init

Arkadiusz Lichwa (2):
      Bluetooth: L2CAP: Minor cleanup in naming
      Bluetooth: L2CAP: Minor cleanup in conn request

Carles Cufi (6):
      Bluetooth: Controller: Set HCI version to 4.2
      Bluetooth: hci-uart: Use a fiber to offload TX from ISR
      Bluetooth: HCI: Remove "EDR" and "HS" marketing terms from macros
      Bluetooth: hci-uart: Add a sample configuration file for nRF5x
      Bluetooth: Controller: Fix net_buf memory leak in RX path
      Bluetooth: hci-uart: Match controller buffers in UART RX

Johan Hedberg (10):
      Bluetooth: samples/README: Document hci-usb and hci-uart
      Bluetooth: Expose BLUETOOTH_MAX_CONN for controller-only build
      Bluetooth: samples: Remove redundant CONFIG_ARC_INIT=n
      Bluetooth: Rename bt_driver to bt_hci_driver
      Bluetooth: samples/hci-uart: Make sure we yield in tx_fiber
      Bluetooth: drivers/Kconfig: Fix inconsistency issues
      Bluetooth: Fix license header in l2cap.h and rfcomm.h
      Bluetooth: tests/init: Limit controller+host for 32kB RAM platforms
      Bluetooth: samples: Limit tests to just qemu platforms
      Bluetooth: samples/hci-uart: Add arduino_101_ble to tests

Luiz Augusto von Dentz (3):
      Bluetooth: L2CAP: Delete fragments as they are processed
      Bluetooth: GATT: Add helper to discover next range
      Bluetooth: GATT: Add proper check for connection state

Sathish Narasimman (1):
      Bluetooth: Generic AT command implementation

Szymon Janc (12):
      Bluetooth: Include zephyr.h instead of kernel specific headers
      Bluetooth: A2DP: Cleanup headers includes
      Bluetooth: Remove not needed includes
      Bluetooth: L2CAP: Fix build with unified kernel
      Bluetooth: L2CAP: Use helper for accessing nano_sem count
      Bluetooth: RFCOMM: Use helper for accessing nano_sem count
      Bluetooth: A2DP: Remove includes from internal header
      Bluetooth: hci-uart: Don't include nanokernel.h
      Bluetooth: drivers: Remove usued variables from H5 driver
      Bluetooth: drivers: Fix non-ASCII characters in NBLE code comments
      Bluetooth: Use unified kernel build for tests and samples
      Bluetooth: drivers: Include zephyr.h instead of nanokernel.h

 doc/api/bluetooth.rst              |   2 +-
 drivers/bluetooth/Kconfig          |  99 +--
 drivers/bluetooth/Makefile         |   3 +-
 .../bluetooth/controller/hci/hci.c |   2 +-
 .../controller/hci/hci_driver.c    |  20 +-
 drivers/bluetooth/hci/Kconfig      | 116 ++++
 drivers/bluetooth/hci/Makefile     |   2 +
 drivers/bluetooth/{ => hci}/h4.c   |  16 +-
 drivers/bluetooth/{ => hci}/h5.c   |  25 +-
 drivers/bluetooth/nble/Kconfig     |   2 +-
 drivers/bluetooth/nble/gap.c       |   2 +-
 drivers/bluetooth/nble/gatt.c      |   4 +-
 drivers/bluetooth/nble/smp.c       |   2 +-
 drivers/bluetooth/nble/uart.c      |   4 +-
 include/bluetooth/hci.h            |  11 +
 .../{driver.h => hci_driver.h}     |  38 +-
 include/bluetooth/l2cap.h          |  32 +-
 include/bluetooth/rfcomm.h         |  32 +-
 net/bluetooth/Kconfig              |  17 +-
 net/bluetooth/Makefile             |   2 +-
 net/bluetooth/a2dp.c               |   6 +-
 net/bluetooth/a2dp_internal.h      |   8 -
 net/bluetooth/at.c                 | 334 +++++++++++
 net/bluetooth/at.h                 |  82 +++
 net/bluetooth/att.c                |   6 +-
 net/bluetooth/avdtp.c              |   4 +-
 net/bluetooth/conn.c               |   6 +-
 net/bluetooth/gatt.c               | 146 +++--
 net/bluetooth/hci_core.c           |  17 +-
 net/bluetooth/hci_core.h           |   2 +-
 net/bluetooth/hci_ecc.c            |   2 +-
 net/bluetooth/hci_raw.c            |  10 +-
 net/bluetooth/hfp_hf.c             |   2 +-
 net/bluetooth/keys.c               |   2 +-
 net/bluetooth/keys_br.c            |   2 +-
 net/bluetooth/l2cap.c              |  27 +-
 net/bluetooth/l2cap_br.c           |  11 +-
 net/bluetooth/log.c                |   2 +-
 net/bluetooth/monitor.c            |   2 +-
 net/bluetooth/rfcomm.c             |  17 +-
 net/bluetooth/smp.c                |   3 +-
 net/bluetooth/smp_null.c           |   2 +-
 net/bluetooth/uuid.c               |   2 -
 samples/bluetooth/README           |  13 +-
 samples/bluetooth/beacon/Makefile  |   3 +-
 samples/bluetooth/beacon/prj.conf  |   1 -
 samples/bluetooth/beacon/prj.mdef  |   5 -
 .../bluetooth/beacon/prj_nble.conf |   1 -
 .../bluetooth/beacon/testcase.ini  |  12 +-
 samples/bluetooth/central/Makefile |   3 +-
 samples/bluetooth/central/prj.conf |   1 -
 samples/bluetooth/central/prj.mdef |   5 -
 .../bluetooth/central/testcase.ini |  12 +-
 .../bluetooth/central_hr/Makefile  |   3 +-
 .../bluetooth/central_hr/prj.conf  |   1 -
 .../bluetooth/central_hr/prj.mdef  |   5 -
 .../central_hr/testcase.ini        |   3 -
 .../bluetooth/eddystone/Makefile   |   3 +-
 .../bluetooth/eddystone/prj.conf   |   1 -
 .../bluetooth/eddystone/prj.mdef   |   5 -
 .../eddystone/prj_nble.conf        |   1 -
 .../eddystone/testcase.ini         |  12 +-
 .../bluetooth/hci-uart/Makefile    |   4 +-
 .../bluetooth/hci-uart/nrf5.conf   |  13 +
 .../bluetooth/hci-uart/prj.conf    |   1 -
 .../bluetooth/hci-uart/src/main.c  |  43 +-
 .../hci-uart/testcase.ini          |   9 +-
 samples/bluetooth/hci-usb/Makefile |   2 +-
 samples/bluetooth/hci-usb/prj.conf |   1 -
 samples/bluetooth/ipsp/Makefile    |   3 +-
 samples/bluetooth/ipsp/prj.conf    |   1 -
 samples/bluetooth/ipsp/prj.mdef    |   5 -
 .../bluetooth/ipsp/testcase.ini    |   1 -
 .../bluetooth/peripheral/Makefile  |   3 +-
 .../bluetooth/peripheral/prj.conf  |   1 -
 .../bluetooth/peripheral/prj.mdef  |   5 -
 .../peripheral/prj_nble.conf       |   1 -
 .../peripheral/testcase.ini        |  12 +-
 .../peripheral_csc/Makefile        |   3 +-
 .../peripheral_csc/prj.conf        |   1 -
 .../peripheral_csc/prj.mdef        |   5 -
 .../peripheral_csc/prj_nble.conf   |   1 -
 .../peripheral_csc/testcase.ini    |  12 +-
 .../peripheral_dis/Makefile        |   3 +-
 .../peripheral_dis/prj.conf        |   1 -
 .../peripheral_dis/prj.mdef        |   5 -
 .../peripheral_dis/testcase.ini    |  12 +-
 .../peripheral_esp/Makefile        |   3 +-
 .../peripheral_esp/prj.conf        |   1 -
 .../peripheral_esp/prj.mdef        |   5 -
 .../peripheral_esp/prj_nble.conf   |   1 -
 .../peripheral_esp/testcase.ini    |  12 +-
 .../peripheral_hids/Makefile       |   3 +-
 .../peripheral_hids/prj.conf       |   1 -
 .../peripheral_hids/prj.mdef       |   5 -
 .../peripheral_hids/prj_nble.conf  |   1 -
 .../peripheral_hids/testcase.ini   |  12 +-
 .../peripheral_hr/Makefile         |   3 +-
 .../peripheral_hr/prj.conf         |   1 -
 .../peripheral_hr/prj.mdef         |   5 -
 .../peripheral_hr/prj_nble.conf    |   1 -
 .../peripheral_hr/testcase.ini     |  12 +-
 .../peripheral_sc_only/Makefile    |   3 +-
 .../peripheral_sc_only/prj.conf    |   1 -
 .../peripheral_sc_only/prj.mdef    |   5 -
 .../testcase.ini                   |  12 +-
 tests/bluetooth/init/Makefile      |   3 +-
 tests/bluetooth/init/prj.mdef      |   5 -
 tests/bluetooth/init/prj_17.conf   |   2 +-
 tests/bluetooth/init/prj_20.conf   |   2 +-
 tests/bluetooth/init/prj_21.conf   |   2 +-
 .../init/prj_controller_dbg.conf   |   2 +-
 .../bluetooth/init/prj_h5_dbg.conf |   2 +-
 tests/bluetooth/init/testcase.ini  |  81 +--
 tests/bluetooth/shell/Makefile     |   3 +-
 tests/bluetooth/shell/prj.mdef     |   5 -
 .../bluetooth/shell/prj_nble.conf  |   1 -
 .../shell/prj_nimble.conf          |   1 -
 tests/bluetooth/shell/testcase.ini |  49 +-
 .../test_bluetooth/Makefile        |   3 +-
 .../test_bluetooth/prj.mdef        |   5 -
 .../test_bluetooth/src/bluetooth.c |   8 +-
 .../test_bluetooth/testcase.ini    |   8 +-
 tests/bluetooth/tester/Makefile    |   3 +-
 tests/bluetooth/tester/prj.mdef    |   5 -
 .../bluetooth/tester/prj_nble.conf |   1 -
 .../tester/prj_nimble.conf         |   1 -
 .../bluetooth/tester/testcase.ini  |   2 -
 128 files changed, 893 insertions(+), 752 deletions(-)
 create mode 100644 drivers/bluetooth/hci/Kconfig
 create mode 100644 drivers/bluetooth/hci/Makefile
 rename drivers/bluetooth/{ => hci}/h4.c (95%)
 rename drivers/bluetooth/{ => hci}/h5.c (96%)
 rename include/bluetooth/{driver.h => hci_driver.h} (73%)
 create mode 100644 net/bluetooth/at.c
 create mode 100644 net/bluetooth/at.h
 delete mode 100644 samples/bluetooth/beacon/prj.mdef
 delete mode 100644 samples/bluetooth/central/prj.mdef
 delete mode 100644 samples/bluetooth/central_hr/prj.mdef
 delete mode 100644 samples/bluetooth/eddystone/prj.mdef
 create mode 100644 samples/bluetooth/hci-uart/nrf5.conf
 delete mode 100644 samples/bluetooth/ipsp/prj.mdef
 delete mode 100644 samples/bluetooth/peripheral/prj.mdef
 delete mode 100644 samples/bluetooth/peripheral_csc/prj.mdef
 delete mode 100644 samples/bluetooth/peripheral_dis/prj.mdef
 delete mode 100644 samples/bluetooth/peripheral_esp/prj.mdef
 delete mode 100644 samples/bluetooth/peripheral_hids/prj.mdef
 delete mode 100644 samples/bluetooth/peripheral_hr/prj.mdef
 delete mode 100644 samples/bluetooth/peripheral_sc_only/prj.mdef
 delete mode 100644 tests/bluetooth/init/prj.mdef
 delete mode 100644 tests/bluetooth/shell/prj.mdef
 delete mode 100644 tests/bluetooth/test_bluetooth/prj.mdef
 delete mode 100644 tests/bluetooth/tester/prj.mdef

Change-Id: I4ddbfc4dfd66231770dbff937636ca1392fd74bc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 23:17:44 +03:00
Johan Hedberg
506ad96c6f Bluetooth: samples/hci-uart: Add arduino_101_ble to tests
It's important that this configuration stays within the limits of the
Arduino 101 nRF51 (which has only 16kB of RAM, unlike most others that
have 32kB).

Change-Id: I359061f8a41f1373f254c49bff00f551f915bd70
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 20:15:12 +00:00
Johan Hedberg
3564b6f01a Bluetooth: samples: Limit tests to just qemu platforms
For the current purposes it's enough to build these tests only for the
ARM and x86 qemu targets. This also avoids false-positive failures on
platforms that don't have enough memory.

Change-Id: Icbbfc0603feba6bb1ec8a3054f8cdf0800f49ca1
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 20:15:01 +00:00
Carles Cufi
17f7a3cf74 Bluetooth: hci-uart: Match controller buffers in UART RX
Since net_buf_get() for the avail_acl_tx FIFO is called in
interrupt context (ISR) it cannot wait, and it will fail
immediately returning NULL if it fails to acquire a buffer.
During LE Secure Connections pairing, when there is a fair
amount of packets coming from the host, the FIFO was running
out of buffers causing the packet to be dropped instead of
forwarding it to the controller.
The number allocated now matches the amount of TX buffers
in the controller, so that normal HCI flow control (from
the Host to the Controller) will kick-in preventing any
buffers from being dropped.

Change-Id: Ifad4fbac84ae938eb0e68b73a80a02ba79b6ff6e
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-28 20:42:37 +02:00
Anas Nashif
e66112dd07 samples: shell: unify sample and drop nanokernel part
Changed command to reflect features of unified kernel:

* ticks -> uptime
* hightick -> cycles

Change-Id: I2250e3785d71d0d6677f288d85ce0c23b447a93c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-28 16:56:12 +00:00
Marcus Shawcroft
c20b48b9ed samples:dhcp_client: Add frdm_k64f configuration.
Change-Id: I4291c42ee601194c4c2cac0c997a2c48a8d52658
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 12:35:20 +00:00
Marcus Shawcroft
1c33ccfbe9 samples:dhcp_client: Refactor config file selection.
Adjust the dhcp_client sample Makefile to select a project
configuration based on BOARD rather than interface hardware.  This is
more convenient for supporting other hardware than the current
organization and is consistent with various other samples.

Change-Id: I0f59b632144dfa875dc036ec6f4aa4f6657a79bc
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-10-28 12:35:19 +00:00
Szymon Janc
fb5424392b Bluetooth: Use unified kernel build for tests and samples
This makes all Bluetooth samples and tests being build with unified
kernel. main() is now executed from init thread and specifying task
for it in mdef file is no longer needed. By default main stack is
1024 bytes and this should be enough for BT samples.

Change-Id: I6674eea2c028b78ada5190acef72937186738af2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-28 08:30:57 +02:00
Johan Hedberg
326901397f Bluetooth: samples/hci-uart: Make sure we yield in tx_fiber
Whenever the writer of a FIFO is an ISR and the reader a fiber it's
important to make sure that we give the chance for other fibers to run
in case the FIFO keeps getting new data from the ISR without ever
running empty.

Change-Id: I6b40461713d4acfdc6fcec13ff90c9697ff01935
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 08:09:08 +03:00
Johan Hedberg
6989bf88e1 Bluetooth: Rename bt_driver to bt_hci_driver
The bt_driver API was created when Zephyr only had a Bluetooth host
stack, but no controller-side functionality. The only "driver" that
was needed for the host was the HCI driver, and hence "HCI" was
omitted from the name.

With support both for host and controller Zephyr will be getting more
Bluetooth driver types, in particular radio drivers. To prepare for
this, move all HCI drivers to drivers/bluetooth/hci/ and rename the
bt_driver API bt_hci_driver.

Change-Id: I82829da80aa61f26c2bb2005380f1e88d069ac7d
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 08:09:08 +03:00
Johan Hedberg
19138eb2f4 Bluetooth: samples: Remove redundant CONFIG_ARC_INIT=n
CONFIG_ARC_INIT defaults to 'n' now days so there's no reason to try
to explicitly disable it in the sample config files.

Change-Id: I88df06ba23bdac697f0767384f7b88e3bd9fced9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 08:09:08 +03:00
Carles Cufi
a78e8addad Bluetooth: hci-uart: Add a sample configuration file for nRF5x
Add a config file for boards using the Nordic Semiconductor nRF5x
ICs with reasonable defaults in terms of UART configuration and
controller settings.

Change-Id: Iaa5904c96c0f40a2749b7dda0398dd35fa809f24
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-28 08:09:08 +03:00
Szymon Janc
9292a83424 Bluetooth: hci-uart: Don't include nanokernel.h
Include zephyr.h instead which properly includes nano or unified kernel
headers.

Change-Id: I41c848092d022e2b0737ae6b2b53084eaf9bc6a7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-10-28 08:09:08 +03:00
Anas Nashif
d6e2de744b Bluetooth: cleanup testcase.ini and adapt to current platforms
Change-Id: If5df39337aee31c0e72dad8c1a38c69e6c1b0a72
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-28 08:09:08 +03:00
Carles Cufi
3a670fce6d Bluetooth: hci-uart: Use a fiber to offload TX from ISR
Due to the fact that ISRs run at priority 1, the LE_Rand
command was not being rescheduled after CPU sleep to be
able to fill its buffers. By performing all TX (to controller)
work on a fiber, the RNG ISR is able to run and the command
can be executed synchronously in the fiber context.

Change-Id: I3b658e1cab3f80ae655cc88566639a122a361a08
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-28 08:09:08 +03:00
Johan Hedberg
9d04ff3365 Bluetooth: samples/README: Document hci-usb and hci-uart
Add short descriptions for what the hci-usb and hci-uart applications.

Change-Id: Ie06cfa1678243e97b49e5594a00086cbf3c343be
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-28 08:09:08 +03:00
Anas Nashif
27043d71e0 tests: move quark_se boot stub to tests
Lets not confuse user with this code, it is clearly not a sample.

Change-Id: I3a0209fb34b2c97383b0f5382f156b80470fdaf7
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:14:53 +00:00
Anas Nashif
b5427473fc samples: add light sensor sample using the grove kit
Change-Id: Idf88aac781b2fd2314694c38dfa20d36fee517f9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:14:33 +00:00
Anas Nashif
2af8eb17c1 samples: add temperature sensor sample using the grove kit
Change-Id: I94a3648f2a3b0928f38baabcfe4ef47d23a7b9fd
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:14:32 +00:00
Anas Nashif
adf8a30b80 samples: move grove lcd to samples/grove
Change-Id: Ibf97ad2a4bd1234960f6da9585eff122e5876f62
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:14:31 +00:00
Anas Nashif
fa06c5b879 samples: move basic samples to samples/basic
Change-Id: I0915158424d9f105959e436af3378dc52753347c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:14:31 +00:00
Anas Nashif
36e1e2dbaf move tests from samples to tests/
Change-Id: Ib183936134d27ff84d9af57e8e2e2d9f0cc2670f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:13:36 +00:00
Anas Nashif
539003b697 samples: hello world: unify sample and use unified kernel
Change-Id: I4d4124245f394030b19a6b80160685798bd6ae72
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 21:19:36 +00:00
Ramesh Thomas
c7ce43a7b9 samples: power_mgmt: Create unified kernel version of power mgr app
Created unified kernel build setup for the power_mgr sample
app. Currently it shares the same source file between
micro and unified kernels. This is to help test and add new
features from unified kernel. In future, separate source will
be created for unified kernel. After transition is completed,
microkernel version will be removed.

Jira: ZEP-1140
Change-Id: Ic3a0b5cb3adc0749a7084ad785a041fee5875f56
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-27 21:18:44 +00:00
Anas Nashif
febe9f5571 samples: add basic blinky application
The mandatory blinky sample at your service.

Change-Id: I999215fbda338effd6f7b65a2a165acf9b850a9a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 20:56:13 +00:00
Allan Stephens
884d9961ae unified: Add sample project using K_THREAD_DEFINE()
Also demonstrates use of k_thread_spawn() and K_SEM_DEFINE().

Change-Id: Id2f32ea38d2b5fea40f90a7ef6665231e4158cb3
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-27 08:36:14 -05:00
Anas Nashif
91d7bdd54f samples: kernel_event_logger: filter platforms by SRAM size
Change-Id: Ieeede04b122a697ff3cd83252677c0a12e428d56
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 20:56:42 -04:00
Anas Nashif
5925eaf5f1 optimize testcase runs for sensors
Change-Id: If701d1824572bed068712750fbd14758806ba70f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 23:47:39 +00:00
Anas Nashif
511339f54c samples: cleanup sensor samples
- remove useless Kconfigs
- remove SPI DW kconfigs, we now use QMSI driver
- Cleanup readme and turn into ReST

Change-Id: Ie1f39e0afabf499fa81627ded59adf267e01993a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 23:47:21 +00:00
Anas Nashif
95bf69197d samples: sensors: cleanup mcp9808 sample and refine documentation
Enhance documentation and build for Quark D2000 Devboard by default.

Change-Id: I3417c31a8898a076465d25f45d7821820b480290
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-26 23:46:38 +00:00
Benjamin Walsh
c2aecb26cc samples: fix kernel_event_logger to work with unified kernel
The test is modified to key on CONFIG_TASK_MONITOR instead of
CONFIG_MICROKERNEL, since that is what it was really interested in.
Also, this allows the unified kernel to work w.r.t. task monitoring,
since that is a concept that is alien to the unified kernel, since there
are no more task transitions recorded as part of a kernel server. The
unified kernel does not have a CONFIG_TASK_MONITORING option.

To make this work, since the kernel_event_logger sample makes use of the
philosophers demo, the latter had to be modified as well. The nanokernel
philosophers demo would not work with the unifed kernel since it
identifies as a microkernel, and in that case the test would be looking
for symbols defined in an MDEF file, which the nanokernel demo does not
provide of course; the same thing applies to the nanokernel
kernel_event_logger sample. Instead, the demo defines NANO_APIS_ONLY=1,
which is really what it is interested in. To allow that definition to
exist, the nanokernel philosophers demo and both the nano/micro
kernel_event_logger samples add src/ directory with its own Makefile and
add their own phil_fiber.c and phil.h files, which simply include the
original files from the microkernel philosophers demo. As a final
change, the kernel_event_logger samples need a different prj.conf file
for the unified kernel, since it needs a bigger idle stack than the
default, since the kernel event logger does work in the idle thread when
the kernel goes to sleep.

Change-Id: I4cac45a32d09d6ca1de052a368b3219f64889869
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-26 23:38:03 +00:00
Benjamin Walsh
1125c2b00e unified: correct comment about number of threads in phil demo
A bit of work has to be done by someone why wants to run the demo with a
different number of threads than the default.

Fixes ZEP-1077.

Change-Id: Ibb5cfed2bd9984bcf0f9d65f957f32daf4c5211e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-26 23:06:25 +00:00
Anas Nashif
c224491aec samples: sensors: remove reference to non-existing MDEF_FILE
Change-Id: Ideaa795e8afc8d3226adc340db7299eaa9bf6bcc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-25 23:16:32 +00:00
Ricardo Salveti
702cd6cb52 samples/soc_flash_nrf5: test non-word aligned writes
Change-Id: I0c109d1632a84ab2f239b7034f18556519aa158e
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-25 00:34:29 +00:00
Allan Stephens
0c31ed273e unified/test: Adapt C++ sample application
Microkernel and nanokernel tests now use customized source code
to eliminate use of MICROKERNEL and NANOKERNEL config options.

Change-Id: Ic3617df34487911af1607ab46f469c5e1212d3f7
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-25 00:10:36 +00:00
Anas Nashif
56629db9fa samples: ipsp: whitelist platforms
Change-Id: Ibc221d3e72481418f7bb0946a107aa0a8676cffb
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-22 16:55:53 -04:00
Anas Nashif
bf5fdfbe43 tests: fix testcases for cortex-m0+ platforms
Change-Id: Idf6f5e38354aa5f1801ec0c0db63a4e19243918c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-22 16:54:19 -04:00
Anas Nashif
bce6b337a5 Merge "Merge bluetooth branch into master" 2016-10-21 22:12:23 +00:00
Chuck Jordan
4c6feac28e samples: modify w25q80b1 sample to output "done" when done.
This sample justs outputs the SPI FLASH IDs.
I think we should improve this to also output done, otherwise
it looks like its stuck or something.

Change-Id: I18d5919c1e25bb5aaa9ceba53793cc14b15f3c77
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-10-21 19:55:20 +00:00
Carles Cufi
c74675c27a Bluetooth: HCI UART app to run Zephyr as a BLE Controller
Add a new sample application in sample/bluetooth/hci-uart
that acts as a bridge between a UART and the BLE Controller.
It receives commands and ACL data in H4 format over the UART
and passes them on to the BLE Controller to be processed.
It also conversely forwards all events and incoming ACL data
generated by the BLE Controller to the UART.
The application uses the hci_raw interface to pipe the data
to and from the BLE Controller and UART.

Change-Id: Iff7696166a82fe363b2ad4e1abea40103899f927
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-10-21 07:47:31 +03:00
Luiz Augusto von Dentz
ee9f5c1784 Bluetooth: GATT: Pass CCC attribute to changed callback
This way the application can reuse the same callback for multiple CCC
since it can track what CCC is affect by checking the attribute pointer.

Change-Id: I608da643aea07de26b65d67e6db3268d717d0f53
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-21 07:47:31 +03:00
Anas Nashif
71d6ad2619 sensors: bmi160: remove unused init priority config
Change-Id: I367d7b084fb93609000066b610e01a802fdd152e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-20 09:39:51 +00:00
Inaky Perez-Gonzalez
2b52b34eb7 samples/shell: don't run on QEMU, input not supported
This will be reverted once input is supported in QEMU.

Change-Id: I4bc946f1634bf9ebd17b697f0da7ce2f813e5725
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-10-19 17:57:15 +00:00
Inaky Perez-Gonzalez
6ef9c853d1 samples/drivers/spi_lsm9ds0: don't run on QEMUs or FRDMs
These platforms don't have the hardware and will always fail.

Change-Id: I637d39f003bd1d507da0b5bb6fa12118040fcd63
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-10-19 17:56:48 +00:00
Benjamin Walsh
fa078dea4b unified: fix philosophers demo when using stack objects
Got out of sync with the revised signature of k_stack_init().

Change-Id: Ib4c67c75f30055583a457bfb13f8dacc9929ee88
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-17 17:54:14 +00:00
Inaky Perez-Gonzalez
41a4caadfc samples/ipm: fix markup
Old markup was using %(target)s, which is not the right markup to use,
so it was faiing to build.

Change-Id: Idbe99cfdd695284dc2a66e5823bc65a1417fbfd3
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-10-17 17:24:09 +00:00
Vinicius Costa Gomes
fcf98d1534 samples/zoap_server: Add preliminary support for validation
Implement resources so they conform to what the ETSI plugtest suite
expects.

This allows the zoap-server sample to pass most of the tests of the
CORE[1] group, only TD_COAP_CORE_09 is not implemented.

Tests involving lossy networks weren't run as well.

The tests were run against the libcoap[2] client.

[1] ETSI CoAP test description
http://www.etsi.org/plugtests/CoAP/Document/CoAP_TestDescriptions_v015.pdf

[2] libcoap
https://libcoap.net/

Change-Id: Ifa3ed21a93052e02f47e99d7cb6d9d4b28e576d8
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-17 02:12:12 +00:00
Anas Nashif
a61a7faf53 samples: TH02 temperature and humidity sensor sample
This sample uses the grove temperature and humidity sensor and displays the
read values on the grove LCD.

Change-Id: Id6fb6171c26c97f1b01008fa06a4dc85287d7545
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-17 00:24:34 +00:00
Lee Jones
d14e4522eb samples: drivers: dma: Improve failure debug granularity
When the sample fails, it's difficult to identify whether it failed
during the configuration or transfer stage.  Provide a little more
information which will allude to the nature of the failure.

Change-Id: I5272ce73f56b0e51c8439d5510e512b616665705
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-10-17 00:22:59 +00:00
Luiz Augusto von Dentz
e6cb507a42 Bluetooth: IPSS: Remove ipss_listen
This removes ipss_listen since it does depend on the old network stack it
cause build problems with yaip and anyway its code is only used by ipsp
sample while the net samples does not use ipss_listen at all.

Change-Id: I23987670548741bde8800115d473a3bab242153b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-16 09:01:28 +03:00
Johan Hedberg
ba3ab4d2bc Bluetooth: samples: Rename btusb to hci-usb
This prepares the way for more controller-side HCI implementations
which can be named hci-<transport>.

Change-Id: I6f82db4b7b7096a122f32def9fe9025a7b811244
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-16 09:00:57 +03:00
Johan Hedberg
5338ad23b8 Bluetooth: samples/btusb: Rename main c-file
Use main.c as in most other samples.

Change-Id: I82a593d2842e0653279046be181e2770a367ab45
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-16 09:00:57 +03:00
Allan Stephens
399d0ad55a unified: Rationalize thread priority APIs
* Gets rid of k_current_priority_get(). Users can just call
  k_thread_priority_get(k_current_get()) instead.

* Declares k_thread_priority_get() in kernel.h, where it
  really belongs.

* Removes duplicate declaration of k_thread_priority_set().

Change-Id: I616ae6f2e06c95ecba3b92324186b3fa29162fd1
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-13 13:53:59 +00:00
Anas Nashif
84c9db39e7 gpio: reduce Kconfigs and use consistent name for GPIOs
Using AON for GPIO kconfigs is very specifc to quark se, there
is no need to make this special for this platform. Use the
existing scheme instead.

Change-Id: I946431490380dc0f537d6056277a94c9c9c80fed
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 16:15:07 +00:00
Anas Nashif
43f1c36ed5 samples: button: modify sample to work on more boards
Change-Id: Ib29dc5ce70618f6c4d0a4d732910ea67f92c37a5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 14:14:05 +00:00
Anas Nashif
f482200f9c samples: remove useless filters in testcase.ini
Change-Id: Iaf7f77a738a48918752347c97019660355de370a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 14:07:24 +00:00
Anas Nashif
1ccad63744 samples: remove useless printf/printk wrappers
Change-Id: I4518171c85914785df1fc02ac679279b49a1be31
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-05 23:01:22 +00:00
Ramesh Thomas
c4c0ed414b power_mgmt: Reduce complexity in handling of power hooks
Simplified some documentation, removing inconsistencies and making
it easier to understand by separating PM infrastructure areas and
soc specific components that implement the hooks.

Removed the DEVICE_SUSPEND_ONLY policy as it is redundant and
causes high complexity in the flow. It is also not practical
to use it because it was meant to be used without doing CPU or SOC
low power state operations. This means it would do device PM
operations in the ISR of the system timer used by the scheduler.
This can disrupt the scheduler time.

Added a check of a flag around the notification sent from the ISR
of the wake event and created APIs to set/clear it. This will
allow disabling the notification when not needed from
_sys_soc_suspend().

Jira: ZEP-972
Change-Id: Id7aa7d2683384eabed518d4efac446ecc84c3498
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-05 10:05:42 +00:00
Johan Hedberg
41d60dc3ed Merge bluetooth branch into master
Main changes:

 - Initial A2DP support
 - Initial SDP support
 - Controller code cleanups
 - Improved RFCOMM support
 - Minor fixes & cleanups here and there

----------------------------------------------------------------
Arkadiusz Lichwa (9):
      Bluetooth: RFCOMM: Shuffle up Kconfig's RFCOMM_L2CAP_MTU
      Bluetooth: HFP HF: Fix getting inaccessible internal
      Bluetooth: HFP HF: Enforce Kconfig's HFP_HF relation to RFCOMM
      Bluetooth: init: Add HFP to automated tests
      Bluetooth: A2DP: Remove internal stack headers
      Bluetooth: AVDTP: Remove internal headers
      Bluetooth: AVDTP: Fix getting inaccessible internal
      Bluetooth: L2CAP: Fix sending double connection request
      Bluetooth: Refactor distribution of security procedure status

Arun Jagadish (2):
      Bluetooth: AVDTP: Module Initialization
      Bluetooth: AVDTP: Connect and Disconnect API

Carles Cufi (6):
      Bluetooth: Controller: Clean up naming in the HCI driver
      Bluetooth: Controller: Use net_buf for HCI RX
      Bluetooth: Controller: Use net_buf for CC/CS TX
      Bluetooth: Controller: Use net_buf for evt and ACL RX
      Bluetooth: Controller: Remove unused macro
      Bluetooth: Controller: Fix __packed placement

Itankar, Piyush T (2):
      Bluetooth: A2DP: Initialization of A2DP
      Bluetooth: A2DP: Added Connect API

Jaganath Kanakkassery (5):
      Bluetooth: RFCOMM: Handle dlc disconnection from peer
      Bluetooth: RFCOMM: Handle session disconnection from peer
      Bluetooth: RFCOMM: Introduce rfcomm_send_dm()
      Bluetooth: RFCOMM: Introduce dlc destroy
      Bluetooth: RFCOMM: Replace tabs with spaces

Johan Hedberg (6):
      Bluetooth: L2CAP: Extend bt_l2cap_create_pdu() with 'reserve' parameter
      Bluetooth: tests: Fix name of Quark SE C1000 SS devboard
      Bluetooth: RFCOMM: Remove reference counting
      Bluetooth: RFCOMM: Fix some remaining white-space issues
      Bluetooth: Adjust maximum connections & paired devices range
      Bluetooth: Fix compiler warnings/errors related to string casts

Kaustav Dey Biswas (1):
      Bluetooth: SDP: Server: Initialize and accept incoming connections

Luiz Augusto von Dentz (7):
      Bluetooth: eddystone: Add missing characteristics
      Bluetooth: init: Add CONFIG_BLUETOOTH_RFCOMM to prj_20.conf
      Bluetooth: init: Add CONFIG_BLUETOOTH_AVDTP to prj_20.conf
      Bluetooth: AVDTP: Add missing BLUETOOTH_DEBUG_AVDTP
      Bluetooth: init: Add CONFIG_BLUETOOTH_A2DP to prj_20.conf
      Bluetooth: GATT: Fix locking RX fiber
      Bluetooth: Enable CONFIG_BLUETOOTH_DEBUG_AVDTP with prj_20.conf

Mariusz Skamra (2):
      Bluetooth: tester: Fix advertising data
      Bluetooth: Enable privacy for nimble

Szymon Janc (5):
      Bluetooth: SMP: Remove unused static const
      Bluetooth: SMP: Fix unused static variable
      Bluetooth: Add debug keys support to HCI ECC emulation code
      Bluetooth: L2CAP: Cleanup flags names for BR/EDR channels
      Bluetooth: L2CAP: Rename br_channels to br_fixed_channels

Vinayak Chettimada (2):
      Bluetooth: Controller: Fix SCHED_ADVANCED cond, compilation
      Bluetooth: Controller: Remove custom irq implementation

 drivers/bluetooth/controller/Makefile             |   1 -
 drivers/bluetooth/controller/hal/ccm.h            |   4 +-
 drivers/bluetooth/controller/hal/clock.c          |  18 +-
 drivers/bluetooth/controller/hal/ecb.c            |  17 +-
 drivers/bluetooth/controller/hal/irq.c            |  53 --
 drivers/bluetooth/controller/hal/radio.c          |  14 +-
 drivers/bluetooth/controller/hal/rand.c           |   7 +-
 drivers/bluetooth/controller/hci/hci.c            | 903 ++++++++-----------
 drivers/bluetooth/controller/hci/hci_driver.c     | 290 +++---
 drivers/bluetooth/controller/hci/hci_internal.h   |   9 +-
 drivers/bluetooth/controller/ll/ctrl.c            |  32 +-
 drivers/bluetooth/controller/ll/ctrl.h            |   8 +-
 drivers/bluetooth/controller/ll/pdu.h             | 110 +--
 drivers/bluetooth/controller/util/work.c          |  69 +-
 drivers/bluetooth/controller/util/work.h          |   2 +-
 include/bluetooth/a2dp.h                          |  47 +
 include/bluetooth/bluetooth.h                     |   2 +-
 include/bluetooth/l2cap.h                         |  15 +-
 include/bluetooth/rfcomm.h                        |  29 +-
 .../hal/hal_irq.h => include/bluetooth/sdp.h      |  35 +-
 net/bluetooth/Kconfig                             |  58 +-
 net/bluetooth/Makefile                            |   6 +-
 net/bluetooth/a2dp.c                              | 126 +++
 net/bluetooth/a2dp_internal.h                     |  36 +
 net/bluetooth/att.c                               |  40 +-
 net/bluetooth/avdtp.c                             | 180 ++++
 net/bluetooth/avdtp_internal.h                    | 158 ++++
 net/bluetooth/conn.c                              |   2 +-
 net/bluetooth/hci_core.c                          |  25 +-
 net/bluetooth/hci_ecc.c                           |  71 +-
 net/bluetooth/hfp_hf.c                            |   2 +-
 net/bluetooth/l2cap.c                             |  28 +-
 net/bluetooth/l2cap_br.c                          | 115 +--
 net/bluetooth/l2cap_internal.h                    |  16 +-
 net/bluetooth/rfcomm.c                            | 173 +++-
 net/bluetooth/rfcomm_internal.h                   |  82 +-
 net/bluetooth/sdp.c                               | 294 ++++++
 net/bluetooth/sdp_internal.h                      |  56 ++
 net/bluetooth/smp.c                               |  21 +-
 net/bluetooth/smp_null.c                          |   2 +-
 samples/bluetooth/eddystone/src/main.c            |  79 ++
 tests/bluetooth/init/prj_20.conf                  |   6 +
 tests/bluetooth/init/testcase.ini                 |   2 +-
 tests/bluetooth/tester/prj_nimble.conf            |   1 +
 tests/bluetooth/tester/src/gap.c                  |   2 +-
 45 files changed, 2116 insertions(+), 1130 deletions(-)
 delete mode 100644 drivers/bluetooth/controller/hal/irq.c
 create mode 100644 include/bluetooth/a2dp.h
 rename drivers/bluetooth/controller/hal/hal_irq.h => include/bluetooth/sdp.h (59%)
 create mode 100644 net/bluetooth/a2dp.c
 create mode 100644 net/bluetooth/a2dp_internal.h
 create mode 100644 net/bluetooth/avdtp.c
 create mode 100644 net/bluetooth/avdtp_internal.h
 create mode 100644 net/bluetooth/sdp.c
 create mode 100644 net/bluetooth/sdp_internal.h

Change-Id: I22864805bbb931fe9150ccd84d389b3e30794f7e
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-10-04 18:48:00 +03:00
Vinicius Costa Gomes
da41fc87ed samples/zoap_server: Fix warning about pointer signedness
Change-Id: I78b2762d0713aa42d9800cb7736f4831195a6d3c
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-04 12:29:07 +00:00
Ramesh Thomas
cda7bf3b2a samples: power_mgmt: Fix compile bugs flagged by llvm
Change-Id: Id062f1d6f1eef6b98d040dcd16eb34fa4bd8bb30
Signed-off-by: Ramesh Thomas <ramesh.thomas@intel.com>
2016-10-04 12:27:56 +00:00
Luiz Augusto von Dentz
c4fb8f8820 Bluetooth: eddystone: Add missing characteristics
This adds last 2 missing characteristics:

(Advanced) Factory reset - a3c8750b-8ed3-4bdf-8a39-a01bebede295
(Advanced) Remain Connectable - a3c8750c-8ed3-4bdf-8a39-a01bebede295

Change-Id: I749b4be65469080a24957805d40395563a74a972
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-10-04 08:12:14 +03:00
Vinicius Costa Gomes
0dfc9db815 samples/zoap-client: Add a README.txt to zoap-client
Change-Id: I2373d87cda125036cce169aaa492aeedcbe200dd
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:27 +00:00
Vinicius Costa Gomes
fcb3297b32 samples/zoap-server: Add a README.txt to zoap-server
Change-Id: I136d405e520ed8550e0b5012128a0c673bb9954a
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:27 +00:00
Vinicius Costa Gomes
76e81874f0 samples/zoap_client: Make it work with zoap-server
The path and port used by zoap-client were different than the ones used
by zoap-server.

Even if they are different applications, for consistency, it makes sense
for them both to be able to talk to each other.

Change-Id: I883d59c77bc3800b4f0965ba7bcf96a08e545d29
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:26 +00:00
Vinicius Costa Gomes
441d22a371 iot/zoap: Add port information to network addresses
uIP keeps the port separated from the IP addresses, so if the
application wants to communicate with a remote endpoint we must also
have the port information available.

Change-Id: I8e2b01fe5717166e1f9cebcc74b2056325b8ccc3
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-10-01 01:11:25 +00:00
Jaakko Hannikainen
891c369807 ztest: Add documentation
Origin: Original

Change-Id: I0927c25fbbba5d4863f199d058d311c10d52d784
Signed-off-by: Jaakko Hannikainen <jaakko.hannikainen@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-30 21:17:40 +00:00
Benjamin Walsh
aabf74cda5 Dining philosophers demo for unified kernel.
The demo can be configured to use different object types for its
synchronization: SEMAPHORES, MUTEXES, STACKS, FIFOS and LIFOS. To
configure a specific object, set the value of FORKS to one of these.

By default, the demo uses MUTEXES.

The demo can also be configured to work with static objects or dynamic
objects. The behaviour will change depending if STATIC_OBJS is set to 0
or 1.

By default, the demo uses dynamic objects.

The demo can be configured to work with threads of the same priority or
not. If using different priorities, two threads will be cooperative
threads, and the other four will be preemtible threads; if using one
priority, there will be six preemtible threads of priority 0. This is
changed via SAME_PRIO.

By default, the demo uses different priorities.

The number of threads is set via NUM_PHIL. The demo has only been tested
with six threads. In theory it should work with less than six threads,
but not with more without making changes to the forks[] array in the
phil_obj_abstract.h header file.

Change-Id: If7a0a34b216929a661245fd921a32ec413df8a4a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-28 14:14:02 +00:00
Anas Nashif
6ab9701330 samples: remove unused MDEF file
This is a nanokernel sample and the MDEF file is not being used at
all.

Change-Id: I344adfa9394329258144de88521764974238f6a3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-24 08:26:57 -04:00
Anas Nashif
179ce1c891 boards: remove obsolete board basic_minuteia
This board is not being used or tested and does not actually
run on any hardware, remove it in favor of well supported boards
for this CPU.

Jira: ZEP-850
Change-Id: I01c825c7eb44d6c321f2ffb88e8899da528921dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-22 22:09:34 +00:00
Anas Nashif
572f4a1a14 boards: remove obsolete board basic_cortex_m3
This board is not being used or tested and does not actually
run on any hardware, remove it in favor of well supported boards
for this CPU.

Jira: ZEP-850
Change-Id: Ied681b6059ad74f9d019054292c919a9f938e7d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-22 22:09:33 +00:00
amirkapl
c490219d1e power_mgmt: Update sample and drivers according to new pm device API
Update the power sample and drivers with the new device driver power
management API using the existing logic

Jira: ZEP-954
Change-Id: Idd94232e458767635973e94e9fc673c01612c1e2
Signed-off-by: Amir Kaplan <amir.kaplan@intel.com>
2016-09-22 00:23:43 +00:00
Johan Hedberg
5cc5141371 Merge bluetooth branch into master
Main changes:

 - Cleanups & refactoring to the native controller code
 - Support for cross-transport pairing from BR/EDR to LE
 - Fix potential deadlock in TX fiber when disconnecting
 - Initial skeleton for the Hands-Free Profile (HFP)
 - Fix to Resolvable Private Address (RPA) updates
 - Added flow control support to RFCOMM

----------------------------------------------------------------
Carles Cufi (21):
      Bluetooth: HCI: Fix the length of supported commands
      Bluetooth: Controller: Switch to Zephyr's hci.h for cmd handling
      Bluetooth: HCI: Add handle to LTK command complete events
      Bluetooth: HCI: Add handle to conn param update command complete
      Bluetooth: Controller: Switch to Zephyr's hci.h for cmd handling
      Bluetooth: Controller: Switch to Zephyr's hci.h for cmd handling
      Bluetooth: Controller: Switch to Zephyr's hci.h for cmd handling
      Bluetooth: Controller: Switch to Zephyr's hci.h for cmd handling
      Bluetooth: Controller: Unify handling of async events
      Bluetooth: HCI: Fix and extend advertising report events
      Bluetooth: HCI: Add auth payload expiry event
      Bluetooth: Controller: Use hci.h for control event handling
      Bluetooth: HCI: Add read remote version info event
      Bluetooth: Controller: Use hci.h for data-control evt handling
      Bluetooth: Controller: Use hci.h for num complete
      Bluetooth: Controller: Remove HCI event definitions from hci.c
      Bluetooth: Controller: Use hci.h for ACL data
      Bluetooth: Controller: Clean up HCI macros
      Bluetooth: Controller: Implement LE_RAND command
      Bluetooth: Controller: Make HCI endianness-independent
      Bluetooth: Controller: Refactor HCI files

Grzegorz Kolodziejczyk (3):
      Bluetooth: tester: Add support for L2CAP connect command
      Bluetooth: tester: Add support for L2CAP disconnect commands
      Bluetooth: tester: Add support for L2CAP listen command

Itankar, Piyush T (1):
      Bluetooth: Init: Updated filiter options for test_20

Jaganath Kanakkassery (1):
      Bluetooth: RFCOMM: Implement RX flow control

Johan Hedberg (2):
      Bluetooth: GATT: Fix potential bt_conn reference leak
      Bluetooth: Fix giving back pkts semaphore when disconnecting

Luiz Augusto von Dentz (3):
      Bluetooth: ATT: Fix not handling error response properly
      Bluetooth: HCI: Fix updating RPA too early
      Bluetooth: eddystone: Fix byteorder of advertisement

Mariusz Skamra (1):
      Bluetooth: tester: Add support for L2CAP send data command

Sathish Narasimman (1):
      Bluetooth: HFP HF: Initialize Handsfree profile

Sukumar Ghorai (1):
      Bluetooth: Pre-allocated RFCOMM Channels

Szymon Janc (16):
      Bluetooth: SMP: Move smp_create_pdu function up in a file
      Bluetooth: SMP: Add initial code for BR/EDR support
      Bluetooth: SMP: Clear keys on timeout when running over BR/EDR
      Bluetooth: SMP: Support Pairing Request over BR/EDR
      Bluetooth: SMP: Support Pairing Failed over BR/EDR
      Bluetooth: SMP: Distribute local keys over BR/EDR
      Bluetooth: Add support for reading encryption key size for BR/EDR
      Bluetooth: SMP: Fix encryption key size check in BR/EDR pairing req
      Bluetooth: SMP: Support Pairing Response over BR/EDR
      Bluetooth: SMP: Allow to force BR/EDR without SC support
      Bluetooth: SMP: Add support for LTK derivation from LinkKey
      Bluetooth: SMP: Add support for sending Pairing Request over BR/EDR
      Bluetooth: SMP: Add support for Identity Information over BR/EDR
      Bluetooth: SMP: Add support for Signing Information over BR/EDR
      Bluetooth: SMP: Add helper for reporting BR/EDR pairing complete
      Bluetooth: SMP: Factor out BR/EDR encryption check to helper

Vinayak Chettimada (4):
      Bluetooth: ATT: Remove unnecessary call to BT_ASSERT
      Bluetooth: log: Call _SysFatalErrorHandler in BT_ASSERT()
      Bluetooth: log: Include nanokernel.h to use BT_ASSERT()
      Bluetooth: Controller: Use BT_ASSERT instead of custom impl.

 drivers/bluetooth/controller/Makefile             |    2 +-
 drivers/bluetooth/controller/hal/clock.c          |    8 +-
 drivers/bluetooth/controller/hal/debug.h          |   27 +-
 drivers/bluetooth/controller/hal/ecb.c            |    2 +-
 drivers/bluetooth/controller/hal/radio.c          |    2 +-
 drivers/bluetooth/controller/hal/rand.c           |    2 +-
 drivers/bluetooth/controller/hal/rtc.c            |    2 +-
 drivers/bluetooth/controller/hci/hci.c            | 2380 +++++++-----------
 .../controller/{main.c => hci/hci_driver.c}       |   23 +-
 .../controller/hci/{hci.h => hci_internal.h}      |   14 +-
 drivers/bluetooth/controller/ll/ctrl.c            |  332 +--
 drivers/bluetooth/controller/ll/ticker.c          |    3 +-
 include/bluetooth/hci.h                           |   56 +-
 include/bluetooth/hfp_hf.h                        |   61 +
 include/bluetooth/log.h                           |   17 +-
 include/bluetooth/rfcomm.h                        |    8 +
 net/bluetooth/Kconfig                             |   23 +
 net/bluetooth/Makefile                            |    2 +
 net/bluetooth/att.c                               |    4 +-
 net/bluetooth/conn.c                              |   45 +-
 net/bluetooth/gatt.c                              |    7 +-
 net/bluetooth/hci_core.c                          |   18 +-
 net/bluetooth/hci_core.h                          |    4 +-
 net/bluetooth/hfp_hf.c                            |  123 +
 net/bluetooth/hfp_internal.h                      |   43 +
 net/bluetooth/l2cap_br.c                          |   15 +
 net/bluetooth/l2cap_internal.h                    |    1 +
 net/bluetooth/rfcomm.c                            |   49 +-
 net/bluetooth/smp.c                               |  953 ++++++-
 samples/bluetooth/eddystone/src/main.c            |    4 +-
 tests/bluetooth/init/testcase.ini                 |    7 +-
 tests/bluetooth/tester/src/bttester.h             |   71 +
 tests/bluetooth/tester/src/l2cap.c                |  306 +++
 33 files changed, 2785 insertions(+), 1829 deletions(-)
 rename drivers/bluetooth/controller/{main.c => hci/hci_driver.c} (94%)
 rename drivers/bluetooth/controller/hci/{hci.h => hci_internal.h} (68%)
 create mode 100644 include/bluetooth/hfp_hf.h
 create mode 100644 net/bluetooth/hfp_hf.c
 create mode 100644 net/bluetooth/hfp_internal.h

Change-Id: I7bc41fb1c53c0f5128a1e4ab38815d19018b603f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-09-16 13:28:24 +03:00
Luiz Augusto von Dentz
88d5175ac4 Bluetooth: eddystone: Fix byteorder of advertisement
This fixes the UUID 128 bits to use the right byte order so it can be
decoded properly:

< HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32
        Length: 21
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        128-bit Service UUIDs (complete): 1 entry
          Eddystone Configuration Service (a3c87500-8ed3-4bdf-8a39-a01bebede295)

Change-Id: Ia4aacaf3557d74a248f63cbffb2adb73b076d38c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-09-16 10:53:51 +03:00
Anas Nashif
5363d14a9e boards: rename Quark SE Devboard to Quark SE C1000
This board now has an official name and will be available soon:

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/se-soc/overview.html

Jira: ZEP-758
Change-Id: Ia16d33722308cf81471321c3063bdc75055a4d50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:31 +00:00
Anas Nashif
5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Javier B Perez
5879f1702c samples: zoap server: exclude quark d2000 not enough ram
Excluded Quark D2000 because there is not enough RAM to
build the sample.

Change-Id: Icc772e0aaca2be8731eae8f986eed17782beb445
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-09-14 21:23:25 +00:00
Anas Nashif
4589f2c468 samples: use printf/printk directly instead of macros
In many cases there is no need to define a macro for printing to
the console, just use the correct variant directly.

Jira: ZEP-240
Change-Id: I9952deda4bfc60424f01fca2443d037562d13d0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-14 16:56:02 +00:00
Anas Nashif
01a3e442e8 tests: move test code from samples to tests
Jira: ZEP-760
Change-Id: I3afa847864f9a593696ee832f291f438fd291f8e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-14 15:34:17 +00:00
Inaky Perez-Gonzalez
1b9d13c408 samples/task_profile: fix testcase.ini's long lines
.ini format supports long lines by prefixing the continuation with an
empty line. Adding a backslash makes the backslash part of the value.

Change-Id: I0a1ade3a6bdf12281e61d06e21d7233d4b624b48
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-09-14 12:20:13 +00:00
Benjamin Walsh
c72acc9333 zperf_shell: add unified kernel string for unified kernel case
Change-Id: I61053d6aff6381eb32626b457da6ef5170ffc503
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-13 17:12:55 -04:00
Juan Manuel Cruz
31341b3255 task profiler: Adds the task profiler samples to the sanity check
Boards that cannot support microkernel applications for memory resources
are excluded from microkernel build test.

qemu nios2 board is excluded from nanokernel because the Altera JTAG
UART not implemented yet

The kernel even logger buffer size for nanokernel was reduced from 1000
elements to 500 to allow the sample to fit in the Quark D2000 board.

Jira: ZEP-698

Change-Id: I0c5cc4c0bfc27940a758dcdd8ff0e01ad7f4b88c
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-13 17:26:34 +00:00
Juan Manuel Cruz
809e52607b task profiler: README file update
Jira: ZEP-698

Change-Id: I790913b4a1a9fadc58b3325b034f039bfcd14ecd
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-13 17:26:33 +00:00
Juan Manuel Cruz
b9c6afca43 task profiler: project configuration files clean up
The sample applications for task profiling requires a default
project configuration file that can be used as reference for
any other board.

Quark SE dev board has some optional optimizations that can
be added using the prj_quark_se_devboard.conf file.

Some redundant symbols were removed to simplify the reading
of the configuration.

Jira: ZEP-698

Change-Id: I71d584d4454392e740f8b7a2c2f47206b76c3abf
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-09-13 17:26:33 +00:00
Anas Nashif
884d9fb50f samples: zoap: build only for specified boards
Change-Id: I52e5dd0d638eb4582baf9bc7c8ce4d30b4d49733
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-12 19:53:15 -04:00
Andrew Boie
9436765914 samples: dma: don't skip this test case
There is no reason to skip it.

Change-Id: I45a9aa3f05263c6deb017c1513cafb9af055037a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-12 17:53:22 +00:00
Anas Nashif
c7faacf3d6 samples: move pci tests to tests/
Change-Id: Ibeb50b25b2f897dc1be87aa0739ef3f31d9015e8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-12 12:26:06 +00:00
Anas Nashif
1ecbea283c samples: move spi tests to tests/
Change-Id: I8d4a50bcbf479c35ccb209fbb04b5b1095075933
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-12 12:26:06 +00:00
Vinicius Costa Gomes
8dad0093d3 samples/net: Add a sample for a CoAP client
Change-Id: I17d88081eb719e55d97a5a034f6861e01ebb6a52
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-09-12 12:25:25 +00:00
Vinicius Costa Gomes
97ea9b19ea samples/net: Add a sample for a CoAP server
Change-Id: Ibca646d9c9f85a14939e1cf488eee7a41f688fd2
Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
2016-09-12 12:25:25 +00:00
Yong Li
ee85618d74 samples: shell: add support for nano/micro kernel
This patch adds the micro support for the shell application

Change-Id: I4499a8660323f1fa61ff3bbf6e7a3026a7dba77a
Signed-off-by: Yong Li <sdliyong@gmail.com>
2016-09-12 02:29:01 +00:00
Flavio Santes
13a75b7e42 dns: Remove deprecated functionality
This commit removes deprecated APIs and replaces them with routines
that provide similar functionality without the flexibility originally
offered by the deprecated APIs.

Removing deprecated routines will help us to be prepared once the
new IP stack is ready (ZEP-793). Furthermore, this commit will also
help us to move our current DNS Client implementation to the lib/iot
directory, as specified by ZEP-847.

This commit removes the netz library from the DNS client sample
application. UDP functionality is replaced by primitive routines.
Specifically, the following changes are applied by this patch:

- Remove netz routines
- Remove app_buf data structure
- Introduce primitive data types in the DNS client code
- Introduce primitive network routines
- Add a header file containing configurable parameters

Jira: ZEP-793
Jira: ZEP-847

Change-Id: I0302133da77308f0cdd9ace2c0265e6b77673ff0
Signed-off-by: Flavio Santes <flavio.santes@intel.com>
2016-09-12 02:15:44 +00:00
Jukka Rissanen
4a088a1259 net: apps: Example app for Trickle algorithm
This is only meant for Contiki based IP stack.

Change-Id: I53cbcb7da0bd13ad87243fd70974cec0bd31072e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-09-12 02:00:12 +00:00
Andrei Emeltchenko
84b46cd862 usb: Add USB sample build test to sanity check
Adding these tests allows to find issue with QMSI update.

Change-Id: Ib247bee6a5dbdd60aed759b4908e9ae7751d5f78
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-09-12 00:42:17 +00:00
Anas Nashif
e38abba451 tests: change tags for sensors
Change tags to reflect the type of samples, in this case it is all
about sensors.

Change-Id: I9f87e8683dd52fd757cd07ba5aa9fad99d17ab38
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-11 19:10:40 +00:00
Baohong Liu
56011cee50 samples: remove stts 751 sensor app
Remove this app, since the sensor is not on the
board any more.

Jira: ZEP-763

Change-Id: I931acfe9f01b817bc0b24a4e0745bf759e53da90
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-09-10 11:29:05 +00:00
Andy Ross
fb1daa0f97 samples/uart: Use the proper console
Don't try to detect the UART device manually, the list is missing a
bunch of boards (the Quark SE sensor subsystem variant, and both
Arduino 101 halves).  There's a config variable for that.

Change-Id: I903e52dcb6025e5da824faadb5e4bc59221fa210
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-09-09 21:37:56 +00:00
Andy Ross
ee56af2a29 samples/drivers/uart: Fix line endings
This output is going to a terminal device, not a Unix tty descriptor
which will cook the output for us.  Newline moves the cursor down.
Carriage return moves it to the start of a line.  We need both.

Change-Id: If93d1a85d16cea93b4788fa55e694a7b77055bfe
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-09-09 21:37:55 +00:00
Anas Nashif
ce52e3988f Merge "Merge bluetooth branch to master" 2016-09-08 02:26:59 +00:00
Anas Nashif
af1eaf489d samples: adc: make project configuration arch agnostic and cleanup
- Set default board to Quark SE Debvboard

Jira: ZEP-690, ZEP-760, ZEP-782
Change-Id: I7f7cc45b527a116f88cf45796e46b429ae6f0060
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-07 22:09:59 -04:00
Luiz Augusto von Dentz
bafbe76dc3 Bluetooth: HoG: Require authentication for connections
HID over GATT Profile Specification states:

  'The HID Device shall use LE Security Mode 1 and either Security Level
   2 or 3.'

Change-Id: I2cfc1d9df76b4e8a8b2be7e87d18a7a5f3a19ea8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-09-07 08:17:26 +03:00
Luiz Augusto von Dentz
f509d68cf1 Bluetooth: Add sample implementing HIDS
This adds a sample that implements HID Service peripheral, the current
descriptor map is for a generic mouse so when connecting to a Linux box
it will create a input device like in the following output:

input: Test HoG mouse as /devices/virtual/misc/uhid/0005:1D6B:0246.0035/input/input98
hid-generic 0005:1D6B:0246.0035: input,hidraw2: BLUETOOTH HID v5.29 Mouse [Test HoG mouse] on XX:XX:XX:XX:XX:XX

Change-Id: Iccf07926ecc7363f4f47e1aa9df506a722e7e2d3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-09-07 08:17:26 +03:00
Luiz Augusto von Dentz
30665185f8 Bluetooth: Add service sample for HoG
This adds a HoG service sample which can be shared with application
samples.

Change-Id: I6893ff409b254d0a616b2ba558fd629ce9edf1d4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-09-07 08:17:26 +03:00
Andrei Emeltchenko
9dc90369d5 Bluetooth/samples: Fix missing argument in printf for btusb
Change-Id: I130362a9a3a7f58036b09821bf897295dcca7fdf
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-09-07 08:17:26 +03:00
Andrei Emeltchenko
210596e246 Bluetooth: Include btusb sample to sanity check
Change-Id: I05aeb54124b7dbf36aa730e04a105683eb8c4eaa
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-09-07 08:17:26 +03:00
Andrei Emeltchenko
e8abb72a6a Bluetooth: Export USB HCI controller using RAW HCI channel
The application exports Bluetooth controller over USB as USB HCI
dongle using RAW HCI channel introduced in the previous patch.

When connected to Linux is should be handled by btusb driver.

usb-devices output:

T:  Bus=05 Lev=03 Prnt=121 Port=00 Cnt=01 Dev#= 22 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8086 ProdID=ff02 Rev=01.00
S:  Manufacturer=Intel
S:  Product=BTUSB12
S:  SerialNumber=00.01
C:  #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb

Change-Id: I8bc362876353b6c97eb7051f4cdff3d8a9f55abd
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-09-07 08:17:26 +03:00
Luiz Augusto von Dentz
e2b5be9087 Bluetooth: eddystone: Add timeout to deactivate configuration mode
This adds a timeout to switch from configuration mode to beacon mode
following the recommended behavior from the spec:

  The connectable timeout should be at the very least 30 seconds to let
  enough time to user to start a configuration application.

Change-Id: I8f262c447ed1622e377fd7a05dde78c7b6b0560d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-09-07 08:17:26 +03:00
Andrew Boie
c545e19a00 x86: remove dynamic interrupts and exceptions
Change-Id: I7e9756e9a0735a7d8257ee2142d5759e883e12cc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-06 18:35:24 +00:00
Anas Nashif
62289e6de7 quark_se: disable IPM and enable UART0 on the sensor subsystem
Treat the sensor subsystem as an independent board that can send
messages to UART and disable IPM and the messaging interface. IPM
can be enabled by applications that require such interface.

Fix all samples that are affected by this change to make sanitycheck
pass.

Jira: ZEP-451
Change-Id: I3df6af16adefaefec02b97778d6c68ffc920ac35
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-08-31 16:31:04 +00:00
Javier B Perez
231629bfc7 testcases: filter cpp tests cases when using ISSM toolchain
Removed tests that will fail when using ISSM toolchain because
there is no g++ inside.

Example:
export ZEPHYR_GCC_VARIANT=issm
export ISSM_INSTALLATION_PATH=<ISSM PATH>
sanitycheck -p arduino_101 -p arduino_101_sss -p quark_d2000_crb \
   -p quark_se_devboard -p quark_se_sss_devboard

Change-Id: I532d4f0e0095472cbf3428cb8355167a320a10a0
Signed-off-by: Javier B Perez <javier.b.perez.hernandez@intel.com>
2016-08-29 14:43:19 +00:00