Commit graph

41120 commits

Author SHA1 Message Date
Allan Stephens
073442ecc5 kernel: Treat aborting by main() as a fatal system error
An application-supplied main() routine is now considered to be
essential to system operation. Thus, if main() experiences an
error that aborts the main thread a fatal system error is raised.

Note: If main() completes its work and does a standard return-
to-caller the main thread terminates normally.

Change-Id: Icc9499f13578299244a856a246ad2a7d34a72f54
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-10 18:51:42 +00:00
Allan Stephens
40325d2d28 kernel: Fix bug in spawning of legacy tasks using floating point
A thread defined via a legacy MDEF that belongs to the FPU or
SSE task group must set the thread option bits for FP or SSE
register use prior to being spawned.

If this is not done, and the kernel is configured for SSE support,
the kernel will auto-enable the thread's use of floating point
so that the thread saves SSE register context info even if it
belongs to just the FPU task group, which could cause the thread
to overflow its stack.

Note that this change only increases footprint for x86-based
applications that enable floating point register sharing.

Change-Id: Idfe4d20bcd7bc42b4cee6ac40ad7987e2a45ccf6
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-10 18:51:41 +00:00
Allan Stephens
361c296b30 doc: Remove reference to k_alert_handler_set()
This routine is non-existent. (Fix for ZEP-1240)

Change-Id: I85a538037aac000207f5f01414fb53810691d349
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-10 18:44:16 +00:00
Allan Stephens
0a5330748f doc: Update Interrupts section of Kernel Primer (v2)
Change-Id: I6495e7578a2ce6bda23b53567f14a0d544bb1704
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-10 18:44:16 +00:00
Anas Nashif
49598db96d Revert "checkpatch: update with latest checkpatch from the linux kernel"
This reverts commit 0c9152d42d.

This was not ready for merge yet.

Change-Id: I08f69e27929867606bc58cdeffed6540725069a1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-10 12:48:33 -05:00
Anas Nashif
a3618e753d docs: remove usage of ARCH=arm
Change-Id: Ib97f325e7d4b6ef97c2d1c9c8bb9b1312d153e22
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-10 17:24:45 +00:00
Anas Nashif
0c9152d42d checkpatch: update with latest checkpatch from the linux kernel
Update with commit 577f12c07e4edd54730dc559a9c7bc44d22bf7dc from the Linux
kernel.

Change-Id: I6314dd41eb200c87cdcc6f212f13d3351128de0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-10 17:24:44 +00:00
Kumar Gala
126fa0073b sanitycheck: Add bbc_microbit to list for platforms
Change-Id: I2afd9f04e1a88b0b7c0ec600cffea18c1b86a3e8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2016-11-10 16:58:26 +00:00
Erwan Gouriou
a26dd646e7 MAINTAINERS: Add entry for STM32Cube SDK
Change-Id: Ie2b6019ab22105c070b5b2c225eb3c3315397e55
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2016-11-10 16:54:24 +00:00
Adam Podogrocki
a1aba18227 ext/hal: Introduce STM32Cube SDK for STM32F3xx family
With this commit we provide header and HAL/LL files for all STM32F3
SoCs (V1.6.0).
Using STM32Cube provides generic access to all families, maximizes
code reuse across different STM32 families and helps taking benefit
of a mature SDK.

Origin: STM32Cube
URL: http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef3.html
Purpose: Introduction of STM32F3xx STM32Cube definitions
	 and Abstraction Layers
Maintained-by: External

Original STM32Cube tree structure has been modified to a minimum
structure for a better fit into Zephyr. hal is split into 2 parts:
-driver: initially Drivers/STM32F3xx_HAL_Driver, contains HAL and LL
-soc: initially Drivers/CMSIS/Device/ST/STM32F3xx, contains stm32f3xx
socs header files

Change-Id: I542bec71130bcfc7b720c546b5671e4af4baf2e3
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2016-11-10 16:23:00 +00:00
Baohong Liu
14d079a13c drivers: pwm: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I76eeab4dbb4259aa1147f524645c4ca8a8a48398
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 05:12:38 +00:00
Baohong Liu
3c01b5db57 drivers: wdt: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I1e051271212290a90a5659190bf031e9961e1917
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 05:12:19 +00:00
Baohong Liu
1a7f755785 drivers: dma: update to unified kernel
Change the included kernel header file from nanokernel.h
to kernel.h

Change-Id: I76cc952316430d618ea3ecb526d9bc2a99f04cef
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-09 18:38:57 -08:00
Baohong Liu
82193c59e3 drivers: i2c: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I17cde2f2cf457ac60905824ae581ede495f02709
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 02:00:07 +00:00
Baohong Liu
8cc98d71cd drivers: flash: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I430a239afdb49bfbbd7829442bbdd17c7d736663
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 01:59:24 +00:00
Baohong Liu
180887a305 drivers: gpio: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: Ic638f28555cb9c8a23b365e39368062c37d7716f
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-10 01:38:53 +00:00
Inaky Perez-Gonzalez
5b7bfdaf48 tests/drivers/aon_counter: make a ztest testcase
Reorganize the code tree so no forward declarations are needed
(basically, move main() to the bottom).

Retag as not build only so it can be run on Quark*

Convert to actually verify counter readouts are increasing /
decreasing over busy empty loops and the alarm is being called.

Change-Id: I746efe595b8d1ac4471dccc2e87f8b36f5cc8ebe
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-10 01:08:14 +00:00
Inaky Perez-Gonzalez
f37065bf84 ztest: add assert_not_equal()
Assertion for complementing assert_equal()

Change-Id: Ie3066f3b00ea3145a62ffb7e0d6c2c4de1719b4c
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-11-10 01:08:14 +00:00
Andrew Boie
90e6e9b7f6 dma.h: add missing includes
The header uses struct device * plus stdint types.

Change-Id: Id4b817682afa4cc229f98a289adf6646d26d18bc
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-10 01:04:27 +00:00
Allan Stephens
a543d956ba kernel: Remove traces of semaphore groups from public APIs
Change-Id: I68fa6d4c835e1df4b613bf4059fa8d28801b4ebf
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-10 00:28:03 +00:00
Allan Stephens
5a7a86cb7f unified/doc: Revise doxygen for kernel APIs
Does a general cleanup including:

* adding descriptions for APIs that are missing them
* adding information that would be helpful to users
  and removing information that wouldn't be helpful
* correcting errors
* aligning the terminology with the terminology used
  in the Kernel Primer document
* standardizing the way information is presented

Change-Id: I536644a7dc60b62100e379a199a645344430beb7
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-10 00:28:02 +00:00
Allan Stephens
bce8fbb61e kernel: Clean up of x86 floating point code
Updates x86 floating point support to reflect changes that have
been made in recent months.

* Many, many, many cosmetic changes (mostly revisions to comments).

* Elimination of unnecessary function aliases that were needed
  to support the task and fiber versions of certain APIs.

* Elimination of run-time code to enable a thread's "FP regs"
  option bit if the "SSE regs" option bit was set. The kernel
  now recognizes that the thread is using the FPU as long as
  either option bit is set. (If the thread has both option bits
  enabled this is the same as if only the "SSE regs" bit is set.)

Change-Id: Ic12abc54b6fa78921749b546d8debf23e7ad232d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-11-09 23:51:30 +00:00
Anas Nashif
d3e2b0255a kernel: logger: move to unified kernel APIs
move to new APIs and cleanup syntax a bit.

Change-Id: Idc9a663ddcc4886182c5d5120261b813de1e5ad2
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-09 23:01:42 +00:00
Andrew Boie
56f561e15e arches: use new kernel APIs
Change-Id: I4b6f5264d5295ebf4278991a1f4e2141bef6602f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 20:49:40 +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
Baohong Liu
6fe94d6431 drivers: rtc: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I8d3dbb637d10e8b184a29aec730338539f9b68a8
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-09 20:32:11 +00:00
Baohong Liu
aa32a0914a drivers: counter: update to unified kernel
Use new semaphore APIs from unified kernel.

