Skip to content

Improvements for CurieBLE library based on the master branch #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from

Conversation

biagiom
Copy link
Contributor

@biagiom biagiom commented Sep 18, 2016

The CurieBLE library has been updated in the master branch, so I have added some improvements to the new version of CurieBLE library resolving the merge conflict of #284 Pull Request
I suggest also to update the library version in library.properties file of CurieBLE library to 2.0 since a lot of improvements have been introduced.
With this pull request I have updated documentation of sketches and of some classes.
I also added while(!Serial) since all the sketches of CurieBLE library use Serial communication but I also added some comments to inform the user to open the Serial monitor since the linewhile(!Serial) waits for the Serial port to connect but it also waits for the user to open the Serial monitor in order to continue executing the sketch.
To be more clear I think we can also add a comment to inform the user to remove while(!Serial) { ; } if the user doesn't need to use the Serial Monitor

sgbihu and others added 15 commits August 31, 2016 09:18
-Add debug interface on Serial1
-Update BLE stack and need update BLE's FW
-Reconstruct the BLE peripheral base on V3
-Implement the BLE Central Role base on V3
-Implement some sketches for new BLE library
-Add central read/write example
-Add set advertising parameter interface
-Add API to allow set up advertising after setup
-Add interface to set the device name

File description
Porting from V3
 system/libarc32_arduino101/common/atomic.h
 system/libarc32_arduino101/common/misc/byteorder.h
 system/libarc32_arduino101/drivers/atomic_native.c
 system/libarc32_arduino101/drivers/bluetooth/att.h
 system/libarc32_arduino101/drivers/bluetooth/bluetooth.h
 system/libarc32_arduino101/drivers/bluetooth/conn.h
 system/libarc32_arduino101/drivers/bluetooth/conn_internal.h
 system/libarc32_arduino101/drivers/bluetooth/gatt.h
 system/libarc32_arduino101/drivers/bluetooth/hci.h
 system/libarc32_arduino101/drivers/bluetooth/uuid.h
 system/libarc32_arduino101/drivers/rpc/rpc.h
 system/libarc32_arduino101/drivers/rpc/rpc_deserialize.c
 system/libarc32_arduino101/drivers/rpc/rpc_functions_to_ble_core.h
 system/libarc32_arduino101/drivers/rpc/rpc_functions_to_quark.h
 system/libarc32_arduino101/drivers/rpc/rpc_serialize.c
 system/libarc32_arduino101/framework/include/util/misc.h
 system/libarc32_arduino101/framework/src/os/panic.c
 system/libarc32_arduino101/framework/src/services/ble/conn.c
 system/libarc32_arduino101/framework/src/services/ble/conn_internal.h
 system/libarc32_arduino101/framework/src/services/ble/dtm_tcmd.c
 system/libarc32_arduino101/framework/src/services/ble/gap.c
 system/libarc32_arduino101/framework/src/services/ble/gatt.c
 system/libarc32_arduino101/framework/src/services/ble/hci_core.h
 system/libarc32_arduino101/framework/src/services/ble/l2cap.c
 system/libarc32_arduino101/framework/src/services/ble/l2cap_internal.h
 system/libarc32_arduino101/framework/src/services/ble/smp.h
 system/libarc32_arduino101/framework/src/services/ble/smp_null.c
 system/libarc32_arduino101/framework/src/services/ble/uuid.c
 system/libarc32_arduino101/framework/src/services/ble_service/ble_service.c
 system/libarc32_arduino101/framework/src/services/ble_service/ble_service_api.c
 system/libarc32_arduino101/framework/src/services/ble_service/ble_service_int.h
 system/libarc32_arduino101/framework/src/services/ble_service/ble_service_internal.h
 system/libarc32_arduino101/framework/src/services/ble_service/ble_service_utils.c
 system/libarc32_arduino101/framework/src/services/ble_service/gap_internal.h
 system/libarc32_arduino101/framework/src/services/ble_service/gatt_internal.h
 system/libarc32_arduino101/framework/src/services/ble_service/nble_driver.c
1. Jira 541 Peripheral Start fails on X Number of Attributes
    -Change the interface and add return value

2. Fix BLE Peripheral is not advertising
    -Add a delay after register the profile.

3. Modify some comments based on code review

4. Jira 544 BLE peripheral disconnect and end functions
    -The state not aligned and make disconnect failed. Update when connect and disconnect event received

5. Delete the duplicated code that base class has implemented

