Commit graph

923 commits

Author SHA1 Message Date
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