Commit graph

923 commits

Author SHA1 Message Date
Grzegorz Kolodziejczyk 2e77f815f0 Bluetooth: Correct Device Disconnect Event opcode
The same opcode was used to Device Connected event.

Change-Id: I51640ed81822311817e82e43998c476795a28d49
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:24:46 -05:00
Grzegorz Kolodziejczyk 7c49f209b1 Bluetooth: Add possible values of addr type for GAP conn/disconn
This patch adds valid address types parameter for connect, disconnect
commands.

Change-Id: Ia54d503795c1ff04549f9813e197a1de923ef0bb
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:24:46 -05:00
Johan Hedberg 1f6841c9c1 Bluetooth: Convert driver header info to hidden Kconfig options
We know the needed values at build-time, so there's no point in having
a runtime mechanism of accessing them in the code. Having the values
as defines makes it e.g. possible to use them as input for defining
the size of buffer pools.

Change-Id: Ib7556644719bfb631e638fa5bf29f3d1747a5072
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:45 -05:00
Szymon Janc 542bb9cc34 Bluetooth: Fix disconnect command in shell application
Disconnect command is special since it is also used for cancelling
outgoing connection. Due to this is might be called with default_conn
set to NULL. To avoid conditional unref always pick extra reference
from default_conn for local use.

Change-Id: I59ad583becbf39a71366069d0307aa44f2c64174
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:44 -05:00
Luiz Augusto von Dentz 5bd4324ae2 Bluetooth: L2CAP: Unref buffer after calling recv callback
This simplify the handling quite a bit while the application can still
prevent the buffer to be freed by referencing it if necessary.

Change-Id: I5ed0e96e8d9e349b79ba31ba9568af61181e1065
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:41 -05:00
Luiz Augusto von Dentz b861797736 Bluetooth: Fix not unreferencing buffer
Buffer received over L2CAP dynamic channels needs to be unref by the
application once they are done with it.

Change-Id: If210be1c538cf0b550dd03094d007b6851cdfbf4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:40 -05:00
Johan Hedberg 4b433d4fa6 Bluetooth: Differentiate send/recv of needed driver headroom
The space that the HCI driver needs to reserve for its own use is not
necessarily symmetrical. E.g. even with the current H4 driver we only
need to reserve space for sending data but not for receiving it.
Keeping track of these values independently enables more efficient use
of the buffers.

Change-Id: I64917b545c5cd77356ed038d09afe76422334661
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:39 -05:00
Johan Hedberg 5f4daa1551 Bluetooth: Merge send_acl/cmd back to a single callback
Now that we have the buffer type enum as part of the HCI driver API we
can take advantage of it to pass the buffer type information and not
have to have two separate callbacks.

Change-Id: Ib2ee5b1540e532c9b27903e97660a276c1293fbc
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:39 -05:00
Johan Hedberg 7ff1cbd976 Bluetooth: Split HCI driver ACL/CMD send callback
This is a necessary step in preparation for removing the buffer type
information from the buffers.

Change-Id: I29d8fae32aa660416a1c12e87840499c711e659f
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:39 -05:00
Johan Hedberg 70f80ad968 Bluetooth: samples/peripheral: Remove dependency on internal define
Change-Id: I514d9beb69c27e563d7daeaa880ba55b49a6f159
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:39 -05:00
Szymon Janc 51af39ff16 Bluetooth: Allow sanity to build tester on x86
This allows to build sanity for both ARM and x86 archs.
Only supported platforms are enabled.

Change-Id: I499dbdee7b9df265affb2bba98b5bb100339fe18
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:39 -05:00
Szymon Janc 162b5e8091 Bluetooth: Default to ARM build for tester application
Tester application requires 3 UARTs and currently no x86 based
platform supports it. For convenience default to arch that allows
to run, not only build tester.

Change-Id: I086e72a580f56d94181a6d6eada7693ddd24dec1
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:39 -05:00
Johan Hedberg 48fde83fe5 Bluetooth: samples/test_bluetooth: Convert to net_buf API
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.

Change-Id: I98a0720483d3f364b77fe6dc030c9169aa4ade67
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:39 -05:00
Johan Hedberg e41285999c Bluetooth: samples/shell: Convert to net_buf API
Convert the code to use the net_buf API instead of the soon to be
removed bt_buf API.

Change-Id: I4eb6cea592cce99dcc9e4c1b1219ebbf89eddd04
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:39 -05:00
Luiz Augusto von Dentz d57e54fddc Bluetooth: Make it possible to build tester for x86
Currently it is only possible to build the tester for arm.

Change-Id: I7fd530ca09bfa41072420da774fba3b48a5d5a90
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:38 -05:00
Luiz Augusto von Dentz 929d4f4c86 Bluetooth: GATT: Make BT_GATT_CHARACTERISTIC declare its value
This makes BT_GATT_CHARACTERISTIC declare a local bt_gatt_chrc so the
applications don't need to declare themselves.

Change-Id: Icf3fad7dffea5667c6f13aa022a5722900da51e8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:38 -05:00
Luiz Augusto von Dentz 1617f5580b Bluetooth: GATT: Remove value_handle from bt_gatt_chrc
The spec says it should always be the very first descriptor after the
characteristic:

  "BLUETOOTH SPECIFICATION Version 4.2 [Vol 3, Part G] page 534:
   3.3.2 Characteristic Value Declaration
   The Characteristic Value declaration contains the value of the
   characteristic. It is the first Attribute after the characteristic
   declaration. All characteristic definitions shall have a
   Characteristic Value declaration."

Change-Id: I6c38dea9cc4c1a05997edbd348e2759680472725
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:38 -05:00
Luiz Augusto von Dentz 148ce3013c Bluetooth: GATT: Remove unused field of _bt_gatt_ccc
value_handle is not used for anything.

Change-Id: I3885d221b162eb3bd44956af64280baf61dc001b
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:38 -05:00
Luiz Augusto von Dentz 1284e608ac Bluetooth: GATT: Remove handles from macros
bt_gatt_register will assign a handle if not initialized and removing
the handle makes it simpler to change the attributes since it is no
longer possible to have conflicting handles.

Change-Id: I787f7325cc990c360056b1aefd07bb7d7876b445
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:38 -05:00
Luiz Augusto von Dentz 1c8ab98114 Bluetooth: GATT: Make attribute database into a list
This allow calling bt_gatt_register multiple times so different tasks
can add their own services separately.

Change-Id: I8143ddedfa1079087d608013d1a97b552a3007dc
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:38 -05:00
Johan Hedberg 49885879f2 Bluetooth: Rename bt_conn_get/put to bt_conn_ref/unref
We want to make the naming convention ref/unref rather than get/put.
So far the only reference counted objects are the buffers and the
connections. For the buffers the new generic buffer API will also use
ref/unref.

Change-Id: I9fe8b8a6a50a8baf06ba231e8f6717a5a47dd292
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:24:38 -05:00
Mariusz Skamra 13e0178c55 Bluetooth: Add support for writting characterisitc value
This adds write and flush attribute callbacks to be used for writting
attribute values.
With this patch lower tester can test if IUT can properly handle
write request to the characteristic values.

> ACL Data RX: Handle 64 flags 0x02 dlen 7  [hci0] 1151923.440823
      ATT: Read Request (0x0a) len 2
        Handle: 0x0003
< ACL Data TX: Handle 64 flags 0x00 dlen 7  [hci0] 1151923.456050
      ATT: Read Response (0x0b) len 2
        Value: bbbb
> ACL Data RX: Handle 64 flags 0x02 dlen 9  [hci0] 1151928.435525
      ATT: Write Request (0x12) len 4
        Handle: 0x0003
          Data: ffff
< ACL Data TX: Handle 64 flags 0x00 dlen 5  [hci0] 1151928.456865
      ATT: Write Response (0x13) len 0
> ACL Data RX: Handle 64 flags 0x02 dlen 7  [hci0] 1151929.380796
      ATT: Read Request (0x0a) len 2
        Handle: 0x0003
< ACL Data TX: Handle 64 flags 0x00 dlen 7  [hci0] 1151929.394636
      ATT: Read Response (0x0b) len 2
        Value: ffff

Change-Id: Iea1d39e1a52496692141411251fd4ac2f9ae0b97
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:38 -05:00
Mariusz Skamra 1fa60d7a5e Bluetooth: Fix set value command handler
If the attribute value is going to be changed by the upper tester,
(eg. to issue notification) for simplicity it can be stored in the
place of old one.

Change-Id: I03a6ebbda5d75e6ffa9c2fd6b3c0eab495623a11
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:38 -05:00
Luiz Augusto von Dentz 118dc75cea Bluetooth: GATT: Add connection to bt_gatt_notify
This allow sending direct notification to a specific peer without
using CCC which is allowed by the spec:

  BLUETOOTH SPECIFICATION Version 4.2 [Vol 3, Part F page 507
  3.4.7.1 Handle Value Notification

  A server can send a notification of an attribute’s value at any time.

Change-Id: Ieff29216cb9ba197c0da92d7b22b26e63101cfa8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:37 -05:00
Mariusz Skamra d523f0bd66 Bluetooth: tester: Handle set discoverable command
Set discoverable command is used to set the discoverable flags
in advertisement data.

Change-Id: If46a5e05379c5f589afb1658a7b275a82c52e4e1
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:37 -05:00
Luiz Augusto von Dentz d55e4ca91c Bluetooth: Add CONFIG_BLUETOOTH_L2CAP_DYNAMIC_CHANNEL
This adds an option to enable L2CAP dynamic channel support, fixed
channels are not affected by it.

Change-Id: If36bece46b7b94142ea1ac976b878d1b5ae6a578
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:37 -05:00
Luiz Augusto von Dentz 4a41da9b38 Bluetooth: Add l2cap-register command to btshell
l2cap-register can be used to register a server:

btshell> l2cap-register 0x0080
bt: bt_l2cap_server_register (0x0011110c): PSM 0x0080

Change-Id: I2c2d9a4cba70b0cddaf352830659d206b609ee63
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:37 -05:00
Anas Nashif 36579879c2 use zephyr.h instead of microkernel/nanokernel.h
Cleanup header inclusion and only include zephyr.h in samples
and applications.

Change-Id: If7460f4c6305a1c1cfcfdcf6a9bb7423f410c5c6
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:35 -05:00
Mariusz Skamra ceef6099dd Bluetooth: shell: Improve device found event callback
With this patch device name obtained from advertising packets
will be printed out.

[DEVICE]: D0:03:4B:DA:10:46 (public), AD evt type 0,
			RSSI -83 AppleLETester
[DEVICE]: D0:03:4B:DA:10:46 (public), AD evt type 4,
			RSSI -82
[DEVICE]: 00:A0:50:00:00:08 (public), AD evt type 0,
			RSSI -80 BLE Keyboard

Change-Id: Ic5116bce958d5b4479d481c40b2658ab56ecb819
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:30 -05:00
Mariusz Skamra df7f3a193f Bluetooth: shell: Improve attribute discovery callback
This patch makes attributes discovery more easier from the point
of shell application user.
UUIDs of discovered attribute declarations are now printed.
For services handle range is shown.

btshell> gatt-discover-primary 1800
btshell> Service 1800 found: start handle 00000001, end_handle 0000000b

Characteristic properties are parsed to string and printed
with characteristic value handle.

Characteristic f000ffc1-0451-4000-b000-000000000000 found: handle 0000006a,
				value_handle 0000006b
Properties: [write][write w/w rsp][notify]

Change-Id: I6823fa562206ccf336dc301ee71bc4a02cecc14f
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:30 -05:00
Szymon Janc f795f37426 Bluetooth: Remove outdated comment from tester
Advertising type is already configured based on current settings.

Change-Id: I4b47237c9ea7c48eab05786f01b38ebe3250141a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:30 -05:00
Mariusz Skamra 15612e6bf9 Bluetooth: Add authentication callbacks to the peripheral app
To allow the remote central to pair and encrypt the link.
IO capabilities are set to DisplayOnly.

Change-Id: I46459539f1b882952d29ee5eb8d17766715de4b8
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:30 -05:00
Mariusz Skamra 9a794915b7 Bluetooth: Fix invalid characteristic handle in peripheral app db
We had two attributes stored with the same handle.

Change-Id: Ib24912578b958d428d6b3da3c2f73994691622bb
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:30 -05:00
Mariusz Skamra cc1208fb5f Bluetooth: Fix invalid value length type
BTP protocol specifies value length to be 2 octets value,
so uint16_t has to be used to store this length.

Change-Id: I2a911910475db305a0ff1f9ab70866d24aa47158
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:30 -05:00
Javier B Perez Hernandez f7fffae8aa Change BSD-3 licenses to Apache 2
Change all the Intel and Wind River code license from BSD-3 to Apache 2.

Change-Id: Id8be2c1c161a06ea8a0b9f38e17660e11dbb384b
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:29 -05:00
Szymon Janc ca9d755073 Bluetooth: Enable stack analysis in tester application
This allows for compile test if analysis code builds.

Change-Id: I500d727a06ef065fc65465140062ec47d31e79fa
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra 01bec178dc Bluetooth: Handle read supported gatt server commands
This will be used to poll Zephyr to send it's supported commmands.

Change-Id: I12cb93a238cd14589123d88e9d9ba4d580dd6d71
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra b75915e366 Bluetooth: Add read characteristic value callback
This is used to respond to the read request of characteristic
value.

Change-Id: Ia0518fae0d70e712621578a7938009345dbfaab4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra 865a087e76 Bluetooth: Handle Set Characteristic/descriptor value
This adds support to handle set attribute value.

Change-Id: I2631cc8744210cfd76add1be3d30e5a0f54b3a7e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra cc3949fec4 Bluetooth: Handle Add Characteristic command
This adds support for adding characteristic declaration and characteristic
value to the tester defined database of GATT attributes.

Change-Id: I108fc5a9bc5c7491fc354c71457d452baaedd868
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra 9624fe8732 Bluetooth: Add support for GATT Server to tester application
This adds support for tester application to cover GATT Server
automated tests. BTP ptotocol commands are used do drive stack to
build attributes database specified by the external tester.

Two commands: to add a service and to start the GATT server are
implemented.

Change-Id: I236c3e4d8636e97926514b2099779cb4334e95cd
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra 7bb885198d Bluetooth: Extend BTP Specification to cover GATT Server
This adds protocol specification for GATT Server.

Change-Id: I2f6083b15c483fb1348f6c108fd54f890d45b83d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:25 -05:00
Mariusz Skamra 5438f7b96b Bluetooth: tester: Handle Set Connectable command
This patch is needed to be able to test zephyr against tests
which require Zephyr to be non-connectable.

This adds handler for the opcode 0x06 - Set Connectable command.
Based on connectable flag in current settings, the corresponding
advertising type is set after issuing Start Advertising command.
If connectable, Connectable undirected advertising type is set,
if non-connectable Non connectable undirected advertising type
is set.

Change-Id: I77865b67c4b717548095ac5e398a873d1b739d6a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra 926e65fe3b Bluetooth: tester: Handle disconnect command
This feature is needed to pass some tests which require termination
of ACL link.

Change-Id: Idab03c569172ea6deb3bc5cf6744e5e73bd5de3e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra 8505cc9b37 Bluetooth: tester: Fix Start/Stop Advertising responses
According to new tester API in case of success Current_settings
shall be returned.

Change-Id: I1caf05180bff4756b8e7271098611d23200af8ee
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra fa48de9e9a Bluetooth: Add connect/disconnect commands to BTP spec
These commands are necessary to pass some of the GAP tests.

Change-Id: Ia599e7dc3dd06aa5ac4130e0d878fcddad7b37dd
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra 85c6194670 Bluetooth: shell: Replace xtoi with strtoul from libc
Change-Id: Ibb6356f5d2dc041b5637abfdfcf5e3dc1a00ea77
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc 9ecbd34f89 Bluetooth: Add support for disabling GATT client support
Binary size reduction of sample peripheral app:
45940 -> 45772

Change-Id: Ia8c463c9642a2928c2cb2ec48d9e9c4eeef20fe7
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc 9c2ad108b8 Bluetooth: Add option for disabling SMP support
This allows to not compile SMP support for devices that don't
require pairing. It is required to support SMP channel and reply
with error for any command received even if pairing is not supported.
To handle this cleanly a null smp implementation is used that case.

Change-Id: I656a52dac882839db904eee65f25a4e29ea2d8c2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc 4c901ac75d Bluetooth: Add option for disabling data signing support
This allows to not compile data signing support if it is not
required. Reduces image size of peripheral sample app from
45772 to 44436 bytes.

Change-Id: I2cd3515973d1a70f478cbd68426ec84fd1645d19
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Szymon Janc 8ff443b1c9 Bluetooth: Add initial Kconfig split options
This allows to specify which roles are supported. Broadcaster and
Observer roles are always supported.

Image size reduction for samples apps:
beacon     43148 -> 15196
central    46892 -> 46356
peripheral 47532 -> 45940

Change-Id: If260c13d63651b9b54df5bafc2c412b01dcb1eb0
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:24 -05:00
Luiz Augusto von Dentz 7d16329af6 Bluetooth: Fix not setting subscription value
bt_gatt_subscribe requires setting proper value in the parameters ever
since indication support was introduced.

Change-Id: Ib78dac717874e51e21bc9f8ad10279ba9fe68097
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:24 -05:00
Luiz Augusto von Dentz f4700f6ceb Bluetooth: Add gatt-discover-secondary command to btshell
This adds gatt-discover-secondary which works as follow:

btshell> gatt-discover-secondary <uuid> [start_handle] [end_handle]
bt: att_find_type (0x00110d18): uuid 0x180f start_handle 0x0001 end_handle 0xffff
Discover pending
btshell> bt: bt_att_recv (0x001134a8): Received ATT code 0x01 len 5
bt: att_error_rsp (0x001134a8): request 0x06 handle 0x0001 error 0x0a
bt: att_find_type_rsp (0x001134a8): err 0x0a
Discover destroy

In addition to this gatt-discover is now renamed to gatt-discover-privary
to avoid any confusion with other discover types.

Change-Id: Iee1fdf3e72269b134e222b4a2c6b4329858e71b0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:24 -05:00
Luiz Augusto von Dentz 331a3d8016 Bluetooth: Add gatt-discover-include command to btshell
This adds gatt-discover-include which works as follow:

btshell> gatt-discover-include [uuid] [start_handle] [end_handle]
bt: att_read_type (0x00110d18): start_handle 0x0001 end_handle 0xffff
Discover pending
btshell> bt: bt_att_recv (0x001134a8): Received ATT code 0x01 len 5
bt: att_error_rsp (0x001134a8): request 0x08 handle 0x0001 error 0x0a
bt: att_read_type_rsp (0x001134a8): err 0x0a
Discover destroy

Change-Id: Id96ffbde7828c8266ab96022861983a9c68c976a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:24 -05:00
Luiz Augusto von Dentz 7a441e7424 Bluetooth: GATT: Refactor discover API
Add discover type to bt_gatt_discover_params to the API is reduced to
just bt_gatt_discover, this should simplify adding support for
discovering secondary and included services.

Change-Id: Iadeed86fed115afee1340b2c09821d7fafdda0f4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:24:24 -05:00
Mariusz Skamra a07ae2531b Bluetooth: shell: Use atoi from internal libc
Since atoi is available in libc this implementation can be removed.

Change-Id: I3cbb230916f382e27d59b503618b6291c8f0b691
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:23 -05:00
Mariusz Skamra b1c31ced58 Bluetooth: tester: Fix supported_settings to be sent in le order
All the data shall be sent in little-endian byte order.

Change-Id: I6d4ab0760f92e202ddcb348d30f0d1f208f84f1d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:23 -05:00
Szymon Janc 46137ba7f5 Bluetooth: SMP: Use tinycrypt if available
If tinycrypt is compiled in use it for encryption instead of HCI LE
Encrypt command.

Change-Id: I9cf70540f14ed449bfda52c4a0901462b9a60fe9
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:24:23 -05:00
Mariusz Skamra 34bd454fae Bluetooth: tester: Keep track current settings
Some tester commands require to response with current settings.
This patch is needed to properly track the changes in these settings.

Change-Id: Ib9c919e804decbe26ba6ab2a23f1c30d812f98ab
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:24:23 -05:00
Johan Hedberg fd0bd160e6 Bluetooth: Add missing copyright statement to btp_spec.txt
Change-Id: I21f567fa56ee6cd5038838938161ac9cb00e9841
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:16:17 -05:00
Luiz Augusto von Dentz d1ca4eb92d Bluetooth: Add subscription type to gatt-subscribe in btshell
This enables passing the value to be used when writing to CCC so it can
be configure for indications in adition to notifications.

Change-Id: Ied89faed422e5c5ec60618d512dbd3f250f50b46
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:16:16 -05:00
Luiz Augusto von Dentz 1b4fb0d8a6 Bluetooth: GATT: Add value support to bt_gatt_subscribe
This enables bt_gatt_subscribe to subscribe using indication value in
addition to notification.

Change-Id: I25f3b057e36b023a79fb66b11b70716ecc299ba9
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:16:16 -05:00
Mariusz Skamra 3bb2df0d24 Bluetooth: tester: Add missing GAP_SETTINGS_DISCOVERABLE define
Change-Id: I56cad6462a50783a9518b3bc7a3c6b082f323f8e
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:16:16 -05:00
Andrei Emeltchenko 41d047f0fa Bluetooth: Fix bug in the shell app
Fixes bug accessing wrong memory.

Change-Id: I13b4bebe807fe3c2694311e72d9d49d3b688bceb
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:16:16 -05:00
Szymon Janc deb72b0b34 Bluetooth: Add initial Bluetooth Tester Protocol specification
This documents describes protocol used by external tester to drive
IUT. Currently initial version includes only Core and GAP services.

Change-Id: I2fcb366076313880116be2ead8916bb56a4b5910
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:16:16 -05:00
Szymon Janc bece111ec9 Bluetooth: Refactor tester application
This big patch refactors tester application and put it in par with
updated tester protocol.

Change-Id: Ib016fdd0aac58a32bcdc67774843cf65d619947d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:16:16 -05:00
Grzegorz Kolodziejczyk 1d322531cd Bluetooth: Add GAP Appearance characteristic to GATT db
This is a mandatory characteristic for GAP servie. It must be included
in GATT db.

Change-Id: I27c0c6d56f5303c3c5d1606d7656c51823f74989
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:16:15 -05:00
Szymon Janc 18b98614a4 Bluetooth: Make signed_value static in periperal sample
This variable is not used outside of c file.

Change-Id: I89b34fb6dd2cdd9dd111b6e33829f170d0ba00ae
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:40 -05:00
Grzegorz Kolodziejczyk f535c0674e Bluetooth: Add possiblity to set advertising mode
This patch adds possibility of setting advertise mode.
If no advertising mode is set, use default value (discoverable).

Change-Id: I86456ca52ad54a2fd4e4c6443a79087ddeb99ec6
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:15:40 -05:00
Grzegorz Kolodziejczyk 03706d4644 Bluetooth: Add advertising type argument set possibility
Bluetooth shell now supports advertising type set while starting
advertise.

Change-Id: I1e672b4c9315368dcef38398834acc5541c1843b
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:15:40 -05:00
Szymon Janc cfa51f89f1 Bluetooth: Strip command extra spaces in shell app
This makes shell a bit more convenient to use.

Change-Id: I50490eb3cf9434723737a71fb382316876ba6291
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:40 -05:00
Szymon Janc e28d358d09 Bluetooth: Add explicit help command
This commands print list of all available commands.
On unknown command only short info about 'help' command is
printed.

Change-Id: I780f4fd8da7292192260a0e0af8815fe4e385ae2
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:40 -05:00
Szymon Janc ea80649a83 Bluetooth: Refactor command parameters handling in shell app
Reduce usage of static variables making code easier to follow.
Also improve robustness in case of too many parameters provided.

Change-Id: I6a3f0162a4fb301479ed36c54ceca2967bb7e389
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:40 -05:00
Szymon Janc 022f1897e0 Bluetooth: Don't print help in shell app for empty input line
If empty input was provided simply reprint prompt instead of printing
uage information. This makes it similar to linux shell.

Change-Id: Ie4d9e1e7cb011ddf14f490188335ddc44289ffcf
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:40 -05:00
Andrei Emeltchenko eba54d6610 Bluetooth: Refactor btshell app
Use more robust approach when registering shell callbacks. Instead of
allocating maximum number of callbacks use exact memory which is
needed.

Change-Id: I96db75375e8d24df328adc0622c7817a3328f860
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:15:39 -05:00
Szymon Janc 9764e3dc84 Bluetooth: Implement security_changed callback in shell app
This callback is called when security level of connection changed.

Change-Id: Ifec130163fffe291cd012c99247017bd31173660
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:38 -05:00
Grzegorz Kolodziejczyk 76bf6f60aa Bluetooth: Use generic read string handler for db descriptors
There is no need to define for each descriptor its own read handler.
Each string descriptor will use generic string read handler if
possible.

Change-Id: I468a082c6875400ec4515588131132ef27cc8082
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:15:38 -05:00
Szymon Janc 272128fece Bluetooth: Implement identity resolved callback in shell app
When identity is resolved only Identity Address should be used for
identifying connection.

Change-Id: Ic179286b09afced4997a755f1977eea818bc6e54
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:38 -05:00
Szymon Janc b7f6e31264 Bluetooth: Fix cancelling outgoing connection in shell app
default_conn is assigned only on connected event so there was
no way to cancel pending outgoing connection.

Change-Id: Iba5018e887c5b3f87513fc5c8f4585fb6ec40c8d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Grzegorz Kolodziejczyk e2673b539f Bluetooth: Use strcmp instead of strncmp
There is no need to use strncmp for string type arguments terminaded
by NUL character.

Change-Id: Ib90517f4657de8da64f145afd0ac28aefa697026
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:15:37 -05:00
Grzegorz Kolodziejczyk c688f327b1 Bluetooth: Use unified help cmd tip label for advertise cmd
To avoid multiple prints with cmd help one label will be used.

Change-Id: Ieaaffd8b4321fdb2ad2f95894d293ec1d6eb8d10
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc 3b5bae6b96 Bluetooth: Fix tester application automated build
Due to bug in test case configuration file tester application
was not build by 'Build Automation'. This application has all
Bluetooth debugs enabled so it is essential for build verification
process.

Change-Id: I51115d17a28614b7746c6d207d4362a94bc0f591
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Grzegorz Kolodziejczyk 6e2132f724 Bluetooth: Separate char to hex helper
This patch separate character to hex character convertion part and
moves related code to helper.

Change-Id: I5c754669583228566e80a9b20a9db0e639641677
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
2016-02-05 20:15:37 -05:00
Szymon Janc 2d4aac58f5 Bluetooth: Update authentication support in shell application
This allows to select more authentication options and reply
to all requests.

Change-Id: I220d945763b9381818c5caad52bf0f5e8b01ab54
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:37 -05:00
Andrei Emeltchenko 30c28925fa Bluetooth: Add new attribute with signed write permission
Change-Id: I731b4d3f3a31cff9c4be89dd1f911f4365b5e783
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:15:24 -05:00
Andrei Emeltchenko 2ccf1f11c0 Bluetooth: Add GATT Signed Write to shell
Bluetooth shell now supports Signed Write if CSRK key is present.

Change-Id: I035a0d314da4997105c64da58cf85bd95fdbaa5b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:15:24 -05:00
Andrei Emeltchenko f9cd4105da Bluetooth: Add GATT Signed Write command
Add support for signed write with sign parameter for write without
response.

Change-Id: I79008532d88b10d34db1f68898ad4258dd3e761b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:15:24 -05:00
Szymon Janc 669454f1e1 Bluetooth: Allow to enable authentication in btshell application
This allows to register pairing callbacks that will display passkey
in case of authenticated pairing.

Change-Id: I18422193785fdcd8a2e567adeb65199bfadcdd1f
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
2016-02-05 20:15:24 -05:00
Andrei Emeltchenko 1fbaf56bc2 Bluetooth: Increase stack size to default value
Make stack size the same size as in hello app. Current stack cannot
handle correctly security tests.

Change-Id: I5946c6bbcbc5079cefefddbb229b3205364b24d0
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:15:23 -05:00
Luiz Augusto von Dentz 18dccd7f64 Bluetooth: Add gatt-write-without-response command to btshell
This adds gatt-write-without-response which can be used as following:

btshell> gatt-write-without-response <handle> <data>
bt: bt_gatt_write_without_response (0x0010f0a0): handle 0x0011 length 1
Write Complete (err 0)

Change-Id: Ide166049cf53e691a2269778bca1489f7027621f
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:15:23 -05:00
Luiz Augusto von Dentz c9b3116c5b Bluetooth: Add offset support to btshell gatt-write command
This adds offset to gatt-write which can be used as following:

btshell> gatt-write 0011 0001 01
bt: gatt_prepare_write (0x0010f680): handle 0x0011 offset 1 len 1
Write pending
btshell> bt: bt_att_recv (0x00111918): Received ATT code 0x17 len 6
bt: att_handle_prepare_write_rsp (0x00111918):
bt: att_prepare_write_rsp (0x00111918): err 0x00
bt: gatt_exec_write (0x00111918):
bt: bt_att_recv (0x00111918): Received ATT code 0x19 len 1
bt: att_handle_exec_write_rsp (0x00111918):
bt: att_write_rsp (0x00111918): err 0x00
Write complete: err 0

Change-Id: I4d3c038ea572da92efe0de8ce426ffca15506440
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:15:22 -05:00
Luiz Augusto von Dentz 0636edfdd7 Bluetooth: GATT: Add offset to bt_gatt_write
This enables writing from offset using Prepare Write + Execute Write
procedures including Long Write procedure when the data is bigger than
the MTU.

Change-Id: Id35d66c011ba582a4ba92ffe75444226e479335a
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:15:22 -05:00
Szymon Janc dabedeb449 Bluetooth: Register simple GAP service in btshell app
Some devices (eg. Android KitKat) are confused if remote database
is empty.

Change-Id: Ie27920b6f64b12903917068101d5abb171ab42c0
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:44 -05:00
Luiz Augusto von Dentz 66367b5ef3 Bluetooth: Check if bt_gatt_subscribe return -EALREADY
If bt_gatt_subscribe -EALREADY that means it is already subscribed and
shall not be reused.

Change-Id: I83c620454c40863c71b1289d37c2b42571a907fd
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:44 -05:00
Johan Hedberg e899c811e6 Bluetooth: Use async callback for enabling Bluetooth
In the peripheral sample app use the async feature of bt_enable() to
verify that it works as expected.

Change-Id: I15f7758944a8c34d1aaef84f0ba77a6b5bbb4695
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:44 -05:00
Johan Hedberg 79696d3b34 Bluetooth: Redesign Bluetooth init API
We need to be able to perform the init procedure asynchronously
through a callback. The RX fiber is a good candidate to use for the
callback since it's not active in its normal operation before
drv->open has been called. In order to prepare for a future
bt_disable() API the init API is renamed from bt_init() to
bt_enable(). If a NULL pointer is given as the callback the API
behaves synchronously like the old bt_init().

Change-Id: I4e78fa8f32dcf5477ea05a8db75aca5cdce591fd
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:44 -05:00
Luiz Augusto von Dentz 8697d207a0 Bluetooth: GATT: Fix using uint8_t for attribute length
Attribute length can be up to 512 bytes long so it needs to be at least
uint16_t, ATT already takes care that the MTU does not exceed 512 bytes.

Change-Id: I6c8dc80a4b63f212420c26c0a24d93939fa510fe
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:44 -05:00
Luiz Augusto von Dentz 369ff3bb90 Bluetooth: Make central sample discover HRS over GATT
This makes the central sample discover the attributes and subscribe
to receive notifications of HeartRate Measurement Characteristic.

Change-Id: Icedbdd759638be0b8fa8515112208aa61ad5eb90
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:43 -05:00
Luiz Augusto von Dentz f581894abf Bluetooth: Make central sample connect to devices supporting HRS
This makes central sample to parse the Advertising Data and in case the
device supports HeartRate Service stop scanning and connect to it, if the
device disconnects then start scanning again.

Change-Id: I49962eadb5c82c7a910185212063cd576cadf62e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:43 -05:00
Luiz Augusto von Dentz 7942266868 Bluetooth: Add connection callbacks to central sample
This will be needed to monitor connections with peripherals.

Change-Id: Iccea2696af72b0b8b3f40aac180738dc6b80abc8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:43 -05:00
Mariusz Skamra 6b4f7025f2 Bluetooth: Start using atomic flags to indicate bt_dev state
With this patch advertising state and scanning state are stored as flags.

Change-Id: I5d2dc37972620ee89aaf55d45e294e8be82863d3
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:43 -05:00
Luiz Augusto von Dentz 368cfb775e Bluetooth: Add gatt-unsubscribe command to btshell
This adds gatt-unsubscribe which works as follow:

btshell> gatt-unsubscribe <CCC handle>
bt: gatt_write_ccc (0x0010edc8): handle 0x0015 value 0x0000
Unsubscribe success

Change-Id: I812fd237f71c4cad8e188015f1cd4cd2f2902aa6
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:43 -05:00
Luiz Augusto von Dentz d39eb230ee Bluetooth: Add gatt-subscribe command to btshell
This adds gatt-subscribe which works as follow:

btshell> gatt-subscribe <CCC handle> <value handle>
bt: gatt_write_ccc (0x0010e594): handle 0x0015 value 0x0001
bt: bt_att_recv (0x0011082c): Received ATT code 0x13 len 1
bt: att_handle_write_rsp (0x0011082c):
bt: att_write_ccc_rsp (0x0011082c): err 0x00
Subscribe complete: err 0
Subscribe destroy
bt: bt_att_recv (0x0011082c): Received ATT code 0x1b len 4
bt: att_notify (0x0011082c): handle 0x0014
bt: bt_gatt_notification (0x0011082c): handle 0x0014 length 1
Notification: data 0010cea9 length 1

Change-Id: Ide1f737358857a87db6dac1ecd9097f8da99ed72
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:43 -05:00
Luiz Augusto von Dentz a6b826e918 Bluetooth: Use connection context in btshell
Once connected store the bt_conn as context, this save the trouble of
entering the same parameter over and over and remove the lookups from
commands that requires a connection.

Change-Id: I9671b8fa07a1a61db45516f63eb007f19f0e59a1
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:43 -05:00
Johan Hedberg 9698411362 Bluetooth: Minor coding style (white space) fix
Change-Id: I50f0f4548fdf5c79c783f4055974e427ba9cbfe8
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:43 -05:00
Peter Mitsis ad03f13db5 samples: Update sanity_chk usage notes
Removes reference to the unsupported "-T <toolchain>" option and the replaces
the deprecated "-B <BSP>" option with "-P <platform>".

Change-Id: I21ab863dded9cbfd4fc0ab2fcade59137add08cf
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:43 -05:00
Andrew Boie 6acbe63aea initial commit for next-gen sanity checks
The online help ./scripts/sanitycheck --help describes usage.
Most users will simply want to run with no arguments.

Change-Id: Icedbbfc22599a64a6e3dbbb808ff3276db06f2e0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:14:42 -05:00
Luiz Augusto von Dentz 4c2a459305 Bluetooth: Add gatt-write command to btshell
This adds gatt-read which works as follow:

gatt-write <bdaddr> <bdaddr_type> <handle> <data>
bt: bt_gatt_write (0x0010e0f0): handle 0x0011 length 1
Write pending
btshell> bt: bt_att_recv (0x001102ec): Received ATT code 0x13 len 1
bt: att_handle_write_rsp (0x001102ec):
bt: att_write_rsp (0x001102ec): err 0x00
Write complete: err 0

Change-Id: Ibe9f510184ad98635b18cc7d92dc3573afd9cb03
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:41 -05:00
Arkadiusz Lichwa 08230f691c Bluetooth: GATT: Update btshell app
Adds to btshell app a command to enable mimic GATT client to
perform multiple read attributes request using set of input handles.
The syntax is: gatt-read-multiple <address> <addres-type> <h1> <h2> ...
Handles should be entered as hex values and are 2-octets wide each.

Change-Id: Ic37a4486a11c645685cbfc782d36457af0fe9453
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:40 -05:00
Arkadiusz Lichwa e4208e065d Bluetooth: Increase max ARGC in btshell
Allows shell commands read more number of input parameters.
It is updated to 10 input parameters.

Change-Id: Ia943e8c6f0caaaf74cebcdb9dbe3542d90b2e4b9
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:40 -05:00
Johan Hedberg fe41cec885 Bluetooth: Move bt_security to conn.h and rename it appropriately
Change-Id: Ibea6e4ef08c68e9debf0c53036dd2e4f75ea9a72
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:40 -05:00
Johan Hedberg a33047f7a5 Bluetooth: Move bt_connect_le to conn.c and rename it appropriately
This function operates on bt_conn so it should be in conn.c and
exported through conn.h. Rename it with the appropriate bt_conn_*
prefix.

Change-Id: Id17c67f0e95cc1afb10aa7742b2d2ce0110ea616
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:40 -05:00
Johan Hedberg 824135122f Bluetooth: Move bt_disconnect to conn.[ch] and rename it appropriately
The bt_disconnect deals with the bt_conn object and should therefore
reside in conn.c and be exported through conn.h. It should also have
the appropriate bt_conn_* prefix.

Change-Id: I75eb648fd9aa8ced9a991d472c319d25f4b772af
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:40 -05:00
Luiz Augusto von Dentz 7ea33a436b Bluetooth: Add gatt-read command to btshell
This adds gatt-read which works as follow:

gatt-read <bdaddr> <bdaddr_type> <handle> [offset]
bt: bt_gatt_read (0x0010dca0): handle 0x0010
Read pending
btshell> bt: bt_att_recv (0x0010fe9c): Received ATT code 0x0b len 6
bt: att_handle_read_rsp (0x0010fe9c):
bt: att_read_rsp (0x0010fe9c): err 0x00
Read complete: err 0 length 5

Change-Id: I38686f0e592b38bf22a7bf76fab93676b375104d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:40 -05:00
Luiz Augusto von Dentz ebbe49b32e Bluetooth: Add gatt-discover-descriptor command to btshell
This adds gatt-discover-descriptor which works as follow:

btshell> gatt-discover-descriptor <bdaddr> <bdaddr_type> [UUID] [start_handle] [end_handle]
bt: bt_gatt_discover_descriptor (0x0010d6b0): start_handle 0x0011 end_handle 0x0011
Discover pending
btshell>bt: bt_att_recv (0x0010f8ac): Received ATT code 0x05 len 6
bt: att_handle_find_info_rsp (0x0010f8ac):
bt: att_find_info_rsp (0x0010f8ac): err 0x00
bt: att_find_info_rsp (0x0010f8ac): handle 0x0011
Discover found handle 17
Discover destroy

Change-Id: I6b95a3b9bfbbf57fb195f79db24216a1f8296079
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:40 -05:00
Mariusz Skamra 81895bd738 Bluetooth: shell: Extend shell app functionality to turn off adverising
Change-Id: I5beb5abac3ecc982a154fd062eb34b1d5ee170e9
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis 9d63adf3ea Renames supported platform configurations
Renames supported platform configurations to conform to new platform
configuration naming scheme.

Example usage with PLATFORM_CONFIG:
    make PLATFORM_CONFIG=basic_cortex_m3
    make PLATFORM_CONFIG=basic_atom
    make PLATFORM_CONFIG=basic_minuteia
    make PLATFORM_CONFIG=galileo

  xxx_ti_lm3s6965_defconfig           -> xxx_basic_cortex_m3_defconfig
  xxx_generic_pc_atom_n28xx_defconfig -> xxx_basic_atom_defconfig
  xxx_generic_pc_minuteia_defconfig   -> xxx_basic_minuteia_defconfig
  xxx_quark_defconfig                 -> xxx_galileo_defconfig

Change-Id: I696eb8b9ad9a72d7a72efbe1341ce23500335764
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:39 -05:00
Peter Mitsis 519351ee92 Use PLATFORM_CONFIG to specify configuration
Uses PLATFORM_CONFIG to specify the configuration file instead of
KBUILD_DEFCONFIG.  This name is more intuitive to Zephyr users and
it is not tied to kbuild.

Example usage:
    make PLATFORM_CONFIG=generic_pc_atom_n28xx
    make PLATFORM_CONFIG=generic_pc_minuteia
    make PLATFORM_CONFIG=quark
    make PLATFORM_CONFIG=ti_lm3s6965
    make PLATFORM_CONFIG=fsl_frdm_k64f

Change-Id: I177608942c3e77c2f152743c862aad1d460c0e33
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis 3b33a3b437 sample projects: change default KBUILD_DEFCONFIG
Changes default KBUILD_DEFCONFIG to xxx_generic_pc_atom_n28xx_defconfig as
the xxx_generic_pc_defconfig configuration will not be supported in the future.
Note that like generic_pc, atom_n28xx runs on QEMU.

Change-Id: I49c5708e4b24dbf723eefc1efddfea4174d9cb1c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Peter Mitsis bb2e5daacd Bluetooth sample projects no longer use BSP
Bluetooth sample projects now use KBUILD_DEFCONFIG instead of BSP.  This is
a necessary step in transitioning from BSPs to platforms.

Change-Id: I42c89d0b5c3d7de7ea62297950bb00f56ca97ed2
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:38 -05:00
Luiz Augusto von Dentz 710aa2ecc7 Bluetooth: Add gatt-discover-characteristic command to btshell
This adds gatt-discover-characteristic which works as follow:

btshell>gatt-discover-characteristic <bdaddr> <bdaddr_type> [UUID] [start_handle] [end_handle]
bt: bt_gatt_discover_characteristic (0x0010d098): start_handle 0x000b end_handle 0x0011
Discover pending
btshell>bt: bt_att_recv (0x0010f294): Received ATT code 0x09 len 23
bt: att_handle_read_type_rsp (0x0010f294):
bt: att_read_type_rsp (0x0010f294): err 0x00
bt: att_read_type_rsp (0x0010f294): handle 0x000b properties 0x02 value_handle 0x000c
Discover found handle 11
bt: att_read_type_rsp (0x0010f294): handle 0x000d properties 0x10 value_handle 0x000e
Discover found handle 13
bt: att_read_type_rsp (0x0010f294): handle 0x0010 properties 0x08 value_handle 0x0011
Discover found handle 16
Discover destroy

Change-Id: I04aad56cc4f978e3a884adffc487ae4dcc1c4ee9
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:36 -05:00
Szymon Janc d0aa85096c Bluetooth: Add simple advertise command to shell app
This allows to enable advertising with some fixed Advertising Data
and Scan Reponse.

Change-Id: Ie3a33a49fe8517c9e931b7805694bd9c7b05fcdb
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:35 -05:00
Johan Hedberg d7ccefd0bd Bluetooth: Fix doxygen comment style
Change-Id: I37b85e83b54f7efb8aded70ec95fd87cafaf7e2b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:35 -05:00
Luiz Augusto von Dentz a52d54cc3e Bluetooth: Add gatt-discover command to btshell
This adds gatt-discover which works as follow:

btshell> gatt-discover <bdaddr> <bdaddr_type> <uuid> [start_handle] [end_handle]
bt: bt_gatt_discover (0x0010cb10): uuid 0x180d start_handle 0x0001 end_handle 0xffff
Discover pending
btshell> bt: bt_att_recv (0x0010ed0c): Received ATT code 0x07 len 5
bt: att_handle_find_type_rsp (0x0010ed0c):
bt: att_find_type_rsp (0x0010ed0c): err 0x00
bt: att_find_type_rsp (0x0010ed0c): start_handle 0x000a end_handle 0x0011
Discover found handle 10
bt: bt_gatt_discover (0x0010ed0c): uuid 0x180d start_handle 0x0011 end_handle 0xffff
bt: bt_att_recv (0x0010ed0c): Received ATT code 0x01 len 5
bt: att_error_rsp (0x0010ed0c): request 0x06 handle 0x0011 error 0x0a
bt: att_find_type_rsp (0x0010ed0c): err 0x0a
Discover destroy

Change-Id: Ic0b28f19e4932e26b2eae2d19f62f6be6e1efa9c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:35 -05:00
Luiz Augusto von Dentz 81546cfc0a Bluetooth: Add gatt-exchange-mtu command to btshell
This adds gatt-exchange-mtu which works as follow:

btshell> gatt-exchange-mtu <bdaddr> <bdaddr_type>
bt: bt_gatt_exchange_mtu (0x0010c138): Client MTU 65
Exchange pending
btshell> bt: bt_att_recv (0x0010e310): Received ATT code 0x03 len 3
bt: att_mtu_rsp (0x0010e310): Server MTU 517
Exchange successful

Change-Id: I7280fb9d9fafc0f4bd1ef0f2226c255a5acf2592
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:34 -05:00
Szymon Janc e8eec7c3d4 Bluetooth: Allow to pass address type in braces in shell app
This makes it easier to use shell since one can copy full address
from console output. Both variants with and without braces are
accepted.

btshell> connect 7C:2F:80:94:97:39 (public)
Connection pending
btshell> Connected: 7C:2F:80:94:97:39 (public)
btshell> disconnect 7C:2F:80:94:97:39 public
btshell> Disconnected: 7C:2F:80:94:97:39 (public)

Change-Id: Ic10386ee054ade1900e5f010857c0f85e5cb364a
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:34 -05:00
Arkadiusz Lichwa b62f778664 Bluetooth: Start outgoing connection with tracking
Enables make outgoing connection with error handling.
Free connection objects maintained in polls are assigned to active
connection by result of lookup on the polls based on input
peer LE address.
Updates shell application to reflect above changes in stack.

Change-Id: Ibc71343c0d122cc78c48bac2ff1e50533369b7d2
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:31 -05:00
Mariusz Skamra 949106ceea Bluetooth: Notify about connection events in tester app
Notifications will be sent on connected/disconnected events.

Change-Id: Iaac6851a987a630ce41c5836de49dccc6ee5d385
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:31 -05:00
Mariusz Skamra ee20dd0a10 Bluetooth: Handle advertising in tester app
This patch adds support for enabling advertising on DUT. For now
setting custom advertising data or scan response is not supported.

Change-Id: I506d944565e524eb2103949df6cf003347d4c117
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:31 -05:00
Szymon Janc a14314e913 Bluetooth: Move security related code to bluetooth.h
Also rename bt_conn_security function to bt_security and
bt_conn_security_t to bt__security_t.

Change-Id: I543c7b97241c4389ef0eb491b6869f93105ae533
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:31 -05:00
Szymon Janc 10a2f86bef Bluetooth: Add security command to shell application
This allows to elevate security of a connection.

Change-Id: I492a92026c8db6feccffb96334be4557a5c73b48
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:31 -05:00
Luiz Augusto von Dentz 016f6e7d6a Bluetooth: Replace peer address with conn in GATT API
Now that bt_conn is public using it directly is much more convenient
and in some cases save a lookup by address.

Change-Id: Ia489948634984fe4f1a430da553f8a2a740fb531
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:30 -05:00
Szymon Janc fedfb7fa29 Bluetooth: Make cmd_scan_* parameters explicit void
Change-Id: I3b6fb2ecfb0a4572f3583991f2a94667442fd065
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:28 -05:00
Peter Mitsis 1ffabeaf3d Rename BSP_DIR to PLATFORM
Updates references to CONFIG_BSP_DIR to CONFIG_PLATFORM as part of the
BSP -> platform clean up.

Note that despite the renaming, the usage of the config option remains
unchanged.

Change-Id: I2846c3f761cf09871019c0855bf1824ae03e6b3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:27 -05:00
Szymon Janc a9e4291d4b Bluetooth: Use address instead of connection ID in shell
This converts connection handling to use addresses instead of
connection ID.

btshell> connect 7C:2F:80:94:96:EC public
btshell> Connected: 7C:2F:80:94:96:EC (public)
btshell> disconnect 7C:2F:80:94:96:EC public
btshell> Disconnected: 7C:2F:80:94:96:EC (public)

Change-Id: I545fcf71954ceda1fb89deb9bf8647149fb54e94
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:24 -05:00
Arkadiusz Lichwa b40b3363e4 Bluetooth: Enable basic interaction with LE scan
Adds new commands to shell app allowing turn on/off active LE scan.
App uses scan results callback to get feedback when found any
advertisers around.
The dummy app's callback prints out info about findings.

Change-Id: Ifffe77b804230c19bbbcbc4f38e47210c835106d
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:24 -05:00
Arkadiusz Lichwa d81689e915 Bluetooth: Introduce LE scan callback
Enables sending LE discovery results to user app.
Updates central apps to use new scan API.

Change-Id: Id319c96e15554f2eed4cf507cddd114ca74aa8e5
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:24 -05:00
Szymon Janc e41d9512ce Bluetooth: Update shell doxygen comments
Change-Id: I4888144700e692c9080e6695c6966ad99e59f911
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:24 -05:00
Szymon Janc e35a5294fc Bluetooth: Fix typo in shell application
Change-Id: Ib5a41d5a9cf02508c591d39f8a96e323701005bf
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:24 -05:00
Szymon Janc 0c421b038c Bluetooth: Make command handler in shell app return void
Return code from command handler is not needed and was already ignored.

Change-Id: Ief073ccfe2ccd316b6d4eec5168fb564e96786ee
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:24 -05:00
Szymon Janc c14b14953d Bluetooth: Use argc/argv for commands in shell application
This makes code looks similar to POSIX style parameter handling.
Also code is easier to read and doesn't require tricks like
'p += strlen(p) + 1' for next parameter.

Change-Id: I013e714ba81681da38e320fb69851c7b5a75bb52
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:24 -05:00
Mariusz Skamra 4ccef33723 Bluetooth: Add interactive connection and disconnection commands
Adds above commands to the shell app.
Connection is made based on given address and type eg:
btshell> connect 00:00:00:00:00:00 public

In callback we get local connection id which is in fact,
the number of array entry in which the pointer to the corresponding
bt_conn has been written.

To disconnect, just provide the id eg:
btshell> disconnect 0

Change-Id: I24f7ec2de7f84c53ab847ded28a1821753c2a60d
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:23 -05:00
Johan Hedberg 8c26ce63d1 Bluetooth: Remove bt_hci_reset() API
There's no clear need for this API (at least for now) and supporting
it means we really need to get all state cleanup procedures correct.
Remove it for now.

Change-Id: Ia2c7d51d410117bef12bc08f4f97a4e38ccfb77a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:23 -05:00
Johan Hedberg f56636e90b Bluetooth: Fix typo in shell sample app
Change-Id: I2b7453022046a4c5725c2c958f0f4e7b9b2c56b2
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:23 -05:00
Johan Hedberg 9bea2c3cfc Bluetooth: Move HCI driver API to dedicated header file
This makes it clearer that this is a specialized API not intended for
general app usage (unlike most other things in bluetooth.h).

Change-Id: I0ce1d5903610a9b3a99cf0be9f0e1462b04bf45a
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:23 -05:00
Luiz Augusto von Dentz 32eb9150f7 Bluetooth: Make Bluetooth UUID defines consistent
Always prefix UUIDS for characteristics with service name.

Change-Id: Ic435fa725e6bc8918af631632156b071121cd0e0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:23 -05:00
Szymon Janc 26be0d55f2 Bluetooth: Use ccflags-y instead of EXTRA_CFLAGS
According to section 3.7 of Documentation/kbuild/makefiles.txt, using
EXTRA_CFLAGS in Makefiles is "still supported but their usage is
deprecated."

Change-Id: I585a9f84e8239a59b0f5b29eed0dc70efa253522
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:23 -05:00
Johan Hedberg 224abaab0e Bluetooth: Update bt_conn_cb to pass bt_conn instead of bt_addr_le_t
Now that we have a publicly exposed connection object it makes sense
to pass that to the connection callbacks rather than an address.

Change-Id: I8e9b17733d1789539a83c3dbc7a778336d2b71ff
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:23 -05:00
Johan Hedberg 27a9a48f64 Bluetooth: Fix public Bluetooth includes
For consistency, when including public header files, use <> rather
than "".

Change-Id: Id780388759c33d865f49c9e0faf9cde2251ca869
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:23 -05:00
Johan Hedberg 2b61b44cbc Bluetooth: Add conn.h public header file
This one should be used for all public connection related APIs. Right
now it includes the reference counting and connection callback APIs.

Change-Id: Ib9b67e6115bb2e51322644757da1170851c3ca17
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:23 -05:00
Szymon Janc 089fb94d91 Bluetooth: Fix tester application build
This fix a build issue after last rename of TIMO -> ZEPHYR in build
system variables.

Change-Id: Iba9fb2ae13df0c66c7c1031b3a27795a9ead0e97
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:23 -05:00
Andrei Emeltchenko b6384dfb40 Bluetooth: Fix beacon app build for ARM targets
Change-Id: I28cb6691cac8612bd93256018830074b29689802
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:23 -05:00
Peter Mitsis 820a62dc7d sanity: Move Bluetooth regression script
Moves the Bluetooth regression script 'bt_regression.sh' so that it resides
in the same directory as the other sanity scripts.  It also renames it to
'bt_regression_chk' so that its name is consistent with the other sanity
scripts.

Change-Id: Ia5a683e2c370c91a90edc648634ce56e484dcc20
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:21 -05:00
Andrei Emeltchenko b85f2e8264 Bluetooth: Improve beacon sample documentation
The source is included to the manual and putting more comments helps
to understand the code.

Change-Id: Iefd6db2abf6070fd8c3fabdaf4946bdd7a045544
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:19 -05:00
Andrei Emeltchenko 4d73a264bc Bluetooth: Fixing beacon sample build
Fixes compile errors:
...
Makefile:36: /make/env/defs.base: No such file or directory
Makefile:47: /target/make.ukernel: No such file or directory
make: *** No rule to make target '/target/make.ukernel'.  Stop.
...

Change-Id: I693a939510b732ac810d5af756422c58e3f0c3ab
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:19 -05:00
Andrei Emeltchenko f627b881d4 Bluetooth: Update README in samples
Fix typo and reformat test to make it more logic and reflecting
doxygen documentation.

Change-Id: Id869f0131132c9287eab71d11ae40d194a20ca20
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:19 -05:00
Luiz Augusto von Dentz 5be2139435 Bluetooth: Add long attribute to peripheral sample
This is useful for testing prepare and execute writes as well as read
blob:

> ACL Data TX: Handle 42 flags 0x00 dlen 7
      ATT: Read Request (0x0a) len 2
        Handle: 0x0021
< ACL Data RX: Handle 42 flags 0x01 dlen 15
      ATT: Read Response (0x0b) len 64
        Value: 56656e646f7200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
< ACL Data TX: Handle 42 flags 0x00 dlen 9
      ATT: Read Blob Request (0x0c) len 4
        Handle: 0x0021
        Offset: 0x0040
> ACL Data RX: Handle 42 flags 0x02 dlen 15
      ATT: Read Blob Response (0x0d) len 10
        00 00 00 00 00 00 00 00 00 00                    ..........

Change-Id: If3da3097e3498e79e644b5721aaf63708fe6ab72
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:19 -05:00
Szymon Janc 985b411455 Bluetooth: Add tester application
This application is intended for automated testing. It used binary
protocol for communication over UART and can be used for driving
Bluetooth stack by external tester.

Currently only single command registering (init) GAP service is
implemented.

Change-Id: I62e151baa2badc0f1297e65591b5f494ff7b841e
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:19 -05:00
Andrei Emeltchenko 49390c988d Bluetooth: Update samples README
Change-Id: I90330676e9724526bc30a34e62635f912277602d
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:19 -05:00
Johan Hedberg 08ff927e1a Bluetooth: Fix vxmicro.h include
vxmicro.h has been renamed to zephyr.h

Change-Id: Id9dddeb1803b5148d052758b684111260fe6b9df
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:18 -05:00
Szymon Janc 5c6baa942c Bluetooth: Fix peripheral sample build for ARM
LD      microkernel.elf
samples/bluetooth/peripheral/src/built-in.o: In function
    `mainloop':
samples/bluetooth/peripheral/src/main.c:514: undefined reference
     to `sys_rand32_get'
collect2: error: ld returned 1 exit status

Change-Id: Idec91d59fd98ec06f5e5728238cf9d9f6c37eb87
Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
2016-02-05 20:14:18 -05:00
Andrei Emeltchenko 279f870bff Bluetooth: Add battery level simulation
Add battery level simulation decrementing from 100% by one every
second.

Change-Id: Ic6b819c32b42d65a044223f22e301835510823a4
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:18 -05:00
Andrei Emeltchenko 3dca06e700 Bluetooth: trivial: Make struct static
Change-Id: Ife8cc60bca8f5c00c5f47d3996c873a9c031feba
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:18 -05:00
Andrei Emeltchenko 960147d829 Bluetooth: Add Manufacturer Name String to DIS
Manufacturer Name String in DIS is a mandatory feature for Heart Rate
profile as specified by HEART RATE PROFILE Spec.

Change-Id: I552b51b68012edfc4389604e91dd43b8b54fe65f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:18 -05:00
Andrei Emeltchenko 2be30696a9 Bluetooth: Simulate Heart Rate Measurements
Add Heart Rate simulation using 1 second sleeping loop and this is how
it is recommended in the Heart Rate Service Spec.

Change-Id: I1023a4089bc661a399acf865f4fc7afaf72b8f0f
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:18 -05:00
Mariusz Skamra a44e4544bd Bluetooth: Use connection callbacks in peripheral sample app
This registers two simple callbacks for connection and
disconnection events.

Change-Id: I9e1f87d9e1a3c8ef457e15a1c30396fba7f7df4a
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
2016-02-05 20:14:18 -05:00
Andrei Emeltchenko aeb448ebba Bluetooth: Add Current Time Notification
Implement Current Time Notification triggered by write().

...
> ACL Data RX: Handle 74 flags 0x02 dlen 17                [hci0]
161704.397398
      ATT: Write Request (0x12) len 12
        Handle: 0x0014
          Data: df07071e0c2e01010000
< HCI Command: Host Number of Comp.. (0x03|0x0035) plen 5  [hci0]
161704.398861
        Num handles: 1
        Handle: 74
        Count: 1
< ACL Data TX: Handle 74 flags 0x00 dlen 5                 [hci0]
161704.398900
      ATT: Write Response (0x13) len 0
> HCI Event: Number of Completed Packets (0x13) plen 5     [hci0]
161704.533356
        Num handles: 1
        Handle: 74
        Count: 1
< ACL Data TX: Handle 74 flags 0x00 dlen 17                [hci0]
161705.189198
      ATT: Handle Value Notification (0x1b) len 12
        Handle: 0x0014
          Data: df07071e0c2e01010000
> HCI Event: Number of Completed Packets (0x13) plen 5     [hci0]
161705.275353
        Num handles: 1
        Handle: 74
        Count: 1
...

Change-Id: I504c4197a0a1d434f7704b76c8abd120eba51b7a
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:18 -05:00
Andrei Emeltchenko 4c2a6a6b14 Bluetooth: Remove quark target from regression test
After quark UART configuration was refactored it is not working
anymore. Since quark was never an officially supported target just
remove it from the regression tests.

Change-Id: If4bae99f5e0dfecfd3729ac0c42d7fd3d8affa0c
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:18 -05:00
Andrei Emeltchenko a79c26d9aa Bluetooth: Implement Current Time write
Implement Current Time write callback.

Change-Id: I2a6cb0b411c47e4d20ff34eadf8725bf23b0b7b9
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:18 -05:00
Arkadiusz Lichwa 0225b6b299 Bluetooth: Update simple LE scan app
Adjust app to build system.

Change-Id: I5366ea9b38b261762724006fef0ec61ed3c6e251
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:14:18 -05:00
Luiz Augusto von Dentz 693c40b34d Bluetooth: Add Vendor Service to peripheral sample
This add a vendor service which uses 128 bits UUID adding it to
advertising data:

< HCI Command: LE Set Advertising Data (0x08|0x0008) plen 32
        Length: 29
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        16-bit Service UUIDs (complete): 3 entries
          Heart Rate (0x180d)
          Battery Service (0x180f)
          Current Time Service (0x1805)
        128-bit Service UUIDs (complete): 1 entry
          12345678-1234-5678-1234-56789abcdef0

In addition to that it also adds 2 characteristics that test read/write
encryption and authentication permissions:

< ACL Data TX: Handle 3585 flags 0x00 dlen 9
      ATT: Error Response (0x01) len 4
        Read Request (0x0a)
        Handle: 0x001b
        Error: Insufficient Encryption (0x0f)

< ACL Data TX: Handle 3585 flags 0x00 dlen 9
      ATT: Error Response (0x01) len 4
        Write Request (0x12)
        Handle: 0x001b
        Error: Insufficient Encryption (0x0f)

< ACL Data TX: Handle 3585 flags 0x00 dlen 9
      ATT: Error Response (0x01) len 4
        Read Request (0x0a)
        Handle: 0x001d
        Error: Insufficient Authentication (0x05)

< ACL Data TX: Handle 3585 flags 0x00 dlen 9
      ATT: Error Response (0x01) len 4
        Write Request (0x12)
        Handle: 0x001d
        Error: Insufficient Authentication (0x05)

Change-Id: Id5d42c9f6afdc8625fc8019d606114632d57ae76
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:18 -05:00
Luiz Augusto von Dentz 8c66427b05 Bluetooth: Add permission field to GATT attributes
This field can be used to set the required permissions for an attribute
which can be checked by Bluetooth core before calling the callback.

Change-Id: Idcab8cdc5744358fab0b3c67b9c0503f1d1d9736
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:18 -05:00
Luiz Augusto von Dentz 0b6eea8345 Bluetooth: Add Device Information Service to peripheral sample
Add Device Information Service along with model characteristics and
descriptor to the database table.

Change-Id: I28775cf48abe76d0a841ebc92e1579e2d4cdfa09
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:18 -05:00
Luiz Augusto von Dentz 8508bfb2b1 Bluetooth: Make use of BT_GATT_CCC
This uses BT_GATT_CCC to declare CCC descriptors which makes the core
to managed the CCC configuration so the task don't have to do it.

Change-Id: Ied4fc7eaa1f9f3e6c23d4d5b20d5c26d606f93f4
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:17 -05:00
Luiz Augusto von Dentz c6ce7792a7 Bluetooth: Add Bluetooth remote address to attribute callbacks
To implement CCC properly it is required to know the remote address since
it is per client, futhermore bt_gatt_notify requires an address where to
send the notification.

Change-Id: I9d9fdf72d668831bed76e2aef06816af3620f4b8
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:17 -05:00
Luiz Augusto von Dentz d80a8fc845 Bluetooth: Add write support to CCC in peripheral sample
This adds write callback to CCC descriptors storing the value in a stack
variable.

Change-Id: I8cd2567c6fee730500b446192b73fc82d86ba1ff
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:17 -05:00
Andrei Emeltchenko 96f7d7bc42 Bluetooth: Add Current Time notify and CCC
Add Notify property and Current Characteristic Configuration to Current
Time Service in peripheral app.

Change-Id: I44f36eea4f129c7b407b045da892f2ba88338592
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:17 -05:00
Andrei Emeltchenko fae27b9587 Bluetooth: Add Current Time Service to peripheral app
Add Current Time Service currently providing hardcoded time since
there is no way of getting current time in the OS.

Change-Id: I9954d51f77905230a6dd180f37d3a48f379c69ec
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif b8823770d2 Rename TIMO -> ZEPHYR
Change-Id: Id44a129e275fb0cfe1fce6ec2a03c2d86ffe3995
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Allan Stephens 63c7d00584 Rename VXMICRO_BASE to TIMO_BASE
Updates references to this environment variable, which were missed
during previous renamings.

Change-Id: I1126271ce8b84d3eaedeab11198d3a3b645393af
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:16 -05:00
Allan Stephens 06f10df990 Eliminate references to VXMICRO_TOOL
Since the build system now supports only one toolchain, the
VXMICRO_TOOL environment variable is obsolete. The sanity
check scripts that reference this symbol are revised accordingly.

(Note: As a temporary measure, the main sanity check script
continues to accept the -T option; however, the option has no
effect.)

Change-Id: I383b128b9f5b07164abb7ddeb5a699d819a20316
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens 815c6406bc Rename VPF files to use MDEF file extension
The file extension indicates a "Microkernel DEFinitions" file,
and no longer reflects the obsolete VxMicro/Viper branding.

Change-Id: Ib95b271404a4a4737e851d603c371244fa609e4d
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens 57de8be493 Eliminate VxMicro branding in sample projects
Eliminates references to the obsolete OS name. In most cases the name
is simply removed, as it isn't necessary.

Change-Id: I3796f2aebe802f8c6045b7424a3e7aab4d5fb8e8
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Allan Stephens 5b291d3567 Eliminate VxMicro branding in main application include file
File is renamed to zephyr.h.

Change-Id: Ice7ab9318c525630572023614b5bed67ae0400c1
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:15 -05:00
Anas Nashif bbe84f8ae5 Use ccflags-y and asflags-y instead of EXTRA_CFLAGS
According to section 3.7 of Documentation/kbuild/makefiles.txt, using
EXTRA_CFLAGS in Makefiles is "still supported but their usage is
deprecated." However, using make EXTRA_CFLAGS="-DSOMETHING" results in
EXTRA_CFLAGS from Makefiles being overwritten, obviously breaking the
build.  This patch converts to them to the newer ccflags-y which also
fixes the problem.

Change-Id: I6309439599d4c9cc184f9ecd941bde841982ef07
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:14 -05:00
Peter Mitsis 63d6a95738 Apply __stack tag to sample project fiber stacks
Updates sample projects to ensure that fiber stacks are properly aligned by
using the __stack tag.

Change-Id: I4f92033571d65aa87b6d46da5d7cb6d92eadc27a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Allan Stephens cb2d18cc83 Eliminate secure string library routines
These routines are either unused, or are always used in manner
that does not require their added security checking.

Change-Id: I6f484924ebc3d395a20879445a2fcabebf6c5014
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:12 -05:00
Dan Kalowsky c02dd34277 Renaming include/nanokernel to include/arch
Renaming the directory include/nanokernel to be include/arch, which
better reflects the real nature of the directory and the contents
inside.

Change-Id: I2bc33ebc6715e2f0403227a558279fdf52398ade
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:14:12 -05:00
Juan Manuel Cruz dc5a457847 Kbuild: Changing build parameter CONF_OVERLAY to CONF_FILE
This commit changes the build parameter CONF_OVERLAY with the
name CONF_FILE.

Change-Id: I404a4aa87b167a9ca4e7b395d53c2f7794b232bc
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif 58cb972619 Kbuild: fix bluetooth samples
Change-Id: I2f720e71886d302a4ff9887b705c753b923ca8c1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif ebde8bf780 Kbuild: make new bluetooth sample build
Change-Id: I0664e7f96274e8dad8d66082ca7336a1f094ec47

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Anas Nashif abd4ed0b60 VXMICRO_BASE -> TIMO_BASE
Change-Id: I0861d831546ea4b27fb700c341b5c1055c57e24e

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:09 -05:00
Juan Manuel Cruz 5fbb5f6420 Kbuild: Adding bluetooth sanity checks.
This commit adds the Makefiles to add sanity checks for
the bluetooth driver.

Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
Change-Id: Iadfe6eb2662347a981393ffeb3e343f32c5f67f0
2016-02-05 20:14:08 -05:00
Luiz Augusto von Dentz 3ea2c48899 Bluetooth: Fix advertising data of peripheral sample
An extended inquiry response or advertising data packet shall not contain
more than one instance for each Service UUID data size.

Change-Id: I41d1a25fdcb2987e8d0cadfb2110fd62b3685f17
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:04 -05:00
Luiz Augusto von Dentz a8f34a1c1e Bluetooth: Add Battery Service to peripheral sample
Add Battery Service along with its characteristics and descriptors
to the database table.

Change-Id: Ifb83ebcb4d6cdafa5df84d643b2e2a69e5a6c1e3
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:04 -05:00
Luiz Augusto von Dentz 1b793139db Bluetooth: Add Heart Rate Service to peripheral sample
Add Heart Rate Service along with its characteristics and descriptors
to the database table.

Change-Id: Ibff52da7352883edccb7c5b903538a81aad2ba55
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:04 -05:00
Luiz Augusto von Dentz 0d505e2045 Bluetooth: Add GAP primary service to peripheral sample
This adds attributes for Generic Access Profile.

Change-Id: I1fe08429f80341e7ba9fc06ef35a6df9b5abbf84
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:04 -05:00
Luiz Augusto von Dentz 06383eae4f Bluetooth: Fix beacon scan data
Length of "Test beacon" is 11 + 1 of type that should be 12 not 16.
In addition to that make the data variable static since they are only
used locally.

Change-Id: I2d7fb16cf7d383dafc9b083da6cd63a4d9be21c0
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:03 -05:00
Johan Hedberg 06098aa73e Bluetooth: Remove CONFIG_BLUETOOTH_DEBUG_HCI_CORE from samples
There's no point in enabling BLUETOOTH_DEBUG_HCI_CORE for the samples
as the user/developer is unlikely to be interested in this specific
sub-module of the Bluetooth stack. The samples already have the
BLUETOOTH_DEBUG enabled, so leave it up to the user/developer to
decide if they want to add specific sub-module debug options.

Change-Id: I327086464561667a2462db0aab00d0ffcdd40d4c
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:03 -05:00
Andrei Emeltchenko 3933278948 Bluetooth: Add ARM configuration for shell app
Change-Id: Ifa5bd8c82e4accd3778b45d7bb1af71b058c77e7
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:02 -05:00
Andrei Emeltchenko 87139e5e87 Bluetooth: Add peripheral app quick test to bt_regression
Build peripheral app for targets: pentium4 and ti_lm3s6965

Change-Id: Id98c94217ad39e1716b8f8bc6031b8814bae06f3
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:02 -05:00
Andrei Emeltchenko b428ef6d65 Bluetooth: Add ARM configuration to peripheral app
Change-Id: I23428811de2d825c75a3938354b1079550ba3911
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:14:02 -05:00
Luiz Augusto von Dentz 18af2d839b Bluetooth: Make local variable static in peripheral sample
Change-Id: I6ce9a8ccab3461c8e7bbd15b2b129c01c5bdaa9e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:14:02 -05:00
Johan Hedberg a60a4aba2e Bluetooth: Fix includes for sample apps
Update the includes in the sample apps to match what their actual
dependencies are.

Change-Id: I6fdfa4ba0cda563433d51f0ec35fef8f2ee0fa40
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:14:02 -05:00
Yonattan Louise 63e3a4e772 Fix checkpatch issue - ERROR:ELSE_AFTER_BRACE
The 'else' statement should be in the same line that the
close brace of the 'if' statement. E.g.:

	if (condition) {
		do_this();
		do_that();
	} else {
		otherwise();
	}

This commit fixed this kind of error using the following script:

	#!/bin/bash

	for file in $(find ./ -name "*.[ch]" ! -path "./scripts/*" ! -path "./host/src/wrsconfig/*");
	do
		if [ ! -h $file ];
		then
			sed -i '/^[ \t]*}$/ {
	:review_next_one_too
	N
	s/^\(.*\)\n[ \t]*else/\1 else/
	/}$/ b review_next_one_too
	}' $file;

		fi;
	done