6. Fix Jira 665 BLECentral Preview -- compile issue when instantiating BLE descriptor
    -Fix the build error.
    Note:
      i  . The current code only support one descriptor on characteristic.
      ii . The central discover logic need more twist.
      iii. Now is so long and can't process CCCD and another characteristic.
      iv . The library will support one other descriptor except CCCD.

7. Improve the discover logic and support another descriptor
    i.  Improve the discover logic
    ii. Support another the descriptor and CCCD at same time.

8. Modify the comments and delete the unused API

9. Fix Jira 670 A compile error occurs with two BLE methods with the same name
    i.  Add method uuid_cstr in BLEAttribute class.
    ii. Remove the duplicate file.

10. Fix Jira 672 BLE documentation in code needs to specify units
    i.   Change the scan and connection interval's unit to ms.
    ii.  Unify the advertising interval unit as millisecond
    iii. Delete some unused code.

11. Fix Jria 671 Support update connection interval in central/peripheral
     i. Central can update the connection interval.
     ii. Unify the interval unit to ms at user API.

12. Adjust the example comments and functions
     i.  Fix Jira 675 - BLE callbacks should use passed arguments instead of global variables
     ii. Adjust the code struture to align with Arduino's requirement

13. Fix Jira 680 LED and LED Central sketches need some work
     -Add a delay to make sure profile register process success.
     -The UART send too fast may makes the profile registration failed.

14. Fix Jira 673 BLE Api should pass arguments that are typedef

15. Fix Jira 671 Support update connection interval in central/peripheral
     i. Add peripheral update the connection interval feature.
     ii. Update the library.

16. Fix Jira  687 Edit the keyword.txt of CurieBLE to reflect Library changes

17. Make example function ready. But need to resolve Jira 675

18. Fix Jira 676 Review Edit Update BLE User Manual with China Flex

19. Fix Jira 685 BLE Peripheral sketches shall state which associated Central sketch to use

20. Fix Jira 588 - BLE Corrupted Long Write
     i. Modify the BLECharacteristic to implement the Long write feature.

21. Fix Jira 683 Typecasting and Pointers should be avoided in sketch
     i.   Add write in Characteristic template
     ii.  Add method in BLE Role class to avoid typecaste
     iii. Modify the advertise address parameter and related example sketches

22. Fix Jira 704 Type Characteristic should be documented
23. Fix Jira 684 Documentation about the central/peripheral
1. Fix Jira 664 demonstrates changing the ADV data
2. Fix Jira 671 Support update connection interval in central/peripheral
Checking only for > 10 here (rather than >= 10) means that numbers with a
leading '10' in the integral portion generate incorrect strings.
Since Arduino/Genuino 101 uses USB native port, wait for the Serial port
to open before executing the next lines of code to not lose serial data
already sent to the Serial monitor

Signed-off-by: Biagio Montaruli <[email protected]>
Since Arduino/Genuino 101 uses USB native port, wait for the Serial port
to open before executing the sketch to not lose serial data already sent
to the Serial monitor

Signed-off-by: Biagio Montaruli <[email protected]>
Improve documentation and code formatting of BLEAttribute, BLECharacteristic
and BLEProfile classes

Signed-off-by: Biagio Montaruli <[email protected]>
Add CurieBLE and new names of methods defined in some classes of
CurieBLE library

Signed-off-by: Biagio Montaruli <[email protected]>
- Formatting sketches of CurieBLE library with the Auto Format tool
  of Arduino IDE
- Improve documentation of some sketches
- Improve the use of USB virtual serial port :
  Arduino/Genuino 101 uses USB native port as Serial port, moreover
  the sketches of CurieBLE library use Serial communication and they send
  data to the Serial Monitor in the 'void setup()' function, so adding
  'while(!Serial)' waits for the Serial port to connect in order to
  not loose data already sent to the Serial Monitor.
  Added also documentation to inform the user to open the Serial Monitor
  to continue executing the sketch because 'while(!Serial)' also
  waits for the user to open the Serial Monitor

Signed-off-by: Biagio Montaruli <[email protected]>
@kitsunami kitsunami added this to the Castor milestone Sep 19, 2016
@calvinatintel calvinatintel force-pushed the master branch 3 times, most recently from 83c76a6 to 77d9086 Compare September 22, 2016 18:50
@calvinatintel
Copy link
Contributor

Hi @biagiom, I had to reset the master branch to a new point in order to do some major cleanup. Sorry for changing the history. Can you please rebase your change on top of the current master branch? Thank you!

@calvinatintel
Copy link
Contributor

Superseded by #298

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants