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/08/10 00:08:02 UTC

[4/6] incubator-mynewt-site git commit: Small BLE Host API update.

Small BLE Host API update.


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/6dcda862
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/tree/6dcda862
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/diff/6dcda862

Branch: refs/heads/develop
Commit: 6dcda862a326997041efeb5036a77710803be831
Parents: 02ff17f
Author: Christopher Collins <cc...@apache.org>
Authored: Fri Aug 5 15:10:00 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Fri Aug 5 15:56:57 2016 -0700

----------------------------------------------------------------------
 docs/network/ble/ble_hs/ble_gatts/ble_gatts.md  |  1 +
 .../ble_gatts/functions/ble_gatts_count_cfg.md  | 27 ++++++++++++++++++++
 .../ble/ble_hs/init/functions/ble_hs_start.md   |  2 +-
 .../ble/ble_hs/init/functions/ble_hs_synced.md  | 21 +++++++++++++++
 docs/network/ble/ble_hs/init/init.md            |  1 +
 mkdocs.yml                                      | 11 ++++----
 6 files changed, 57 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/6dcda862/docs/network/ble/ble_hs/ble_gatts/ble_gatts.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gatts/ble_gatts.md b/docs/network/ble/ble_hs/ble_gatts/ble_gatts.md
index 8007666..2d0c303 100644
--- a/docs/network/ble/ble_hs/ble_gatts/ble_gatts.md
+++ b/docs/network/ble/ble_hs/ble_gatts/ble_gatts.md
@@ -19,6 +19,7 @@ The Generic Attribute Profile (GATT) manages all activities involving services,
 | Function | Description |
 |----------|-------------|
 | [ble_gatts_add_svcs](functions/ble_gatts_add_svcs.md) | Queues a set of service definitions for registration. |
+| [ble_gatts_count_cfg](functions/ble_gatts_count_cfg.md) | Adjusts a host configuration object's settings to accommodate the specified service definition array. |
 | [ble_gatts_count_resources](functions/ble_gatts_count_resources.md) | Accumulates counts of each resource type required by the specified service definition array. |
 | [ble_gatts_find_chr](functions/ble_gatts_find_chr.md) | Retrieves the pair of attribute handles associated with a local GATT characteristic. |
 | [ble_gatts_find_dsc](functions/ble_gatts_find_dsc.md) | Retrieves the attribute handle associated with a local GATT descriptor. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/6dcda862/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_count_cfg.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_count_cfg.md b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_count_cfg.md
new file mode 100644
index 0000000..067d7c1
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_count_cfg.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gatts\_count\_cfg</font>
+
+```c
+int
+ble_gatts_count_cfg(
+    const struct ble_gatt_svc_def *defs,
+                struct ble_hs_cfg *cfg
+)
+```
+
+### Description
+
+Adjusts a host configuration object's settings to accommodate the specified service definition array.  This function adds the counts to the appropriate fields in the supplied configuration object without clearing them first, so it can be called repeatedly with different inputs to calculate totals.  Be sure to zero the GATT server settings prior to the first call to this function.
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| defs | The service array containing the resource definitions to be counted. |
+| cfg | The resource counts are accumulated in this configuration object. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EINVAL | The svcs array contains an invalid resource definition. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/6dcda862/docs/network/ble/ble_hs/init/functions/ble_hs_start.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/init/functions/ble_hs_start.md b/docs/network/ble/ble_hs/init/functions/ble_hs_start.md
index 63350cf..3bbd151 100644
--- a/docs/network/ble/ble_hs/init/functions/ble_hs_start.md
+++ b/docs/network/ble/ble_hs/init/functions/ble_hs_start.md
@@ -7,7 +7,7 @@ ble_hs_start(void)
 
 ### Description
 