Change-Id: I05e4bf18da89c521e0de1216c074019dfed4ac37
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-09 20:27:42 +00:00
Andrew Boie
b85e58ad6d kernel: don't directly use deprecated sys_tick_get APIs
Change-Id: I438769018e1002d508e4a22bdd6806f77e1a1394
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 19:59:07 +00:00
Andrew Boie
ec75fb856c legacy.h: deprecate legacy API
Many APIs needed to be converted into inline functions first.
Now all APIs here are deprecated, or #defined to something that is
deprecated.

Change-Id: Ibad55adec113eb8913ebe07134a2e4935616bc1d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 19:37:35 +00:00
Anas Nashif
ba714dc6c2 tests: test_task: rename task group from TEST to TESTGROUP
Change-Id: I32b9470f8eb958e1ef60e11142799882bc6ad89a
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-09 18:33:25 +00:00
Anas Nashif
c3552e6624 tests: test requires kernel to provide printk
Change-Id: I9ee3eb6cf67c7390a0ade07ace67de64de30bb94
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-09 18:33:25 +00:00
Anas Nashif
5b1b2d6123 tests: test_sema: rename task group from TEST to TESTGROUP
Avoid conflicts with redefinition of TEST

Change-Id: I309a1056053d2a998748bbc68f368f2c61d13b70
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-09 18:33:25 +00:00
Andrew Boie
0b474eef9c kernel: deprecate old init levels
PRIMARY, SECONDARY, NANOKERNEL, MICROKERNEL init levels are now
deprecated.

New init levels introduced: PRE_KERNEL_1, PRE_KERNEL_2, POST_KERNEL
to replace them.

Most existing code has instances of PRIMARY replaced with PRE_KERNEL_1,
SECONDARY with POST_KERNEL as SECONDARY has had a longstanding bug
where the documentation specified SECONDARY ran before the kernel started
up, but actually ran afterwards.

Change-Id: I771bc634e9caf7f17dbf214a270bc9967eed7d32
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:59:44 +00:00
Andrew Boie
183a79cf6e tests: unit: remove -Werror
sanitycheck already sets this and we need to allow deprecation
warnings.

Change-Id: I3d6bf652403bcbdba47663c8cd0d17682a8a842d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:33:01 +00:00
Andrew Boie
12af934353 device.h: use new semaphore APIs
Change-Id: I87c84cbdaaf25bc1503ed8a12b595b13f9089740
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-11-09 17:33:00 +00:00
Johan Hedberg
7773893744 Merge bluetooth branch into master
Main changes:

 - Fix handling of LL_UNKNOWN_RSP PDU in controller
 - Add basic support for an internal persistent storage handler
 - Convert initial pieces of code to unified kernel APIs
 - Fix regression with L2CAP CoC credits
 - Update documentation to match latest implementation

----------------------------------------------------------------
Arun Jagadish (1):
      Bluetooth: AVDTP: Set Profile Security Level to Medium

Carles Cufi (1):
      Bluetooth: Controller: Handle LL_UNKNOWN_RSP PDU for remote features

Johan Hedberg (9):
      Bluetooth: doc: Update subsystem description
      Bluetooth: doc: Move PICS documentation to right place
      Bluetooth: storage: Add basic support for internal storage
      Bluetooth: Implement bt_storage_clear()
      Bluetooth: tests/shell: Implement "clear" command
      Bluetooth: samples: Use consistent naming for HCI apps
      Bluetooth: Fix usage of C++ reserved word
      Bluetooth: Use depends on SERIAL instead of selects
      Bluetooth: tests/shell: Add Arduino 101-specific configuration

Luiz Augusto von Dentz (3):
      Bluetooth: L2CAP: Fix regression causing credits not to be restored
      Bluetooth: L2CAP: Limit segments to TX MPS
      Bluetooth: L2CAP: Add helper function to create LE signalling PDUs

Sathish Narasimman (3):
      Bluetooth: AT handling error condition
      Bluetooth: HFP HF: SLC connection-Send/Parse BRSF
      Bluetooth: Sample: handsfree sample application

Szymon Janc (5):
      Bluetooth: Remove workaround for Mynewt firmware bug
      Bluetooth: Controller: Include zephyr.h instead of nanokernel.h
      Bluetooth: Use unified k_sem API for semaphores
      Bluetooth: nble: Use unified k_sem API for semaphores
      Bluetooth: Controller: Use unified k_sem API for semaphore

 doc/bluetooth/gap-pics.txt                              | 624 --------------------
 doc/bluetooth/sm-pics.txt                               |  78 ---
 doc/subsystems/bluetooth/bluetooth.rst                  |  23 +-
 doc/subsystems/bluetooth/gap-pics.rst                   | 731 ++++++++++++++++++++++++
 .../bluetooth/gatt-pics.rst}                            | 170 +++---
 .../bluetooth/l2cap-pics.rst}                           |  75 +--
 doc/subsystems/bluetooth/qualification.rst              |  16 +
 doc/subsystems/bluetooth/sm-pics.rst                    |  95 +++
 drivers/bluetooth/hci/Kconfig                           |   4 +-
 drivers/bluetooth/nble/Kconfig                          |   2 +-
 drivers/bluetooth/nble/conn_internal.h                  |   2 +-
 drivers/bluetooth/nble/gatt.c                           |   8 +-
 include/bluetooth/bluetooth.h                           |   2 +-
 include/bluetooth/l2cap.h                               |   2 +-
 include/bluetooth/rfcomm.h                              |   2 +-
 samples/bluetooth/README                                |   4 +-
 samples/bluetooth/handsfree/Makefile                    |  25 +
 samples/bluetooth/handsfree/prj.conf                    |   9 +
 samples/bluetooth/handsfree/src/Makefile                |   3 +
 samples/bluetooth/handsfree/src/main.c                  |  93 +++
 samples/bluetooth/handsfree/testcase.ini                |   4 +
 samples/bluetooth/{hci-uart => hci_uart}/Makefile       |   0
 samples/bluetooth/{hci-uart => hci_uart}/generic.conf   |   0
 samples/bluetooth/{hci-uart => hci_uart}/nrf5.conf      |   0
 samples/bluetooth/{hci-uart => hci_uart}/src/Makefile   |   0
 samples/bluetooth/{hci-uart => hci_uart}/src/main.c     |   0
 samples/bluetooth/{hci-uart => hci_uart}/testcase.ini   |   0
 samples/bluetooth/{hci-usb => hci_usb}/Makefile         |   0
 samples/bluetooth/{hci-usb => hci_usb}/prj.conf         |   0
 samples/bluetooth/{hci-usb => hci_usb}/src/Makefile     |   0
 samples/bluetooth/{hci-usb => hci_usb}/src/main.c       |   0
 samples/bluetooth/{hci-usb => hci_usb}/testcase.ini     |   0
 subsys/bluetooth/controller/hci/hci.c                   |  38 +-
 subsys/bluetooth/controller/hci/hci_driver.c            |  10 +-
 subsys/bluetooth/controller/ll/ctrl.c                   |   5 +-
 subsys/bluetooth/host/Kconfig                           |   8 +
 subsys/bluetooth/host/Makefile                          |   2 +
 subsys/bluetooth/host/at.c                              |  17 +-
 subsys/bluetooth/host/avdtp.c                           |   2 +
 subsys/bluetooth/host/conn.c                            |  24 +-
 subsys/bluetooth/host/conn_internal.h                   |   4 +-
 subsys/bluetooth/host/hci_core.c                        | 131 +++--
 subsys/bluetooth/host/hci_core.h                        |   6 +-
 subsys/bluetooth/host/hfp_hf.c                          | 127 +++-
 subsys/bluetooth/host/hfp_internal.h                    |  25 +-
 subsys/bluetooth/host/keys.c                            |   5 +
 subsys/bluetooth/host/keys.h                            |   2 +
 subsys/bluetooth/host/keys_br.c                         |  15 +
 subsys/bluetooth/host/l2cap.c                           | 130 ++---
 subsys/bluetooth/host/rfcomm.c                          |  11 +-
 subsys/bluetooth/host/storage.c                         | 237 ++++++++
 tests/bluetooth/shell/Makefile                          |   7 +-
 tests/bluetooth/shell/arduino_101.conf                  |  27 +
 tests/bluetooth/shell/src/main.c                        |  49 ++
 tests/bluetooth/shell/testcase.ini                      |   2 +-
 55 files changed, 1860 insertions(+), 996 deletions(-)
 delete mode 100644 doc/bluetooth/gap-pics.txt
 delete mode 100644 doc/bluetooth/sm-pics.txt
 create mode 100644 doc/subsystems/bluetooth/gap-pics.rst
 rename doc/{bluetooth/gatt-pics.txt => subsystems/bluetooth/gatt-pics.rst} (73%)
 rename doc/{bluetooth/l2cap-pics.txt => subsystems/bluetooth/l2cap-pics.rst} (73%)
 create mode 100644 doc/subsystems/bluetooth/qualification.rst
 create mode 100644 doc/subsystems/bluetooth/sm-pics.rst
 create mode 100644 samples/bluetooth/handsfree/Makefile
 create mode 100644 samples/bluetooth/handsfree/prj.conf
 create mode 100644 samples/bluetooth/handsfree/src/Makefile
 create mode 100644 samples/bluetooth/handsfree/src/main.c
 create mode 100644 samples/bluetooth/handsfree/testcase.ini
 rename samples/bluetooth/{hci-uart => hci_uart}/Makefile (100%)
 rename samples/bluetooth/{hci-uart => hci_uart}/generic.conf (100%)
 rename samples/bluetooth/{hci-uart => hci_uart}/nrf5.conf (100%)
 rename samples/bluetooth/{hci-uart => hci_uart}/src/Makefile (100%)
 rename samples/bluetooth/{hci-uart => hci_uart}/src/main.c (100%)
 rename samples/bluetooth/{hci-uart => hci_uart}/testcase.ini (100%)
 rename samples/bluetooth/{hci-usb => hci_usb}/Makefile (100%)
 rename samples/bluetooth/{hci-usb => hci_usb}/prj.conf (100%)
 rename samples/bluetooth/{hci-usb => hci_usb}/src/Makefile (100%)
 rename samples/bluetooth/{hci-usb => hci_usb}/src/main.c (100%)
 rename samples/bluetooth/{hci-usb => hci_usb}/testcase.ini (100%)
 create mode 100644 subsys/bluetooth/host/storage.c
 create mode 100644 tests/bluetooth/shell/arduino_101.conf

