Commit Graph

310 Commits

Author SHA1 Message Date
Michał Narajowski 9a5b7b334d porting: Add targets to generate syscfg.h and other artifacts
These targets can be used to generate syscfg.h and other
files that Newt generates on compilation and that are
required to compile ported Nimble. It makes it easier to
update syscfg.h, to track changes in these files
and to track dependencies of a target.
2019-11-20 14:46:09 +01:00
Michał Narajowski 4b67107e5c porting: Update modlog.h file to use IGNORE macro
This macro is used in official modlog package so since
we want to use logcfg in porting, we can also use IGNORE macro.
2019-11-20 14:46:09 +01:00
Michał Narajowski c2e2fdb110 porting: Add log_common files; modlog relies on them 2019-11-20 14:46:09 +01:00
Michał Narajowski f95f399a0a porting/examples/linux_blemesh: Allow specifying custom HCI 2019-11-20 14:46:09 +01:00
Hauke Petersen bcf09622cb npl/riot/syscfg: fix BLE_LL_CONN_INIT_MAX_TX_BYTES
Currently, the default value of BLE_LL_CONN_INIT_MAX_TX_BYTES is
set to 27, preventing the LL data length extension to work
properly in RIOT (TX octets always set to 27). With this fix the
controller is applying the desired TX octets values as defined by
BLE_LL_MAX_PKT_SIZE.
2019-11-19 09:45:17 +01:00
Michał Narajowski 19d7ebf9ee nimble/ll: Replace BLE_NUM_COMP_PKT_RATE with an interval in ms
Using an OS specific define in MYNEWT_VAL can be cumbersome
when porting to other systems. Replace this value with
universal interval in milliseconds.
2019-11-14 09:21:32 +01:00
wes3 cbaa21160d Merge pull request #630 from wes3/l2_rxcap_pack_chains
nimble/host: Use os_mbuf_pack_chains
2019-11-05 14:53:51 -08:00
Will San Filippo ec8ebe6fd2 porting/nimble: os_mbuf_pack_chains
Adding the os_mbuf_pack_chains API from mynewt-core.
2019-11-05 11:03:40 -08:00
Łukasz Rymanowski cdbcfc4ce7 porting/endian: Add le24 and be24 helpers
Sync with apache-mynewt-core

Those are useful for some BLE and Mesh PDU handling (and probably more).
Instead of user defining own function it should be beneficial to have
common implementation.

Not that this is useful only for flat buffers so only put and get
helpers.
2019-10-30 11:38:51 +01:00
Szymon Janc b0aef82b37 nimble: Add initial support for Core Spec 5.1
This only adds required defines for new HCI commands and events.
Option for selecting supported core version is also added.
2019-10-15 08:46:17 +02:00
Szymon Janc decca8488c porting: Assert when setting data for queued event
Setting data when event is already queued always indicates bug in code.
2019-10-08 10:08:07 +02:00
Andrzej Kaczmarek fb7651b773 nimble/ll: Add support for custom DTM extensions
This allows to enable custom extensions for DTM which currently allow to
override interval between test packets and number of packets to be
transmitted. See description of new syscfg setting for details.

This is not enabled by default since it extends HCI command defined by
Core specification so we need to be compliant by default. However even
if extensions are enabled, NimBLE still accepts HCI command as defined
in Core specification but also accepts extended one.
2019-10-01 11:21:39 +02:00
Szymon Janc e6d9db0114 porting: Add missing include in linux example
main.c: In function ‘main’:
main.c:65:33: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration]
   65 |         ble_hci_sock_set_device(atoi(argv[1]));
      |                                 ^~~~
2019-09-11 09:53:42 +02:00
Szymon Janc a069ebb3f3 porting: Remove BLE_NPL_WAIT_FOREVER from NPL API
There is already BLE_NPL_TIME_FOREVER which should be used instead.
Also due to int promotion using BLE_NPL_WAIT_FOREVER was causing
subtle issues on 64bit asrchitectures when used.
2019-09-11 09:53:42 +02:00
Szymon Janc 03f4b3f903 porting: Improve linux sample
Allow to specify HCI device at start.
2019-09-10 13:15:47 +02:00
Szymon Janc 92743bb80f porting: Fix linux port example
Linux port sample is using legacy advertising API which is disabled
if Extended Advertising is enabled. For testing complete linux build we
should have separate linux_dummy sample which doesn't call any APIs for
simplicity.
2019-09-10 13:15:47 +02:00
Szymon Janc 80160ccdbe porting: Enable periodic advertising on linux port
Make sure that linux port is build with all features enabled.
2019-09-06 14:09:26 +02:00
Łukasz Rymanowski 5fb380d250 nimble/porting: Add util.h
This might be useful for portings.
2019-08-29 20:30:46 +02:00
Hardik Senjaliya 2a675a243d nimble/mesh: using correct define name 2019-08-22 16:37:04 +02:00
Hardik Senjaliya f140f1c993 nimble/mesh: configurable segment retransmist attempts 2019-08-22 16:37:04 +02:00
Anton Maklakov aa87f447d0 fix -Wstrict-prototypes issues 2019-08-01 09:54:58 -07:00
Hauke Petersen 997dad8c9f npl/riot: disable LL privacy and encryption
The RIOT port aims to provide a very slim default
configuration with only some basic features enabled.
The link layer privacy and encryption featues can be
re-enabled through the RIOT build-system, this allows
a simpler integration with low-resource platforms.
2019-08-01 12:59:20 +02:00
Hauke Petersen b1ec1d1f3f npl/riot: disable LL data length ext per default 2019-08-01 12:58:57 +02:00
Hauke Petersen a73dc45a68 npl/riot: reduce default msys bufsize to minimum 2019-08-01 12:58:57 +02:00
Łukasz Rymanowski f3f06a8d6f nimble/ble_hs_stop: Change hs stop procedure
This patch change a way of handling stop procedure. Before, host was
disconnecting one by one all the active connections. This could result
in long procedure time when some devices came out of range and host was
waiting as long as supervision timout takes.

Now, host is sending in the raw Disconnect Command to all the active
connections and then start graceful disconnect timeout 2s.
Host notifies that is stop when
a) all the disconnection complete events arrived within 2s
b) disconnect timeout fires
2019-07-19 13:54:58 +02:00
Szymon Janc 60b92eb0b2 porting: Fix some oddities in linux examples 2019-06-17 13:17:07 +02:00
Szymon Janc ae020dace0 Use common config option for periodic syncs count
This avoids accidental inconsistency in combined build.
2019-06-17 09:50:49 +02:00
Andrzej Kaczmarek d6dfb6ceb0 nimble/ll: Add GPIOs for HCI debugging
This adds two new settings which allows to use two GPIO pins to indicate
when command is received or event sent by controller. This can be useful
for debugging, e.g. to check synchronization between HCI and air
activity.
2019-06-14 09:02:13 +09:00
Hauke Petersen 4e7e914da9 npl/riot: allow for timeout in ble_npl_eventq_get() 2019-05-29 12:13:18 +02:00
Hauke Petersen 16a3c5e574 npl/riot: add ble_npl_time_delay() 2019-05-29 12:13:18 +02:00
Hauke Petersen 4c3c91bbb3 npl/riot: add missing callout functions 2019-05-29 12:13:18 +02:00
Hauke Petersen 32ccc39fe3 npl/riot: added mesh config to syscfg.h 2019-05-29 12:13:18 +02:00
Szymon Janc c712e7d551 porting: Remove extra file from Makefile.defs
By default all files are build and this list should be used only
for exluding.
2019-04-24 10:05:25 +02:00
Ahmed Shokry 67844daa24 nimble/host: Add initial periodic adverting host support
This patch adds the implementation for periodic advertising
nd discovery, which is available when BLE_PERIODIC_ADV is enabled
2019-04-09 10:19:11 +02:00
Szymon Janc b8c2f9ab58 Fix license headers 2019-03-26 21:26:26 +01:00
Łukasz Rymanowski 286ae23d4e nimble/l2cap: Rename MYNEWT_VAL flag for L2CAP MPS
According to Bluetooth specification 5.0 Vol 3. Part A 4.23, in the
context of CoC this value is used to configure MPS and not MTU.
2019-03-25 22:40:32 +01:00
Hauke Petersen a7b3c93914 npl/riot: fix ble_npl_hw_is_in_critical() 2019-03-15 23:50:45 +01:00
Hauke Petersen afc2741413 porting/hal_timer: use OS_[ENTER/EXIT]_CRITICAL() 2019-03-15 22:26:07 +01:00
Hauke Petersen 28760d18dc npl/riot: init event queues detached and claim later 2019-03-08 01:17:11 +01:00
Andrzej Kaczmarek 96d14d1d0a nimble: Replace BLE_DEVICE usage with BLE_CONTROLLER 2019-03-07 23:47:37 +01:00
Christopher Collins 70e1d20d21 Remove implicit enum conversions for clang
gcc allows implicit conversion between enum type (even when `-Wall` is
specified).  clang does not allow such conversions with `-Wall`.  It
reports warnings like this one:

    error: implicit conversion from enumeration type 'os_error_t' (aka 'enum os_error') to different enumeration type 'ble_npl_error_t' (aka 'enum ble_npl_error')

This commit makes these conversions explicit via casts.  This allows the
unit test code to be built with clang using Mynewt's default build
flags.
2019-03-04 14:58:23 -08:00
Andrzej Kaczmarek a39b15bf4b porting: Fix build error
'OS_ASSERT_CRITICAL();' won't build if assert is defined as 'if () {}'.
2019-03-01 12:10:48 +01:00
Andrzej Kaczmarek 3ac89668f8 porting: Add missing include
We use assert in macro so good to have prototype included.
2019-03-01 12:10:48 +01:00
Andrzej Kaczmarek 275ffae3a9 porting: Fix redundant conditions
Both "blocks" and "block_size" are unsigned so they cannot be <0...
2019-02-26 15:12:32 +01:00
Andrzej Kaczmarek b0cd897917 porting: Add missing include 2019-02-26 15:12:32 +01:00
Szymon Janc 3e426ad804 porting: Fix typos in controller makefile 2019-02-26 12:22:36 +01:00
Szymon Janc 41919a821e Remove exec permission from source files 2019-02-25 14:56:48 +01:00
Szymon Janc ecf352bca9 porting: Use wildcards in Makefiles
This makes port build similar to when using newt tool which always
builds all files in src/ folder.
2019-02-25 14:56:48 +01:00
Andrzej Kaczmarek 92ab01ca9b porting: Add NPL equivalent for OS_ASSERT_CRITICAL 2019-02-25 11:21:44 +01:00
Michał Narajowski 8ae6aff907 porting/examples: Fix Makefiles 2019-02-25 11:21:44 +01:00