Change-Id: I7e811a572d735fa08e84850055ebbde29eb10e8d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Yonattan Louise dbada63eee Fix coding style issues.
Some checkpatch issues were solved by scripts leaving other problems
such as alignment and indentation issues.  In order to comply with the
defined coding style the following fixes were made:

- Fixed the function declaration moving the parameters' comments above
  the function in accordance to the doxygen format.
- Fixed functions' opening and closing brackets. These brackets should
  not be indented.
- Fixed the 'if', 'for' and 'while' statements adding the brackets
  around the sentence.
- Fixed comments' alignment.
- Fixed indentation.

The work was done manually and submitted as one commit. I didn't
separate these changes in different commits because they were fixed all
at once. Basically, all errors were fixed in every file at once.

Change-Id: Icc94a10bfd2cff82007ce60df23b2ccd4c30268d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Arkadiusz Lichwa f170898634 Bluetooth: Add simple LE scan app
Use scan functionality by simple app that starts LE scan
and in a while stops it.
It uses basic HCI scan interface prepared for
supporting LE central role feature.

Change-Id: Idcde4c742290d46931ab86522e51b0fc547a2d42
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
2016-02-05 20:13:58 -05:00
Andrei Emeltchenko 5fffe2f225 Bluetooth: Set default toolchain to gcc
Set the toolchain in case the user doesn't have it set in their
environment.

