Skip to content

Improve CurieBLE library #284

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 3 commits into from
Closed

Conversation

biagiom
Copy link
Contributor

@biagiom biagiom commented Sep 7, 2016

  • Improve sketches that use Serial communication
  • Update keyword.txt file of CurieBLE library
  • Improve the BLEAttribute Class

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]>
- Add CurieBLE Datatype
- Add new methods : "end" and "setDeviceName"
- Remove inexistent methods :  "str", "data" and "length"
- Add two new constants from BLEcommon.h file header :
  "BLE_MAX_ATTR_DATA_LEN" and "BLE_DEVICE_NAME_DEFAULT_PREFIX"

Signed-off-by: Biagio Montaruli <[email protected]>
Improve BLEAttributeType enumeration, methods and data members
of BLEAttribute Class that use BLEAttributeType enum

Signed-off-by: Biagio Montaruli <[email protected]>
@sandeepmistry
Copy link
Contributor

We should be careful about adding while(!Serial) ; to the example sketches. As this forces people to open the serial monitor when using them. This also means the examples won't run when powering the 101 via a battery or USB wall charger.

The other changes look good to me though.

@biagiom
Copy link
Contributor Author

biagiom commented Sep 7, 2016

Hi @sandeepmistry,
thanks for your comments and I think you are right about to be careful when adding while(!Serial) ; since people have to open the Serial monitor to execute the next lines of code but I have added it since the sketches use the Serial communication and print some text in void setup(), but text could be lost if you don't add the line while(!Serial) ;.
I have also noticed that if you leave the Serial monitor open when uploading a new sketch to Arduino/Genuino 101 you can't use the Serial monitor during the upload procedure as well as some seconds after it, but in this way, you avoid the use of while(!Serial) ; since if you want to print some text with Serial.print() or Serial.println()in void setup() the text is not lost because when the Serial port is open the Serial monitor is already open. This prevent the loss of data send to the Serial monitor.
If you think that while(!Serial) ; is not a really thing to add, so I agree with you and the commits that add while(!Serial) ; could be skipped.
I hope to be clear.
Best regards and thank you very much for your contribution about the development of the great CurieBLE library (as well as Node and Bleno).

@eriknyquist
Copy link
Contributor

eriknyquist commented Sep 9, 2016

@calvinatintel a bunch of these pull requests now have b329d08 mixed in. Can you fix it?

@eriknyquist
Copy link
Contributor

@biagiom please resolve merge conflict. @SidLeung please review.

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.

4 participants