Commit graph

619 commits

Author SHA1 Message Date
Andres Amaya Garcia
3fb32e167f Separate concept of minlen and len for BLE chars
In previous versions of BLE_API the GattCharacteristic initLen parameter is
named minLen as well. When the characteristic is committed to the SoftDevice
the value of initial length is also used as the minimum length of the
characteristic value. Furthermore, the test (max_length == min_length) is used
to determine whether the characteristic value has variable length. This is
slightly confusing and also causes problems if the user wishes to use a
characteristic with variable length but the initial lenght is equal to max
length.

To solve this problem the characteristic is now always committed to the
SoftDevice as variable. Furthermore, the API only maintains the current lenght
and the max length i.e. the field initialLen in the GattAttribute is removed.
In nRF5xGattServer all calls to getInitialLength() are removed and replaced
with getLength().

*NOTES:*
* This change requires updates to ble.
* Ideally we would like the characteristics to be declared as 'variable' only
when necessary, but this requires changing the signature of the
GattCharacteristic and GattAttribute constructors. Therefore, it will be part
of a separate pull request.
2015-11-27 17:25:58 +00:00
Rohit Grover
e19b28bc4e version v2.1.0 2015-11-27 10:57:41 +00:00
Rohit Grover
27c5043fcc Merge pull request #77 from LiyouZhou/update-to-sdk-8.1
Update to sdk 8.1
2015-11-27 10:52:18 +00:00
Rohit Grover
611d03b072 version v2.0.8 2015-11-26 14:56:33 +00:00
Andres Amaya Garcia
167ddd63ab Execute radio notification in low priority context
The ble-nrf51822 implementation of the BLE API executes callbacks for radio
notification events at very high priority. This functionality is replaced by
executing the radio notification callback at a lower priority. When using
mbed OS the callback is posted through minar. In mbed classic the callback is
executed directly, but from a lower priority. Note that minar or callback
execution in mbed classic could not be posted/generated directly from the
radio notification handler because this causes race conditions that may lead
to a hard-fault. Alternatively, a Timeout was used to post the callback in
another context with lower priority.
2015-11-26 10:56:17 +00:00
Liyou Zhou
3bcded72f9 Fix extra includes due to path change in the sdk update 2015-11-24 18:42:03 +00:00
Liyou Zhou
7d95b66f11 Rename due to importing mbed.h and requiring cpp libraries. 2015-11-24 18:41:19 +00:00
Liyou Zhou
a583502f2b Update files to nrf51 sdk 8.1.0 2015-11-24 15:01:15 +00:00
Liyou Zhou
af14327c85 Change folder structure to fit new sdk
Reverted some unnecessary changes.
2015-11-24 14:53:04 +00:00
Liyou Zhou
1e2bc135ac Change LICENSE description text wording. 2015-11-19 16:10:46 +00:00
Liyou Zhou
4058208d9e Specify nrf51-sdk dependency version. 2015-11-19 16:10:26 +00:00
Vincent Coubard
b795c29150 Terminate pending discoveries when a connection end.
Add accessor for ServiceDiscovery and CharacteristicDescriptorDiscover in
GattClient.

Remove friend relationship with bleGattcEventHandler
2015-11-19 08:31:43 +00:00
Liyou Zhou
3d3c80ad32 Remove a missed nordic source file. 2015-11-18 17:01:52 +00:00
Liyou Zhou
1c17def939 Update the LICENSE description text
To reflect the deletion of the nordic sdk license.
2015-11-18 16:34:20 +00:00
Liyou Zhou
e7cc595c9e Remove nordic license files as no nordic source files should remain
in this folder.
2015-11-18 15:59:31 +00:00
Liyou Zhou
72381cb826 Put back dependendcy on ble module
as ble-nrf51822 provides implementation for ble
2015-11-18 15:55:32 +00:00
Liyou Zhou
cf378d043b Remove nordic sdk files from this module, they are now in
nrf51-sdk git@github.com:ARMmbed/nrf51-sdk.git
2015-11-18 15:55:27 +00:00
Vincent Coubard
c778aa8aa3 Rename characteristic descriptors discovery activity and termination function 2015-11-18 15:53:34 +00:00
Rohit Grover
b37a42c347 version v2.0.7 2015-11-18 15:18:44 +00:00
Rohit Grover
8c491571ee Merge pull request #73 from LiyouZhou/extern_c
use Extern c around #include to use nordic sdk headers implemented in C
2015-11-18 15:16:51 +00:00
Liyou Zhou
dfb6ac292f Remove magic hash defines which are used in nrf51-sdk
nrf51-sdk files are modified to include these defines.
2015-11-18 14:25:10 +00:00
Liyou Zhou
348c323d27 Take modification out of the nordic sdk files
and put them into ARM written files.
2015-11-18 14:25:10 +00:00
Vincent Coubard
cc0cf3dfa7 Merge remote-tracking branch 'origin/develop' into characteristicDescriptorDiscovery 2015-11-18 12:50:22 +00:00
Vincent Coubard
8bd7bdfa88 Add ARM header into source/nRF5xGattClient.h.
Use const references for passing characteristic discovery callbacks
Fix a bug in btle_discovery.cpp, the discovered descriptors were captured
by value instead of reference.
2015-11-18 12:45:43 +00:00
Vincent Coubard
dc2dfb0a95 Add status parameter in terminateCharacteristicDiscovery function.
Fix terminate discovery (the replacement of the discovery was done after
the call to terminate).
When searching for a running discovery, dismiss results where the
characteristic is equal to the default characteristic value
Add Discovery::operator!=
Add support of DiscoveredCharacteristic last handle in the characteristic
discovery process
2015-11-17 14:20:17 +00:00
Rohit Grover
d95dc10b27 version v2.0.6 2015-11-17 13:32:58 +00:00
LIYOU ZHOU
c83d9e9cfe Merge pull request #67 from rgrover/develop
add Nordic's softdevice license agreement.
2015-11-17 13:29:42 +00:00
Rohit Grover
9cbf98cb82 add Nordic's license agreement.
@note: we need the softdevice in this module because it is shared with mbed-classic. This is where the mbed-classic toolchain expects to find the SD.
2015-11-17 12:54:35 +00:00
Vincent Coubard
cdd5b92193 Relaunch discovery operation when gatt event status is
BLE_GATT_STATUS_SUCCESS.
Report error in the Termination callback
2015-11-17 10:24:57 +00:00
Rohit Grover
a091922f10 version v2.0.5 2015-11-16 09:42:30 +00:00
Rohit Grover
7de2b7162f minor rewording of the comment introduced by the previous pull request 2015-11-16 09:41:27 +00:00
Rohit Grover
a80e037317 Merge pull request #65 from andresag01/develop
Post radio notification callback through minar
2015-11-16 09:12:06 +00:00
Vincent Coubard
e15d59a758 Add Characteristic Descriptor Discovery implementation 2015-11-13 14:53:46 +00:00
Andres Amaya Garcia
f8b3f1340f Post radio notification callback through minar
The ble-nrf51822 implementation of the BLE API generated callbacks for radio
notification events without using the minar scheduler and at very high
priority. This functionality is replaced by posting events through minar
when YOTTA_CFG_MBED_OS is defined. Note that minar could not be used directly
to post callbacks because radio notification events are handled at very high
priority, which caused a hard-fault when minar tries to enter a critical
section. Alternatively, a Timeout was used to post the callback in another
context with lower priority.
2015-11-13 14:51:36 +00:00
Rohit Grover
d2640b326e version v2.0.4 2015-11-13 11:03:53 +00:00
Rohit Grover
ba82462f19 Merge pull request #64 from andresag01/develop
Fix assembly sequence to start bootloader in GCC
2015-11-13 11:02:07 +00:00
Andres Amaya Garcia
c8cb3aeee3 Change assembly sequence to avoid changing APSR
Change assembly sequence that starts the Nordic bootloader to remove
MOV instruction before cheks of IPSR. The MOV might be translated into a ADDS
that could change the APSR and cause a wrong branch to be taken.
2015-11-13 10:36:02 +00:00
Andres Amaya Garcia
90f6c9714f Fix assembly sequence to start bootloader in GCC
The assemble sequence within an mbedOS application that starts the nordic
bootloader was being modified by the compiler. The result is that DFU enabled
applications could never start the bootloader correctly. This is because the
GCC compiler was translating a MOV instruction into a ADDS, which sets the
conditional flags in APSR before a conditional branch was executed. The result
of the incorrect branch caused the program to believe that it was in interrupt
mode when this was not the case.
2015-11-13 10:35:46 +00:00
Rohit Grover
1b42c27110 version v2.0.3 2015-11-09 09:01:01 +00:00
Rohit Grover
e71dc9504e Merge pull request #62 from marcuschangarm/watchdog
Added watchdog header file from Nordic SDK 8.1
2015-11-09 08:58:24 +00:00
Marcus Chang
55aef3bf24 Added watchdog header file from Nordic SDK 8.1 2015-11-07 12:27:34 +00:00
Rohit Grover
63dcf9fa44 version v2.0.2 2015-11-03 12:41:56 +00:00
Rohit Grover
6b763c8709 bring in the latest changes for BLE::init() where we allow <object, member> tuples for init callback. 2015-11-03 12:41:08 +00:00
Rohit Grover
95706f05ed Merge branch 'master' into develop 2015-11-02 17:32:27 +00:00
Rohit Grover
ba7ac12db5 version v2.0.1 2015-11-02 17:29:17 +00:00
Rohit Grover
e7cc192834 Merge pull request #58 from pan-/fix-initialization
Ensure that the initialization flags is set to false if the BLE stack is shutdown properly.
2015-11-02 17:21:55 +00:00
Vincent Coubard
f0d521f04c Ensure that the initialization flags is set to false if the BLE stack is
shutdown properly.
2015-11-02 17:04:47 +00:00
Rohit Grover
479bae5fcb Merge branch 'develop' 2015-11-02 08:58:14 +00:00
Rohit Grover
847c27cfe9 Version 2.0.0
=============

* Update init() to match the changes around initializationCompleteCallback.
  Also implemented hasInitialized().
  Refer to https://github.com/ARMmbed/ble/pull/91 and https://github.com/ARMmbed/ble/issues/90.

* Some changes for memory savings. Certain singletons are now allocated
  dynamically; so some memory may not be needed if the application exercises
  limited functionality. Also reduced the size of some global tables for
  memory savings; affected tables/constants: UUID_TABLE_MAX_ENTRIES (down to 4),
  DEVICE_MANAGER_MAX_BONDS (down to 2).
2015-10-30 14:32:12 +00:00
Rohit Grover
c5dc7e52a6 add init guards for some top level APIs 2015-10-30 10:27:18 +00:00