Change-Id: Ia961598bc125ded9326747cc8c5810635a8481d5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:58 -05:00
Andrei Emeltchenko a9cd5276ec Bluetooth: Enable HCI_CORE debug for samples
Enabling HCI_CORE debug helps to identify possible bugs.

Change-Id: I13df39d63ee9b15f83503d86edc71733c7db94d5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Andrei Emeltchenko fa2473d912 Bluetooth: Allow redefine QEMU_EXTRA_FLAGS
Allowing to redefine QEMU_EXTRA_FLAGS helps to overcome user channel
stuck cases, you still have the possibility to use bluetooth over tcp
by specifying QEMU_EXTRA_FLAGS="-serial tcp:...". Default behavior
remains the same though.

Change-Id: I3a8190a1ca04029e788bfd424f3b3a3be9f2af75
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Andrei Emeltchenko f8df842dd5 Bluetooth: Add compile test for nanokernel shell app
Bluetooth regression and system regression would run compile test
for shell app.

Change-Id: I029772483e7aa9ac0717db760d8de1f6be3371b5
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Andrei Emeltchenko e15102a206 Bluetooth: Add nanokernel configuration for shell app
Add support for nanokernel build for shell application.

Change-Id: Idf5f3673050c2ac4c941dc9164536fc487e9216b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Andrei Emeltchenko f3794dd657 Bluetooth: Update README with recent changes
Remove old way of starting qemu target and add extra information.

Change-Id: I37c378aa0eb873b3fc16362991eec8a6b661626b
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Andrei Emeltchenko 0f73da74c5 Bluetooth: Add Bluetooth shell sample application
Bluetooth shell sample application make use of serial console shell
and register Bluetooth commands to it. It shows example how console
shell might be used.

Change-Id: I98340422b90e85dc7a2c44823536121999a08952
Co-authored-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:57 -05:00
Luiz Augusto von Dentz 7f1119bb2e Bluetooth: Remove unnecessary PRJ_INCPATH
It is not necessary to add any PRJ_INCPATH in order to build Bluetooth
samples.

Change-Id: I3ddb0a645e475d937a7067059e8bf5caa783a04e
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:13:56 -05:00
Luiz Augusto von Dentz 8fc12c1600 Bluetooth: Add LE beacon sample app
Adds a sample which initializes Bluetooth and enables non-connectable
advertising (i.e. starts acting in the LE broadcaster role).

Change-Id: Ic554b1354464b357b44215af1c0b613f123aeb5d
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:13:56 -05:00
Andrei Emeltchenko 607819ec5e Bluetooth: Add bt_regression script based on scripts/regression
bt_regression scripts builds all listed projects for all
configurations mentioned in the PRJ_LIST. For targets specified with
"!" it executes test in qemu.

Change-Id: I971a797b2a89547bb14208d0d43d1a36597bad52
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:56 -05:00
Luiz Augusto von Dentz b3cdfed003 Bluetooth: Extend advertising API
Extend bt_start_advertising to make it possible to add any data type
instead of just the name.

Change-Id: I3f2afe1eb64aec51f321f7fd7439e97b3d67374c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:13:56 -05:00
Andrei Emeltchenko f269260b8d Bluetooth: Enable debug for Bluetooth samples and tests
Enable CONFIG_BLUETOOTH_DEBUG option for Bluetooth samples.

Change-Id: Id0d0377082b16f78f15c5e968c866bed2df69844
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko 97892857e9 Bluetooth: Add nanokernel sample init application
Add nanokernel configuration to build Bluetooth init sample. Later on
sample would added to sanity check builds.

Change-Id: Ib7251c1b3f5d62c4f1e0bb1fba253ebb1e9342df
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Andrei Emeltchenko 3760dc8709 Bluetooth: Add Bluetooth nanokernel smoke test
The test registers Bluetooth driver to the Bluetooth subsystem and
runs bt_init() which calls open() callback. We return expected error
to indicate that there is no real Bluetooth device attached.

Change-Id: I1b324c82ce8be2ce73f2b41a07135b0bc76eed61
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2016-02-05 20:13:50 -05:00
Johan Hedberg 5bba29f55a Bluetooth: Add LE peripheral sample app
This patch adds a simple app which initializes Bluetooth and enables
connectable advertising (i.e. starts acting in the LE peripheral
role).

Change-Id: I15bb43ce657b5592d32187a0dfd22ba8bd912641
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:49 -05:00
Johan Hedberg 7b6d006255 Bluetooth: Add Bluetooth init sample
This patch adds a very simple application for demonstrating the use of
the bt_init() API. Right now this is just tested to work with qemu and
the HCI UART driver with the help of the btproxy tool on the host OS
side. More information is available in the samples/bluetooth/README
file.

Change-Id: I03f92d158e9e5d57275241502bb8fa94350fc335
Co-authored-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-02-05 20:13:45 -05:00