-Synchronizes the host with the controller by sending a sequence of HCI commands.  This function must be called before any other host functionality is used, but it must be called after both the host and controller are initialized.  Typically, the host-parent-task calls this function at the top of its task routine.
+Synchronizes the host with the controller by sending a sequence of HCI commands.  This function must be called before any other host functionality is used, but it must be called after both the host and controller are initialized.  Typically, the host-parent-task calls this function at the top of its task routine.  If the host fails to synchronize with the controller (if the controller is not fully booted, for example), the host will attempt to resynchronize every 100 ms.  For this reason, an error return code is not necessarily fatal.
 
 ### Parameters
 

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/6dcda862/docs/network/ble/ble_hs/init/functions/ble_hs_synced.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/init/functions/ble_hs_synced.md b/docs/network/ble/ble_hs/init/functions/ble_hs_synced.md
new file mode 100644
index 0000000..6aeb618
--- /dev/null
+++ b/docs/network/ble/ble_hs/init/functions/ble_hs_synced.md
@@ -0,0 +1,21 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_hs\_synced</font>
+
+```c
+int
+ble_hs_synced(void)
+```
+
+### Description
+
+Indicates whether the host has synchronized with the controller. Synchronization must occur before any host procedures can be performed.
+
+### Parameters
+
+None
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 1 | The host and controller are in sync. |
+| 0 | The host and controller our out of sync. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/6dcda862/docs/network/ble/ble_hs/init/init.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/init/init.md b/docs/network/ble/ble_hs/init/init.md
index 7fbe6bc..1baac41 100644
--- a/docs/network/ble/ble_hs/init/init.md
+++ b/docs/network/ble/ble_hs/init/init.md
@@ -20,3 +20,4 @@ This section is a reference on initializing and configuring the NimBLE host.
 |----------|-------------|
 | [ble_hs_init](functions/ble_hs_init.md) | Initializes the NimBLE host. |
 | [ble_hs_start](functions/ble_hs_start.md) | Synchronizes the host with the controller by sending a sequence of HCI commands. |
+| [ble_hs_synced](functions/ble_hs_synced.md) | Indicates whether the host has synchronized with the controller. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/6dcda862/mkdocs.yml
----------------------------------------------------------------------
diff --git a/mkdocs.yml b/mkdocs.yml
index 69aba79..4dfb059 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -358,10 +358,10 @@ pages:
                 - toc: 'network/ble/ble_hs/init/init.md'
                 - 'Definitions':
                     - 'Init and config definitions': 'network/ble/ble_hs/init/definitions/init_defs.md'
-
                 - 'Functions':
-                    - 'ble_hs_init': 'network/ble/ble_hs/init/functions/ble_hs_init.md'
                     - 'ble_hs_start': 'network/ble/ble_hs/init/functions/ble_hs_start.md'
+                    - 'ble_hs_init': 'network/ble/ble_hs/init/functions/ble_hs_init.md'
+                    - 'ble_hs_synced': 'network/ble/ble_hs/init/functions/ble_hs_synced.md'
 
             - 'GAP':
                 - toc: 'network/ble/ble_hs/ble_gap/ble_gap.md'
@@ -417,12 +417,13 @@ pages:
                 - 'Definitions':
                     - 'GATT server definitions': 'network/ble/ble_hs/ble_gatts/definitions/ble_gatts_defs.md'
                 - 'Functions':
-                    - 'ble_gatts_add_svcs': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_add_svcs.md'
+                    - 'ble_gatts_count_cfg': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_count_cfg.md'
                     - 'ble_gatts_count_resources': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_count_resources.md'
                     - 'ble_gatts_find_chr': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_chr.md'
-                    - 'ble_gatts_find_dsc': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_dsc.md'
-                    - 'ble_gatts_find_svc': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_svc.md'
                     - 'ble_gatts_register_svcs': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_register_svcs.md'
+                    - 'ble_gatts_add_svcs': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_add_svcs.md'
+                    - 'ble_gatts_find_svc': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_svc.md'
+                    - 'ble_gatts_find_dsc': 'network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_dsc.md'
 
             - 'Identity':
                 - toc: 'network/ble/ble_hs/ble_hs_id/ble_hs_id.md'