Change-Id: I4da9302f266ba293d27c152d68bb76de76f04ce9
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 12:25:10 +02:00
Johan Hedberg
77dcd7151d Bluetooth: tests/shell: Add Arduino 101-specific configuration
Add an Arduino 101-specific configuration that enables flash-based
storage support as well as the file system shell.

Change-Id: Ic10ea958dd2446df4942a8dfd3cce1e3368852b2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 09:15:46 +00:00
Luiz Augusto von Dentz
bc3af66a01 Bluetooth: L2CAP: Add helper function to create LE signalling PDUs
This consolidate code around LE signalling header handling which has been
duplicated in many places.

Change-Id: I0c2cd48c155b751e1bbbd26070965d075cdc2cc5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-11-09 08:43:43 +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
Carles Cufi
6ccfa64b5c Bluetooth: Controller: Handle LL_UNKNOWN_RSP PDU for remote features
When a peer controller does not recognize one of the LL control
PDUs received, it will issue an LL_UNKNOWN_RSP PDU to let the
peer know that it does not recognize the request.
The controller now handles this incoming PDU and completes the
procedure by issuing the appropriate HCI event in the case of
an LL_FEATURE_REQ and _RSP pair.

Jira: ZEP-1220

Change-Id: I7c04a346441f04deee41198daa6309c11ae1b571
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-11-09 08:57:52 +02:00
Johan Hedberg
d7f4fd74a9 Bluetooth: Use depends on SERIAL instead of selects
This suppresses warnings for platforms where SERIAL can't be provided.
All the platforms that these drivers are interesting for already
default to SERIAL=y.

Change-Id: Id692f99e018009b30903db8a2c046a6086be01c2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 08:57:52 +02:00
Johan Hedberg
195e1b89b1 Bluetooth: Fix usage of C++ reserved word
'private' is a C++ reserved word and will lead to compilation errors:

  C++     ble.o
In file included from ble.cpp:7:0:
 include/bluetooth/bluetooth.h:284:10: error: expected unqualified-id before 'private'
  uint8_t private[4];

Change-Id: I36aef5a84af4fc66e1c810bd0c56e5ab5f803294
Signed-off-by: Johan Hedberg <johan.hedberg@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
Sathish Narasimman
c719bfb689 Bluetooth: HFP HF: SLC connection-Send/Parse BRSF
Service Level Connection(SLC) Initialization part. Sending AT+BRSF
and parsing its response.

< ACL Data TX: Handle 256 flags 0x00 dlen 20
      Channel: 75 len 16 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x09 cr 0 dlci 0x02
         Control: 0xef poll/final 0
         Length: 12
         FCS: 0x40
        41 54 2b 42 52 53 46 3d 31 34 38 0d 40           AT+BRSF=20.

.
> ACL Data RX: Handle 256 flags 0x02 dlen 23
      Channel: 64 len 19 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0xff poll/final 1
         Length: 14
         FCS: 0x86
         Credits: 4
        0d 0a 2b 42 52 53 46 3a 20 38 37 31 0d 0a 86     ..+BRSF: 871.
> ACL Data RX: Handle 256 flags 0x02 dlen 14
      Channel: 64 len 10 [PSM 3 mode 0] {chan 0}
      RFCOMM: Unnumbered Info with Header Check (UIH) (0xef)
         Address: 0x0b cr 1 dlci 0x02
         Control: 0xef poll/final 0
         Length: 6
         FCS: 0x9a
        0d 0a 4f 4b 0d 0a 9a                             ..OK...

Change-Id: I51581928d479ea4229b32a07cbea86c1f6fe09c8
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2016-11-09 08:57:52 +02:00
Sathish Narasimman
b0d34d83c5 Bluetooth: AT handling error condition
In function at_get_number check for the value if gets computed.
If not return error. Also change the end state handling.

Change-Id: I193b04fa2880dfb44e7727b30b67c1ec2e051cc7
Signed-off-by: Sathish Narasimman <sathish.narasimman@intel.com>
2016-11-09 08:57:52 +02:00
Johan Hedberg
7e1234b44b Bluetooth: tests/shell: Implement "clear" command
Implement a new "clear" command to exercise the bt_storage API. The
command can either take an address parameter to clear storage for a
specific device, or, if called with the parameter "all", to clear the
entire storage.

Jira: ZEP-181

Change-Id: I1ebd17033f2062951abeeb7d7c448a34a3672577
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 08:57:52 +02:00
Johan Hedberg
8ed846285e Bluetooth: Implement bt_storage_clear()
Add an implementation for the bt_storage_clear() API.

Jira: ZEP-181

Change-Id: Iae01c571c161317ea0cc44513d108301c7b5a069
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 08:57:52 +02:00
Johan Hedberg
77a8516dd2 Bluetooth: storage: Add basic support for internal storage
Add basic implementation of an internal storage handler that uses the
local file system. The root directory for all Bluetooth related data
is /bt. Each remote device has its own subdirectory and each key its
own file. This helps keep the implementation very simple, but does
come with the meta-data overhead for each file.

As an example, the value of a key 0x0001 for a device with a static
random address cc:11:22:33:44:55 would be stored in the following
file: /bt/cc11223344551/0001. Local values such as the identity
address are stored directly under /bt with a file name that matches
the key the same way as remote-device files.

For full functionality the implementation requires a file system that
can support file/directory names of up to 13 characters in length. If
the file system supports less than that (as is the case with FAT12)
then only local values can be stored (in /bt/abcd). Local values
include the identity address as well as the local IRK.

Jira: ZEP-181

Change-Id: I7dc696af6353a154cb00dcd01a5f4ac3d7127e6b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-11-09 08:57:52 +02:00
Szymon Janc
e18e3ed60a Bluetooth: Controller: Use unified k_sem API for semaphore
Change-Id: I02b4e5f4d0a2995cfae1b9a2edcbdf01d6ec631a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-09 08:57:52 +02:00
Szymon Janc
b73b77652c Bluetooth: nble: Use unified k_sem API for semaphores
Change-Id: I5bf66ab7c3f863945f2c9f9392d773b348020367
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-11-09 08:57:52 +02:00