You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ad...@apache.org on 2016/05/10 23:27:22 UTC
[1/3] incubator-mynewt-site git commit: BLE iBeacon tutorial.
Repository: incubator-mynewt-site
Updated Branches:
refs/heads/master 9e60eccda -> 1c05897a8
BLE iBeacon tutorial.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/09a2d3d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/09a2d3d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/09a2d3d0
Branch: refs/heads/master
Commit: 09a2d3d01fb52d094eaf10c4b350d5425086a5e4
Parents: 93e3c38
Author: Christopher Collins <cc...@apache.org>
Authored: Mon May 2 17:39:50 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon May 2 17:39:50 2016 -0700
----------------------------------------------------------------------
docs/os/tutorials/ibeacon.md | 107 ++++++++++++++++++++++++++++++++++++++
mkdocs.yml | 1 +
2 files changed, 108 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/09a2d3d0/docs/os/tutorials/ibeacon.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/ibeacon.md b/docs/os/tutorials/ibeacon.md
new file mode 100644
index 0000000..b5b62ac
--- /dev/null
+++ b/docs/os/tutorials/ibeacon.md
@@ -0,0 +1,107 @@
+## BLE iBeacon
+
+### iBeacon Protocol
+
+A beaconing device announces its presence to the world by broadcasting
+advertisements. The iBeacon protocol is built on top of the standard BLE
+advertisement specification. An iBeacon advertisement contains a single field:
+*Manufacturer Specific Data*; this field contains the iBeacon-specific
+sub-fields. [This page](http://www.warski.org/blog/2014/01/how-ibeacons-work/)
+provides a good summary of the iBeacon sub-fields.
+
+### Configuration
+
+Use the following function to configure your NimBLE device to send iBeacons:
+
+```c
+int
+ble_ibeacon_set_adv_data(void *uuid128, uint16_t major, uint16_t minor)
+```
+
+This function's parameters are documented below.
+
+| *Parameter* | *Purpose* |
+| ----------- | --------- |
+| UUID | 128-bit UUID identifying the application |
+| Major version number | First number in your app's version |
+| Minor version number | Second number in your app's version |
+
+### Modify bleprph
+
+To demonstrate how the above function is used, we will now modify the *bleprph*
+example application to send iBeacons. For some background behind the *bleprph*
+app, we recommend you take a look at the [bleprph project
+tutorial](bleprph/bleprph_intro/). If you plan on making these modifications
+yourself, it might be a good idea to copy *bleprph* to your local repository
+and work with the copy. In general, you should avoid changing a package that
+newt downloads, as you will lose your changes the next time you upgrade the
+package.
+
+*bleprph* sets its advertisement data and begins advertising as follows (*main.c*):
+
+```c
+static void
+bleprph_advertise(void)
+{
+ struct ble_hs_adv_fields fields;
+ int rc;
+
+ /* Set the advertisement data included in our advertisements. */
+ memset(&fields, 0, sizeof fields);
+ fields.name = (uint8_t *)bleprph_device_name;
+ fields.name_len = strlen(bleprph_device_name);
+ fields.name_is_complete = 1;
+ rc = ble_gap_adv_set_fields(&fields);
+ if (rc != 0) {
+ BLEPRPH_LOG(ERROR, "error setting advertisement data; rc=%d\n", rc);
+ return;
+ }
+
+ /* Begin advertising. */
+ rc = ble_gap_adv_start(BLE_GAP_DISC_MODE_GEN, BLE_GAP_CONN_MODE_UND,
+ NULL, 0, NULL, bleprph_on_connect, NULL);
+ if (rc != 0) {
+ BLEPRPH_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+ return;
+ }
+}
+```
+
+The call to `ble_gap_adv_set_fields()` configures the device with normal
+(non-iBeacon) advertisements; the call to `ble_gap_adv_start()` tells the
+NimBLE stack to start broadcasting. We are now going to create an iBeacon app
+by making the following to changes:
+
+* Call `ble_ibeacon_set_adv_data()` instead of `ble_gap_adv_set_fields()`.
+* Modify the call to `ble_gap_adv_start()` such that the device is non-discoverable and non-connectable.
+
+```c hl_lines="4 7 8 10 11 19"
+static void
+bleprph_advertise(void)
+{
+ uint8_t uuid128[16];
+ int rc;
+
+ /* Arbitrarily et the UUID to a string of 0x11 bytes. */
+ memset(uuid128, 0x11, sizeof uuid128);
+
+ /* Major version=2; minor version=10. */
+ rc = ble_ibeacon_set_adv_data(uuid128, 2, 10);
+ if (rc != 0) {
+ BLEPRPH_LOG(ERROR, "error setting iBeacon advertisement data; rc=%d\n",
+ rc);
+ return;
+ }
+
+ /* Begin advertising. */
+ rc = ble_gap_adv_start(BLE_GAP_DISC_MODE_NON, BLE_GAP_CONN_MODE_NON,
+ NULL, 0, NULL, bleprph_on_connect, NULL);
+ if (rc != 0) {
+ BLEPRPH_LOG(ERROR, "error enabling advertisement; rc=%d\n", rc);
+ return;
+ }
+}
+```
+
+Now when you run this app on your board, you should be able to see it with all
+your iBeacon-aware devices.
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/09a2d3d0/mkdocs.yml
----------------------------------------------------------------------
diff --git a/mkdocs.yml b/mkdocs.yml
index 91fbd67..0a1536f 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -36,6 +36,7 @@ pages:
- 'Write a Test Suite for a Package': 'os/tutorials/unit_test.md'
- 'Air-quality Sensor project': 'os/tutorials/air_quality_sensor.md'
- 'Add task to manage multiple events': 'os/tutorials/event_queue.md'
+ - 'BLE iBeacon': 'os/tutorials/ibeacon.md'
- OS User Guide:
- toc: 'os/os_user_guide.md'
- OS Core:
[2/3] incubator-mynewt-site git commit: added an ibeacon tutorial.
This closes #80
Posted by ad...@apache.org.
added an ibeacon tutorial. This closes #80
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/ac9519be
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/ac9519be
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/ac9519be
Branch: refs/heads/master
Commit: ac9519bee15a35284c6d81c57c03393b69de01f9
Parents: 9e60ecc 09a2d3d
Author: aditihilbert <ad...@runtime.io>
Authored: Tue May 10 15:25:20 2016 -0700
Committer: aditihilbert <ad...@runtime.io>
Committed: Tue May 10 15:25:20 2016 -0700
----------------------------------------------------------------------
docs/os/tutorials/ibeacon.md | 107 ++++++++++++++++++++++++++++++++++++++
mkdocs.yml | 1 +
2 files changed, 108 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/ac9519be/mkdocs.yml
----------------------------------------------------------------------
diff --cc mkdocs.yml
index d472a1a,0a1536f..ff7af69
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@@ -36,12 -36,7 +36,13 @@@ pages
- 'Write a Test Suite for a Package': 'os/tutorials/unit_test.md'
- 'Air-quality Sensor project': 'os/tutorials/air_quality_sensor.md'
- 'Add task to manage multiple events': 'os/tutorials/event_queue.md'
+ - 'BLE peripheral project':
+ - toc: 'os/tutorials/bleprph/bleprph-intro.md'
+ - 'Service Registration': 'os/tutorials/bleprph/bleprph-svc-reg.md'
+ - 'Characteristic Access': 'os/tutorials/bleprph/bleprph-chr-access.md'
+ - 'Advertising': 'os/tutorials/bleprph/bleprph-adv.md'
+ - 'Connection Callbacks': 'os/tutorials/bleprph/bleprph-conn.md'
+ - 'BLE iBeacon': 'os/tutorials/ibeacon.md'
- OS User Guide:
- toc: 'os/os_user_guide.md'
- OS Core:
[3/3] incubator-mynewt-site git commit: Added changes to About page
to reflect recent release and longer roadmap
Posted by ad...@apache.org.
Added changes to About page to reflect recent release and longer roadmap
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/commit/1c05897a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/1c05897a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/1c05897a
Branch: refs/heads/master
Commit: 1c05897a858a0ec0929a832e4ef4922f1bf811d8
Parents: ac9519b
Author: aditihilbert <ad...@runtime.io>
Authored: Tue May 10 16:27:06 2016 -0700
Committer: aditihilbert <ad...@runtime.io>
Committed: Tue May 10 16:27:06 2016 -0700
----------------------------------------------------------------------
custom-theme/about.html | 2 +-
docs/about.md | 32 +++++++++++++++++++++-----------
docs/os/tutorials/ibeacon.md | 8 ++++++++
3 files changed, 30 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/1c05897a/custom-theme/about.html
----------------------------------------------------------------------
diff --git a/custom-theme/about.html b/custom-theme/about.html
index 768517a..86ae4ba 100644
--- a/custom-theme/about.html
+++ b/custom-theme/about.html
@@ -6,7 +6,7 @@
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
- <h3>Latest News: The second beta release of Apache Mynewt is available now. </h3>
+ <h3>Latest News: Beta release version 0.8.0 of Apache Mynewt is available now. </h3>
<p>For more news about Apache Mynewt see below.</p>
</div>
</div>
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/1c05897a/docs/about.md
----------------------------------------------------------------------
diff --git a/docs/about.md b/docs/about.md
index dfa377a..bbeda7b 100644
--- a/docs/about.md
+++ b/docs/about.md
@@ -18,41 +18,51 @@ Apache Mynewt's open-source embedded software is designed with the following com
* Security Manager Protocol
* LE Secure Connections
+<br>
+
+#Latest Release
+
+The latest release is [Version 0.8.0](http://www.apache.org/dyn/closer.lua/incubator/mynewt/apache-mynewt-0.8.0-incubating) for which Release Notes are available [here](https://cwiki.apache.org/confluence/display/MYNEWT/RN-0.8.0-incubating).
+
+For details on download and previous releases, check out [Download](https://mynewt.apache.org/download/).
+
+<br>
+
#Roadmap
Release Version | Descriptor | Date |Features
------------ | ------------- |------|-------
-0.8.0 | pre-GA release #1 | late-April, 2016 | * HAL extensions in OS
- | | | * Arduino DUE support
- | | | * Image verification
- | | | * Stats and logs enhancement
- | | | * HAL additions: ADC, DAC, I2C, PWM, SPI
- | | | * BLE 4.2: LE legacy pairing, no bonding
- | | | * BLE 4.2: Code size optimization
-0.9.0 | pre-GA release #2 | May, 2016 | * Support images in external flash
- | | | * HAL for Nordic nRF52
+0.9.0 | pre-GA release | May, 2016 | * Support images in external flash
+ | | | * HAL for Nordic nRF52, STMicro
| | | * Support for low power modes in multiple SoCs
| | | * BLE 4.2: LE Secure Connections Pairing, including bonding
| | | * BLE 4.2: Host and Controller separation
| | | * BLE 4.2: Random private resolvable addresses
-0.10.0| pre-GA release #3 | June, 2016 | * Test coverage improvements
+0.10.0| pre-GA release | June, 2016 | * Test coverage improvements
| | | * System watchdog
| | | * Support for additional Arduino boards
| | | * BLE 4.2: Remote configuration, upgrade, factory reset over BLE 4.2
| | | * BLE 4.2: Factory reset
| | | * BLE 4.2: GATT based BLE profiles for Mynewt
| | | * BLE 4.2: Configurability improvements
-
+0.11.0|pre-GA release | July, 2016 | * Wi-Fi support
+ | | | * Add second scripting module
+ | | | * C++ friendly external header files
+
<font color="#F2853F"> The detailed roadmap is tracked on [JIRA for Mynewt](https://issues.apache.org/jira/browse/MYNEWT/?selectedTab=com.atlassian.jira.jira-projects-plugin:roadmap-panel). </font>
+<br>
+
#Feature Request
The WISHLIST at the top of the roadmap on [JIRA for Mynewt](https://issues.apache.org/jira/browse/MYNEWT/?selectedTab=com.atlassian.jira.jira-projects-plugin:roadmap-panel) features all the new ideas awaiting discussion and review. Once the community decides to go ahead with a request, it is scheduled into a release. Generally, effort is made to schedule a requested feature into a particular version no later than 6 weeks prior to the planned release date.
If you have suggestions for a new feature, use case, or implementation improvements, file a JIRA ticket with Issue Type set to "Wish". Introduce it in the [dev@](dev@mynewt.incubator.apache.org) mailing list with a link to the JIRA ticket. This assumes you have signed up for an account on JIRA and submitted a request to the dev@ mailing list for your JIRA username to be added to the Apache Mynewt (MYNEWT) project.
+<br>
+
#FAQ
<font color="#F2853F"> Questions? </font> Click [here](faq/answers.md)
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/1c05897a/docs/os/tutorials/ibeacon.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/ibeacon.md b/docs/os/tutorials/ibeacon.md
index b5b62ac..1ff7a39 100644
--- a/docs/os/tutorials/ibeacon.md
+++ b/docs/os/tutorials/ibeacon.md
@@ -1,5 +1,7 @@
## BLE iBeacon
+<br>
+
### iBeacon Protocol
A beaconing device announces its presence to the world by broadcasting
@@ -9,6 +11,8 @@ advertisement specification. An iBeacon advertisement contains a single field:
sub-fields. [This page](http://www.warski.org/blog/2014/01/how-ibeacons-work/)
provides a good summary of the iBeacon sub-fields.
+<br>
+
### Configuration
Use the following function to configure your NimBLE device to send iBeacons:
@@ -26,6 +30,8 @@ This function's parameters are documented below.
| Major version number | First number in your app's version |
| Minor version number | Second number in your app's version |
+<br>
+
### Modify bleprph
To demonstrate how the above function is used, we will now modify the *bleprph*
@@ -75,6 +81,8 @@ by making the following to changes:
* Call `ble_ibeacon_set_adv_data()` instead of `ble_gap_adv_set_fields()`.
* Modify the call to `ble_gap_adv_start()` such that the device is non-discoverable and non-connectable.
+<br>
+
```c hl_lines="4 7 8 10 11 19"
static void
bleprph_advertise(void)