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/07/08 21:03:31 UTC

[1/5] incubator-mynewt-site git commit: BLE Host API reference.

Repository: incubator-mynewt-site
Updated Branches:
  refs/heads/develop 53bbfbbc9 -> d2def2645


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_gen_rnd.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_gen_rnd.md b/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_gen_rnd.md
new file mode 100644
index 0000000..754ddad
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_gen_rnd.md
@@ -0,0 +1,24 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_hs\_id\_gen\_rnd</font>
+
+```c
+int
+ble_hs_id_gen_rnd(int nrpa, uint8_t *out_addr)
+```
+
+### Description
+
+Generates a new random address.  This function does not configure the device with the new address; the caller can use the address in subsequent operations. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| nrpa | The type of random address to generate: 0: static 1: non-resolvable private |
+| out\_addr | On success, the generated address gets written here. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_set_rnd.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_set_rnd.md b/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_set_rnd.md
new file mode 100644
index 0000000..61fb25b
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_set_rnd.md
@@ -0,0 +1,23 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_hs\_id\_set\_rnd</font>
+
+```c
+int
+ble_hs_id_set_rnd(const uint8_t *rnd_addr)
+```
+
+### Description
+
+Sets the device's random address.  The address type (static vs. non-resolvable private) is inferred from the most-significant byte of the address.  The address is specified in host byte order (little-endian!). 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| rnd\_addr | The random address to set. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_hs_return_codes.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_hs_return_codes.md b/docs/network/ble/ble_hs/ble_hs_return_codes.md
new file mode 100644
index 0000000..9730f04
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_hs_return_codes.md
@@ -0,0 +1,290 @@
+## <font color="F2853F" style="font-size:24pt">NimBLE Host Return Codes</font>
+
+* [Introduction](#introduction)
+    * [Summary](#summary)
+    * [Example](#example)
+* [Return Code Reference](#return-code-reference)
+    * [Return codes - Core](#return-codes-core)
+    * [Return codes - ATT](#return-codes-att)
+    * [Return codes - HCI](#return-codes-hci)
+    * [Return codes - L2CAP](#return-codes-l2cap)
+    * [Return codes - Security manager (us)](#return-codes-security-manager-(us))
+    * [Return codes - Security manager (peer)](#return-codes-security-manager-(peer))
+
+### Introduction
+
+#### Summary
+
+The NimBLE host reports status to the application via a set of return codes.  The host encompasses several layers of the Bluetooth specification that each defines its own set of status codes.  Rather than "abstract away" information from lower layers that the application developer might find useful, the NimBLE host aims to indicate precisely what happened when something fails.  Consequently, the host utilizes a rather large set of return codes.
+
+A return code of 0 indicates success.  For failure conditions, the return codes are partitioned into five separate sets:
+
+| Set | Condition | Notes|
+|-----|-------------|
+| Core | Errors detected internally by the NimBLE host. |
+| ATT | The ATT server has reported a failure via the transmission of an ATT Error Response.  The return code corresponds to the value of the Error Code field in the response. |
+| HCI | The controller has reported an error to the host via a command complete or command status HCI event.  The return code corresponds to the value of the Status field in the event.
+| L2CAP | An L2CAP signalling procedure has failed and an L2CAP Command Reject was sent as a result.  The return code corresponds to the value of the Reason field in the command.
+| Security manager (us) | The host detected an error during a security manager procedure and sent a Pairing Failed command to the peer.  The return code corresponds to the value of the Reason field in the Pairing Failed command. |
+| Security manager (peer) | A security manager procedure failed because the peer sent us a Pairing Failed command.  The return code corresponds to the value of the Reason field in the Pairing Failed command. |
+
+The return codes in the core set are defined by the NimBLE Host.  The other sets are defined in the Bluetooth specification; the codes in this latter group are referred to as _formal status codes_.  As defined in the Bluetooth specification, the formal status code sets are not disjoint.  That is, they overlap.  For example, the spec defines a status code of 1 to have all of the following meanings:
+
+| Layer | Meaning |
+|-------|---------|
+| ATT   | Invalid handle. |
+| HCI   | Unknown HCI command. |
+| L2CAP | Signalling MTU exceeded. |
+| SM    | Passkey entry failed. |
+
+Clearly, the host can't just return an unadorned formal status code and expect the application to make sense of it.  To resolve this ambiguity, the NimBLE host divides the full range of an int into several subranges.  Each subrange corresponds to one of the five return code sets.  For example, the ATT set is mapped onto the subrange _[0x100, 0x200)_.  To indicate an ATT error of 3 (write not permitted), the NimBLE host returns a value 0x103 to the application.
+
+The host defines a set of convenience macros for converting from a formal status code to NimBLE host status code.  These macros are documented in the table below.
+
+| Macro | Status code set | Base value |
+|-------|-----------------|-------------------|
+| BLE\_HS\_ATT\_ERR() | ATT | 0x100 |
+| BLE\_HS\_HCI\_ERR() | HCI | 0x200 |
+| BLE\_HS\_L2C\_ERR() | L2CAP | 0x300 |
+| BLE\_HS\_SM\_US\_ERR() | Security manager (us) | 0x400 |
+| BLE\_HS\_SM\_PEER\_ERR() | Security manager (peer) | 0x500 |
+
+#### Example
+
+The following example demonstrates how an application might determine which error is being reported by the host.  In this example, the application performs the GAP encryption procedure and checks the return code.  To simplify the example, the application uses a hypothetical *my_blocking_enc_proc()* function, which blocks until the pairing operation has completed.
+
+```c
+void
+encrypt_connection(uint16_t conn_handle)
+{
+    int rc;
+
+    /* Perform a blocking GAP encryption procedure. */
+    rc = my_blocking_enc_proc(conn_handle);
+    switch (rc) {
+    case 0:
+        console_printf("success - link successfully encrypted\n");
+        break;
+
+    case BLE_HS_ENOTCONN:
+        console_printf("failure - no connection with handle %d\n",
+                       conn_handle);
+        break;
+
+    case BLE_HS_ERR_SM_US_BASE(BLE_SM_ERR_CONFIRM_MISMATCH):
+        console_printf("failure - mismatch in peer's confirm and random "
+                       "commands.\n");
+        break;
+
+    case BLE_HS_ERR_SM_PEER_BASE(BLE_SM_ERR_CONFIRM_MISMATCH):
+        console_printf("failure - peer reports mismatch in our confirm and "
+                       "random commands.\n");
+        break;
+
+    default:
+        console_printf("failure - other error: 0x%04x\n", rc);
+        break;
+    }
+}
+```
+
+### Return Code Reference
+
+#### Return codes - Core
+
+The precise meaning of each of these error codes depends on the function that returns it.  The API reference for a particular function indicates the conditions under which each of these codes are returned.
+
+```c
+#include "host/ble_hs.h"
+```
+
+| Value | Name           | Condition                                    |
+|-------|----------------|----------------------------------------------|
+| 0x00  | _N/A_                    | Success                                      |
+| 0x01  | BLE\_HS\_EAGAIN          | Temporary failure; try again.                |
+| 0x02  | BLE\_HS\_EALREADY        | Operation already in progress or completed.  |
+| 0x03  | BLE\_HS\_EINVAL          | One or more arguments are invalid.           |
+| 0x04  | BLE\_HS\_EMSGSIZE        | The provided buffer is too small.            |
+| 0x05  | BLE\_HS\_ENOENT          | No entry matching the specified criteria.    |
+| 0x06  | BLE\_HS\_ENOMEM          | Operation failed due to resource exhaustion. |
+| 0x07  | BLE\_HS\_ENOTCONN        | No open connection with the specified handle.|
+| 0x08  | BLE\_HS\_ENOTSUP         | Operation disabled at compile time.          |
+| 0x09  | BLE\_HS\_EAPP            | Application callback behaved unexpectedly.   |
+| 0x0a  | BLE\_HS\_EBADDATA        | Command from peer is invalid.                |
+| 0x0b  | BLE\_HS\_EOS             | Mynewt OS error.                             |
+| 0x0c  | BLE\_HS\_ECONTROLLER     | Event from controller is invalid.            |
+| 0x0d  | BLE\_HS\_ETIMEOUT        | Operation timed out.                         |
+| 0x0e  | BLE\_HS\_EDONE           | Operation completed successfully.            |
+| 0x0f  | BLE\_HS\_EBUSY           | Operation cannot be performed until procedure completes. |
+| 0x10  | BLE\_HS\_EREJECT         | Peer rejected a connection parameter update request. |
+| 0x11  | BLE\_HS\_EUNKNOWN        | Unexpected failure; catch all. |
+| 0x12  | BLE\_HS\_EROLE           | Operation requires different role (e.g., central vs. peripheral). |
+| 0x13  | BLE\_HS\_ETIMEOUT\_HCI   | HCI request timed out; controller unresponsive. |
+| 0x14  | BLE\_HS\_ENOMEM\_EVT     | Controller failed to send event due to memory exhaustion (combined host-controller only). |
+| 0x15  | BLE\_HS\_ENOADDR         | Operation requires an identity address but none configured. |
+
+
+#### Return codes - ATT
+
+
+```c
+#include "host/ble_hs.h"
+#include "host/ble_att.h"
+```
+
+| NimBLE Value | Formal Value | Name   | Condition   |
+|-------|----------------|----------------------------------------------|
+| 0x0101  | 0x01  |  BLE\_ATT\_ERR\_INVALID\_HANDLE          | The attribute handle given was not valid on this server. |
+| 0x0102  | 0x02  |  BLE\_ATT\_ERR\_READ\_NOT\_PERMITTED      | The attribute cannot be read. |
+| 0x0103  | 0x03  |  BLE\_ATT\_ERR\_WRITE\_NOT\_PERMITTED     | The attribute cannot be written. |
+| 0x0104  | 0x04  |  BLE\_ATT\_ERR\_INVALID\_PDU             | The attribute PDU was invalid. |
+| 0x0105  | 0x05  |  BLE\_ATT\_ERR\_INSUFFICIENT\_AUTHEN     | The attribute requires authentication before it can be read or written. |
+| 0x0106  | 0x06  |  BLE\_ATT\_ERR\_REQ\_NOT\_SUPPORTED       | Attribute server does not support the request received from the client. |
+| 0x0107  | 0x07  |  BLE\_ATT\_ERR\_INVALID\_OFFSET          | Offset specified was past the end of the attribute. |
+| 0x0108  | 0x08  |  BLE\_ATT\_ERR\_INSUFFICIENT\_AUTHOR     | The attribute requires authorization before it can be read or written. |
+| 0x0109  | 0x09  |  BLE\_ATT\_ERR\_PREPARE\_QUEUE\_FULL      | Too many prepare writes have been queued. |
+| 0x010a  | 0x0a  |  BLE\_ATT\_ERR\_ATTR\_NOT\_FOUND          | No attribute found within the given attribute handle range. |
+| 0x010b  | 0x0b  |  BLE\_ATT\_ERR\_ATTR\_NOT\_LONG           | The attribute cannot be read or written using the Read Blob Request. |
+| 0x010c  | 0x0c  |  BLE\_ATT\_ERR\_INSUFFICIENT\_KEY\_SZ     | The Encryption Key Size used for encrypting this link is insufficient. |
+| 0x010d  | 0x0d  |  BLE\_ATT\_ERR\_INVALID\_ATTR\_VALUE\_LEN  | The attribute value length is invalid for the operation. |
+| 0x010e  | 0x0e  |  BLE\_ATT\_ERR\_UNLIKELY                | The attribute request that was requested has encountered an error that was unlikely, and therefore could not be completed as requested. |
+| 0x010f  | 0x0f  |  BLE\_ATT\_ERR\_INSUFFICIENT\_ENC        | The attribute requires encryption before it can be read or written. |
+| 0x0110  | 0x10  |  BLE\_ATT\_ERR\_UNSUPPORTED\_GROUP       | The attribute type is not a supported grouping attribute as defined by a higher layer specification. |
+| 0x0111  | 0x11  |  BLE\_ATT\_ERR\_INSUFFICIENT\_RES        | Insufficient Resources to complete the request. |
+
+
+#### Return codes - HCI
+
+
+```c
+#include "host/ble_hs.h"
+#include "nimble/ble.h"
+```
+
+| NimBLE Value | Formal Value | Name   | Condition   |
+|-------|----------------|----------------------------------------------|
+| 0x0201  | 0x01  | BLE\_ERR\_UNKNOWN\_HCI\_CMD       | Unknown HCI Command |
+| 0x0202  | 0x02  | BLE\_ERR\_UNK\_CONN\_ID           | Unknown Connection Identifier |
+| 0x0203  | 0x03  | BLE\_ERR\_HW\_FAIL                | Hardware Failure |
+| 0x0204  | 0x04  | BLE\_ERR\_PAGE\_TMO               | Page Timeout |
+| 0x0205  | 0x05  | BLE\_ERR\_AUTH\_FAIL              | Authentication Failure |
+| 0x0206  | 0x06  | BLE\_ERR\_PINKEY\_MISSING         | PIN or Key Missing |
+| 0x0207  | 0x07  | BLE\_ERR\_MEM\_CAPACITY           | Memory Capacity Exceeded |
+| 0x0208  | 0x08  | BLE\_ERR\_CONN\_SPVN\_TMO         | Connection Timeout |
+| 0x0209  | 0x09  | BLE\_ERR\_CONN\_LIMIT             | Connection Limit Exceeded |
+| 0x020a  | 0x0a  | BLE\_ERR\_SYNCH\_CONN\_LIMIT      | Synchronous Connection Limit To A Device Exceeded |
+| 0x020b  | 0x0b  | BLE\_ERR\_ACL\_CONN\_EXISTS       | ACL Connection Already Exists |
+| 0x020c  | 0x0c  | BLE\_ERR\_CMD\_DISALLOWED         | Command Disallowed |
+| 0x020d  | 0x0d  | BLE\_ERR\_CONN\_REJ\_RESOURCES    | Connection Rejected due to Limited Resources |
+| 0x020e  | 0x0e  | BLE\_ERR\_CONN\_REJ\_SECURITY     | Connection Rejected Due To Security Reasons |
+| 0x020f  | 0x0f  | BLE\_ERR\_CONN\_REJ\_BD\_ADDR     | Connection Rejected due to Unacceptable BD\_ADDR |
+| 0x0210  | 0x10  | BLE\_ERR\_CONN\_ACCEPT\_TMO       | Connection Accept Timeout Exceeded |
+| 0x0211  | 0x11  | BLE\_ERR\_UNSUPPORTED             | Unsupported Feature or Parameter Value |
+| 0x0212  | 0x12  | BLE\_ERR\_INV\_HCI\_CMD\_PARMS    | Invalid HCI Command Parameters |
+| 0x0213  | 0x13  | BLE\_ERR\_REM\_USER\_CONN\_TERM   | Remote User Terminated Connection |
+| 0x0214  | 0x14  | BLE\_ERR\_RD\_CONN\_TERM\_RESRCS  | Remote Device Terminated Connection due to Low Resources |
+| 0x0215  | 0x15  | BLE\_ERR\_RD\_CONN\_TERM\_PWROFF  | Remote Device Terminated Connection due to Power Off |
+| 0x0216  | 0x16  | BLE\_ERR\_CONN\_TERM\_LOCAL       | Connection Terminated By Local Host |
+| 0x0217  | 0x17  | BLE\_ERR\_REPEATED\_ATTEMPTS      | Repeated Attempts |
+| 0x0218  | 0x18  | BLE\_ERR\_NO\_PAIRING             | Pairing Not Allowed |
+| 0x0219  | 0x19  | BLE\_ERR\_UNK\_LMP                | Unknown LMP PDU |
+| 0x021a  | 0x1a  | BLE\_ERR\_UNSUPP\_REM\_FEATURE    | Unsupported Remote Feature / Unsupported LMP Feature |
+| 0x021b  | 0x1b  | BLE\_ERR\_SCO\_OFFSET             | SCO Offset Rejected |
+| 0x021c  | 0x1c  | BLE\_ERR\_SCO\_ITVL               | SCO Interval Rejected |
+| 0x021d  | 0x1d  | BLE\_ERR\_SCO\_AIR\_MODE          | SCO Air Mode Rejected |
+| 0x021e  | 0x1e  | BLE\_ERR\_INV\_LMP\_LL\_PARM      | Invalid LMP Parameters / Invalid LL Parameters |
+| 0x021f  | 0x1f  | BLE\_ERR\_UNSPECIFIED             | Unspecified Error |
+| 0x0220  | 0x20  | BLE\_ERR\_UNSUPP\_LMP\_LL\_PARM   | Unsupported LMP Parameter Value / Unsupported LL Parameter Value |
+| 0x0221  | 0x21  | BLE\_ERR\_NO\_ROLE\_CHANGE        | Role Change Not Allowed |
+| 0x0222  | 0x22  | BLE\_ERR\_LMP\_LL\_RSP\_TMO       | LMP Response Timeout / LL Response Timeout |
+| 0x0223  | 0x23  | BLE\_ERR\_LMP\_COLLISION          | LMP Error Transaction Collision |
+| 0x0224  | 0x24  | BLE\_ERR\_LMP\_PDU                | LMP PDU Not Allowed |
+| 0x0225  | 0x25  | BLE\_ERR\_ENCRYPTION\_MODE        | Encryption Mode Not Acceptable |
+| 0x0226  | 0x26  | BLE\_ERR\_LINK\_KEY\_CHANGE       | Link Key cannot be Changed |
+| 0x0227  | 0x27  | BLE\_ERR\_UNSUPP\_QOS             | Requested QoS Not Supported |
+| 0x0228  | 0x28  | BLE\_ERR\_INSTANT\_PASSED         | Instant Passed |
+| 0x0229  | 0x29  | BLE\_ERR\_UNIT\_KEY\_PAIRING      | Pairing With Unit Key Not Supported |
+| 0x022a  | 0x2a  | BLE\_ERR\_DIFF\_TRANS\_COLL       | Different Transaction Collision |
+| 0x022c  | 0x2c  | BLE\_ERR\_QOS\_PARM               | QoS Unacceptable Parameter |
+| 0x022d  | 0x2d  | BLE\_ERR\_QOS\_REJECTED           | QoS Rejected |
+| 0x022e  | 0x2e  | BLE\_ERR\_CHAN\_CLASS             | Channel Classification Not Supported |
+| 0x022f  | 0x2f  | BLE\_ERR\_INSUFFICIENT\_SEC       | Insufficient Security |
+| 0x0230  | 0x30  | BLE\_ERR\_PARM\_OUT\_OF\_RANGE    | Parameter Out Of Mandatory Range |
+| 0x0232  | 0x32  | BLE\_ERR\_PENDING\_ROLE\_SW       | Role Switch Pending |
+| 0x0234  | 0x34  | BLE\_ERR\_RESERVED\_SLOT          | Reserved Slot Violation |
+| 0x0235  | 0x35  | BLE\_ERR\_ROLE\_SW\_FAIL          | Role Switch Failed |
+| 0x0236  | 0x36  | BLE\_ERR\_INQ\_RSP\_TOO\_BIG      | Extended Inquiry Response Too Large |
+| 0x0237  | 0x37  | BLE\_ERR\_SEC\_SIMPLE\_PAIR       | Secure Simple Pairing Not Supported By Host |
+| 0x0238  | 0x38  | BLE\_ERR\_HOST\_BUSY\_PAIR        | Host Busy - Pairing |
+| 0x0239  | 0x39  | BLE\_ERR\_CONN\_REJ\_CHANNEL      | Connection Rejected due to No Suitable Channel Found |
+| 0x023a  | 0x3a  | BLE\_ERR\_CTLR\_BUSY              | Controller Busy |
+| 0x023b  | 0x3b  | BLE\_ERR\_CONN\_PARMS             | Unacceptable Connection Parameters  |
+| 0x023c  | 0x3c  | BLE\_ERR\_DIR\_ADV\_TMO           | Directed Advertising Timeout |
+| 0x023d  | 0x3d  | BLE\_ERR\_CONN\_TERM\_MIC         | Connection Terminated due to MIC Failure |
+| 0x023e  | 0x3e  | BLE\_ERR\_CONN\_ESTABLISHMENT     | Connection Failed to be Established |
+| 0x023f  | 0x3f  | BLE\_ERR\_MAC\_CONN\_FAIL         | MAC Connection Failed  |
+| 0x0240  | 0x40  | BLE\_ERR\_COARSE\_CLK\_ADJ        | Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging |
+
+#### Return codes - L2CAP
+
+
+```c
+#include "host/ble_hs.h"
+#include "host/ble_l2cap.h"
+```
+
+| NimBLE Value | Formal Value | Name   | Condition   |
+|-------|----------------|----------------------------------------------|
+| 0x0300  | 0x00  | BLE\_L2CAP\_SIG\_ERR\_CMD\_NOT\_UNDERSTOOD    | Invalid or unsupported incoming L2CAP sig command. |
+| 0x0301  | 0x01  | BLE\_L2CAP\_SIG\_ERR\_MTU\_EXCEEDED           | Incoming packet too large. |
+| 0x0302  | 0x02  | BLE\_L2CAP\_SIG\_ERR\_INVALID\_CID            | No channel with specified ID. |
+
+#### Return codes - Security manager (us)
+
+
+```c
+#include "host/ble_hs.h"
+#include "host/ble_sm.h"
+```
+
+| NimBLE Value    | Formal Value | Name   | Condition   |
+|-------|----------------|----------------------------------------------|
+| 0x0401  | 0x01  | BLE\_SM\_ERR\_PASSKEY             | The user input of passkey failed, for example, the user cancelled the operation. |
+| 0x0402  | 0x02  | BLE\_SM\_ERR\_OOB                 | The OOB data is not available. |
+| 0x0403  | 0x03  | BLE\_SM\_ERR\_AUTHREQ             | The pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices. |
+| 0x0404  | 0x04  | BLE\_SM\_ERR\_CONFIRM\_MISMATCH   | The confirm value does not match the calculated compare value. |
+| 0x0405  | 0x05  | BLE\_SM\_ERR\_PAIR\_NOT\_SUPP     | Pairing is not supported by the device. |
+| 0x0406  | 0x06  | BLE\_SM\_ERR\_ENC\_KEY\_SZ        | The resultant encryption key size is insufficient for the security requirements of this device. |
+| 0x0407  | 0x07  | BLE\_SM\_ERR\_CMD\_NOT\_SUPP      | The SMP command received is not supported on this device. |
+| 0x0408  | 0x08  | BLE\_SM\_ERR\_UNSPECIFIED         | Pairing failed due to an unspecified reason. |
+| 0x0409  | 0x09  | BLE\_SM\_ERR\_REPEATED            | Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request. |
+| 0x040a  | 0x0a  | BLE\_SM\_ERR\_INVAL               | The Invalid Parameters error code indicates that the command length is invalid or that a parameter is outside of the specified range. |
+| 0x040b  | 0x0b  | BLE\_SM\_ERR\_DHKEY               | Indicates to the remote device that the DHKey Check value received doesn\u2019t match the one calculated by the local device. |
+| 0x040c  | 0x0c  | BLE\_SM\_ERR\_NUMCMP              | Indicates that the confirm values in the numeric comparison protocol do not match. |
+| 0x040d  | 0x0d  | BLE\_SM\_ERR\_ALREADY             | Indicates that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process. |
+| 0x040e  | 0x0e  | BLE\_SM\_ERR\_CROSS\_TRANS        | Indicates that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and distribute keys for the LE transport. |
+
+#### Return codes - Security manager (peer)
+
+
+```c
+#include "host/ble_hs.h"
+#include "host/ble_sm.h"
+```
+
+| NimBLE Value    | Formal Value | Name   | Condition   |
+|-----------------|--------------|--------|-------------|
+| 0x0501          | 0x01         | BLE\_SM\_ERR\_PASSKEY             | The user input of passkey failed, for example, the user cancelled the operation. |
+| 0x0502          | 0x02         | BLE\_SM\_ERR\_OOB                 | The OOB data is not available. |
+| 0x0503          | 0x03         | BLE\_SM\_ERR\_AUTHREQ             | The pairing procedure cannot be performed as authentication requirements cannot be met due to IO capabilities of one or both devices. |
+| 0x0504          | 0x04         | BLE\_SM\_ERR\_CONFIRM\_MISMATCH   | The confirm value does not match the calculated compare value. |
+| 0x0505          | 0x05         | BLE\_SM\_ERR\_PAIR\_NOT\_SUPP     | Pairing is not supported by the device. |
+| 0x0506          | 0x06         | BLE\_SM\_ERR\_ENC\_KEY\_SZ        | The resultant encryption key size is insufficient for the security requirements of this device. |
+| 0x0507          | 0x07         | BLE\_SM\_ERR\_CMD\_NOT\_SUPP      | The SMP command received is not supported on this device. |
+| 0x0508          | 0x08         | BLE\_SM\_ERR\_UNSPECIFIED         | Pairing failed due to an unspecified reason. |
+| 0x0509          | 0x09         | BLE\_SM\_ERR\_REPEATED            | Pairing or authentication procedure is disallowed because too little time has elapsed since last pairing request or security request. |
+| 0x050a          | 0x0a         | BLE\_SM\_ERR\_INVAL               | The Invalid Parameters error code indicates that the command length is invalid or that a parameter is outside of the specified range. |
+| 0x050b          | 0x0b         | BLE\_SM\_ERR\_DHKEY               | Indicates to the remote device that the DHKey Check value received doesn\u2019t match the one calculated by the local device. |
+| 0x050c          | 0x0c         | BLE\_SM\_ERR\_NUMCMP              | Indicates that the confirm values in the numeric comparison protocol do not match. |
+| 0x050d          | 0x0d         | BLE\_SM\_ERR\_ALREADY             | Indicates that the pairing over the LE transport failed due to a Pairing Request sent over the BR/EDR transport in process. |
+| 0x050e          | 0x0e         | BLE\_SM\_ERR\_CROSS\_TRANS        | Indicates that the BR/EDR Link Key generated on the BR/EDR transport cannot be used to derive and distribute keys for the LE transport. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/init/definitions/init_defs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/init/definitions/init_defs.md b/docs/network/ble/ble_hs/init/definitions/init_defs.md
new file mode 100644
index 0000000..99c4be8
--- /dev/null
+++ b/docs/network/ble/ble_hs/init/definitions/init_defs.md
@@ -0,0 +1,147 @@
+## <font color="#F2853F" style="font-size:24pt">Other definitions</font>
+
+```c
+/* Defines the IO capabilities for the local device. */
+#define BLE_HS_IO_DISPLAY_ONLY              0x00
+#define BLE_HS_IO_DISPLAY_YESNO             0x01
+#define BLE_HS_IO_KEYBOARD_ONLY             0x02
+#define BLE_HS_IO_NO_INPUT_OUTPUT           0x03
+#define BLE_HS_IO_KEYBOARD_DISPLAY          0x04
+```
+
+```c
+struct ble_hs_cfg {
+    /*** HCI settings. */
+    /**
+     * An HCI buffer is a "flat" 260-byte buffer.  HCI buffers are used by the
+     * controller to send unsolicited events to the host.
+     *
+     * HCI buffers can get tied up when the controller sends lots of
+     * asynchronous / unsolicited events (i.e., non-acks).  When the controller
+     * needs to send one of these events, it allocates an HCI buffer, fills it
+     * with the event payload, and puts it on a host queue.  If the controller
+     * sends a quick burst of these events, the buffer pool may be exhausted,
+     * preventing the host from sending an HCI command to the controller.
+     *
+     * Every time the controller sends a non-ack HCI event to the host, it also
+     * allocates an OS event (it is unfortunate that these are both called
+     * "events").  The OS event is put on the host-parent-task's event queue;
+     * it is what wakes up the host-parent-task and indicates that an HCI event
+     * needs to be processsed.  The pool of OS events is allocated with the
+     * same number of elements as the HCI buffer pool.
+     */
+    uint8_t max_hci_bufs;
+
+    /*** Connection settings. */
+    /**
+     * The maximum number of concurrent connections.  This is set
+     * automatically according to the build-time option
+     * NIMBLE_OPT_MAX_CONNECTIONS.
+     */
+    uint8_t max_connections;
+
+    /*** GATT server settings. */
+    /**
+     * These are acquired at service registration time and never freed.  You
+     * need one of these for every service that you register.
+     */
+    uint16_t max_services;
+
+    /**
+     * The total number of in-RAM client characteristic configuration
+     * descriptors (CCCDs).  One of these is consumed each time a peer
+     * subscribes to notifications or indications for a characteristic that
+     * your device serves.  In addition, at service registration time, the host
+     * uses one of these for each characteristic that supports notifications or
+     * indications.  So, the formula which guarantees no resource exhaustion
+     * is:
+     *     (num-subscribable-characteristics) * (max-connections + 1)
+     */
+    uint16_t max_client_configs;
+
+    /*** GATT client settings. */
+    /**
+     * The maximum number of concurrent GATT client procedures.  When you
+     * initiate a GATT procedure (e.g., read a characteristic, discover
+     * services, etc.), one of these is consumed.  The resource is freed when
+     * the procedure completes.
+     */
+    uint8_t max_gattc_procs;
+
+    /*** ATT server settings. */
+    /**
+     * The total number of local ATT attributes.  Attributes are consumed at
+     * service registration time and are never freed.  Attributes are used by
+     * GATT server entities: services, characteristics, and descriptors
+     * according to the following formula:
+     *     (num-services + (num-characteristics * 2) + num-descriptors)
+     *
+     * Every characteristic that supports indications or notifications
+     * automatically gets a descriptor.  All other descriptors are specified by
+     * the application at service registration time.
+     */
+    uint16_t max_attrs;
+
+    /**
+     * A GATT server uses these when a peer performs a "write long
+     * characteristic values" or "write long characteristic descriptors"
+     * procedure.  One of these resources is consumed each time a peer sends a
+     * partial write.  These procedures are not used often.
+     */
+    uint8_t max_prep_entries;
+
+    /*** L2CAP settings. */
+    /**
+     * Each connection requires three L2CAP channels (signal, ATT, and security
+     * manager).  In addition, the nimble host may allow channels to be created
+     * "on the fly" (connection-oriented channels).  This functionality is not
+     * available at the moment, so a safe formula to use is:
+     *     (max-connections * 3)
+     */
+    uint8_t max_l2cap_chans;
+
+    /**
+     * The maximum number of concurrent L2CAP signalling procedures.  Only one
+     * L2CAP signalling procedure is supported: slave-initiated connection
+     * update.  You will never need more of these than the max number of
+     * connections.
+     */
+    uint8_t max_l2cap_sig_procs;
+
+    /**
+     * The maximum number of concurrent security manager procedures.  Security
+     * manager procedures include pairing and restoration of a bonded link.
+     */
+    uint8_t max_l2cap_sm_procs;
+
+    /*** Security manager settings. */
+    uint8_t sm_io_cap;
+    unsigned sm_oob_data_flag:1;
+    unsigned sm_bonding:1;
+    unsigned sm_mitm:1;
+    unsigned sm_sc:1;
+    unsigned sm_keypress:1;
+    uint8_t sm_our_key_dist;
+    uint8_t sm_their_key_dist;
+
+    /*** Store settings. */
+    /**
+     * These function callbacks handle persistence of sercurity material
+     * (bonding).
+     */
+    ble_store_read_fn *store_read_cb;
+    ble_store_write_fn *store_write_cb;
+    ble_store_delete_fn *store_delete_cb;
+
+    /*** privacy settings */
+    /**
+     * The frequency at which new resovlable private addresses are generated.
+     * Units are seconds.
+     */
+    uint16_t rpa_timeout;
+};
+```
+
+```c
+extern const struct ble_hs_cfg ble_hs_cfg_dflt;
+```

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/init/functions/ble_hs_init.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/init/functions/ble_hs_init.md b/docs/network/ble/ble_hs/init/functions/ble_hs_init.md
new file mode 100644
index 0000000..5c34ee0
--- /dev/null
+++ b/docs/network/ble/ble_hs/init/functions/ble_hs_init.md
@@ -0,0 +1,24 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_hs\_init</font>
+
+```c
+int
+ble_hs_init(struct os_eventq *app_evq, struct ble_hs_cfg *cfg)
+```
+
+### Description
+
+Initializes the NimBLE host.  This function must be called before the OS is started.  The NimBLE stack requires an application task to function.  One application task in particular is designated as the "host parent task".  In addition to application-specific work, the host parent task does work for NimBLE by processing events generated by the host. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| app\_evq | The event queue associated with the host parent task. |
+| cfg | The set of configuration settings to initialize the host with.  Specify null for defaults. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/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
new file mode 100644
index 0000000..8cc860a
--- /dev/null
+++ b/docs/network/ble/ble_hs/init/functions/ble_hs_start.md
@@ -0,0 +1,21 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_hs\_start</font>
+
+```c
+int
+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. 
+
+### Parameters
+
+None
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/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
new file mode 100644
index 0000000..7fbe6bc
--- /dev/null
+++ b/docs/network/ble/ble_hs/init/init.md
@@ -0,0 +1,22 @@
+## <font color="F2853F" style="font-size:24pt">NimBLE Host Init and Config Reference</font>
+
+### Introduction
+
+This section is a reference on initializing and configuring the NimBLE host.
+
+### Header
+
+```c
+#include "host/ble_hs.h"
+```
+
+### Definitions
+
+[BLE host init and config definitions](definitions/init_defs.md)
+
+### Functions
+
+| Function | Description |
+|----------|-------------|
+| [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. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_uid.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_uid.md b/docs/network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_uid.md
new file mode 100644
index 0000000..d96952b
--- /dev/null
+++ b/docs/network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_uid.md
@@ -0,0 +1,26 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_eddystone\_set\_adv\_data\_uid</font>
+
+```c
+int
+ble_eddystone_set_adv_data_uid(struct ble_hs_adv_fields *adv_fields, void *uid)
+```
+
+### Description
+
+Configures the device to advertise eddystone UID beacons. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| adv\_fields | The base advertisement fields to transform into an eddystone beacon.  All configured fields are preserved; you probably want to clear this struct before calling this function. |
+| uid | The 16-byte UID to advertise. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EBUSY | Advertising is in progress. |
+| BLE\_HS\_EMSGSIZE | The specified data is too large to fit in an advertisement. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_url.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_url.md b/docs/network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_url.md
new file mode 100644
index 0000000..f522ccb
--- /dev/null
+++ b/docs/network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_url.md
@@ -0,0 +1,31 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_eddystone\_set\_adv\_data\_url</font>
+
+```c
+int
+ble_eddystone_set_adv_data_url(struct ble_hs_adv_fields *adv_fields,
+                               uint8_t url_scheme, char *url_body,
+                               uint8_t url_body_len, uint8_t url_suffix)
+```
+
+### Description
+
+Configures the device to advertise eddystone URL beacons. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| adv\_fields | The base advertisement fields to transform into an eddystone beacon.  All configured fields are preserved; you probably want to clear this struct before calling this function. |
+| url\_scheme | The prefix of the URL; one of the BLE\_EDDYSTONE\_URL\_SCHEME values. |
+| url\_body | The middle of the URL.  Don't include the suffix if there is a suitable suffix code. |
+| url\_body\_len | The string length of the url\_body argument. |
+| url\_suffix | The suffix of the URL; one of the BLE\_EDDYSTONE\_URL\_SUFFIX values; use BLE\_EDDYSTONE\_URL\_SUFFIX\_NONE if the suffix is embedded in the body argument. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EBUSY | Advertising is in progress. |
+| BLE\_HS\_EMSGSIZE | The specified data is too large to fit in an advertisement. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/other/functions/ble_ibeacon_set_adv_data.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/other/functions/ble_ibeacon_set_adv_data.md b/docs/network/ble/ble_hs/other/functions/ble_ibeacon_set_adv_data.md
new file mode 100644
index 0000000..df002b2
--- /dev/null
+++ b/docs/network/ble/ble_hs/other/functions/ble_ibeacon_set_adv_data.md
@@ -0,0 +1,26 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_ibeacon\_set\_adv\_data</font>
+
+```c
+int
+ble_ibeacon_set_adv_data(void *uuid128, uint16_t major, uint16_t minor)
+```
+
+### Description
+
+Configures the device to advertise iBeacons. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| uuid | The 128-bit UUID to advertise. |
+| major | The major version number to include in iBeacons. |
+| minor | The minor version number to include in iBeacons. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EBUSY | Advertising is in progress. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/other/functions/ble_uuid_128_to_16.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/other/functions/ble_uuid_128_to_16.md b/docs/network/ble/ble_hs/other/functions/ble_uuid_128_to_16.md
new file mode 100644
index 0000000..bcbf0a0
--- /dev/null
+++ b/docs/network/ble/ble_hs/other/functions/ble_uuid_128_to_16.md
@@ -0,0 +1,23 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_uuid\_128\_to\_16</font>
+
+```c
+uint16_t
+ble_uuid_128_to_16(const void *uuid128)
+```
+
+### Description
+
+Attempts to convert the supplied 128-bit UUID into its shortened 16-bit form. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| uuid128 | The 128-bit UUID to attempt to convert. This must point to 16 contiguous bytes. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| other | Positive 16-bit unsigned integer on success. |
+| 0 | The uuid cannot be represented in 16 bits. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/other/functions/ble_uuid_16_to_128.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/other/functions/ble_uuid_16_to_128.md b/docs/network/ble/ble_hs/other/functions/ble_uuid_16_to_128.md
new file mode 100644
index 0000000..64b6165
--- /dev/null
+++ b/docs/network/ble/ble_hs/other/functions/ble_uuid_16_to_128.md
@@ -0,0 +1,24 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_uuid\_16\_to\_128</font>
+
+```c
+int
+ble_uuid_16_to_128(uint16_t uuid16, void *out_uuid128)
+```
+
+### Description
+
+Expands a 16-bit UUID into its 128-bit form. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| uuid16 | The 16-bit UUID to convert. |
+| out\_uuid128 | On success, the resulting 128-bit UUID gets written here. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EINVAL | Uuid16 is not a valid 16-bit uuid. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/other/other.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/other/other.md b/docs/network/ble/ble_hs/other/other.md
new file mode 100644
index 0000000..3b8315d
--- /dev/null
+++ b/docs/network/ble/ble_hs/other/other.md
@@ -0,0 +1,25 @@
+## <font color="F2853F" style="font-size:24pt">NimBLE Host Other Reference</font>
+
+### Introduction
+
+This section is a reference on miscellaneous parts of the NimBLE host which don't fit anywhere else!
+
+### Header
+
+```c
+#include "host/ble_hs.h"
+```
+
+### Definitions
+
+None.
+
+### Functions
+
+| Function | Description |
+|----------|-------------|
+| [ble_eddystone_set_adv_data_uid](functions/ble_eddystone_set_adv_data_uid.md) | Configures the device to advertise eddystone UID beacons. |
+| [ble_eddystone_set_adv_data_url](functions/ble_eddystone_set_adv_data_url.md) | Configures the device to advertise eddystone URL beacons. |
+| [ble_ibeacon_set_adv_data](functions/ble_ibeacon_set_adv_data.md) | Configures the device to advertise iBeacons. |
+| [ble_uuid_128_to_16](functions/ble_uuid_128_to_16.md) | Attempts to convert the supplied 128-bit UUID into its shortened 16-bit form. |
+| [ble_uuid_16_to_128](functions/ble_uuid_16_to_128.md) | Expands a 16-bit UUID into its 128-bit form. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/mkdocs.yml
----------------------------------------------------------------------
diff --git a/mkdocs.yml b/mkdocs.yml
index c84550f..c24de92 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -347,6 +347,90 @@ pages:
             - 'Initialize controller': 'network/ble/ini_stack/ble_controller_ini.md'
             - 'Initialize parent task': 'network/ble/ini_stack/ble_parent_ini.md'
             - 'Initialize host': 'network/ble/ini_stack/ble_host_ini.md'
+        - NimBLE Host API:
+            - toc: 'network/ble/ble_hs/ble_hs.md'
+            - 'Return codes': 'network/ble/ble_hs/ble_hs_return_codes.md'
+
+            - 'Init and config':
+                - 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'
+
+            - 'GAP':
+                - toc: 'network/ble/ble_hs/ble_gap/ble_gap.md'
+                - 'Definitions':
+                    - 'GAP definitions': 'network/ble/ble_hs/ble_gap/definitions/ble_gap_defs.md'
+                - 'Functions':
+                    - 'ble_gap_adv_active': 'network/ble/ble_hs/ble_gap/functions/ble_gap_adv_active.md'
+                    - 'ble_gap_adv_rsp_set_fields': 'network/ble/ble_hs/ble_gap/functions/ble_gap_adv_rsp_set_fields.md'
+                    - 'ble_gap_adv_set_fields': 'network/ble/ble_hs/ble_gap/functions/ble_gap_adv_set_fields.md'
+                    - 'ble_gap_adv_start': 'network/ble/ble_hs/ble_gap/functions/ble_gap_adv_start.md'
+                    - 'ble_gap_adv_stop': 'network/ble/ble_hs/ble_gap/functions/ble_gap_adv_stop.md'
+                    - 'ble_gap_conn_active': 'network/ble/ble_hs/ble_gap/functions/ble_gap_conn_active.md'
+                    - 'ble_gap_conn_cancel': 'network/ble/ble_hs/ble_gap/functions/ble_gap_conn_cancel.md'
+                    - 'ble_gap_conn_find': 'network/ble/ble_hs/ble_gap/functions/ble_gap_conn_find.md'
+                    - 'ble_gap_connect': 'network/ble/ble_hs/ble_gap/functions/ble_gap_connect.md'
+                    - 'ble_gap_disc': 'network/ble/ble_hs/ble_gap/functions/ble_gap_disc.md'
+                    - 'ble_gap_disc_active': 'network/ble/ble_hs/ble_gap/functions/ble_gap_disc_active.md'
+                    - 'ble_gap_disc_cancel': 'network/ble/ble_hs/ble_gap/functions/ble_gap_disc_cancel.md'
+                    - 'ble_gap_security_initiate': 'network/ble/ble_hs/ble_gap/functions/ble_gap_security_initiate.md'
+                    - 'ble_gap_terminate': 'network/ble/ble_hs/ble_gap/functions/ble_gap_terminate.md'
+                    - 'ble_gap_update_params': 'network/ble/ble_hs/ble_gap/functions/ble_gap_update_params.md'
+                    - 'ble_gap_wl_set': 'network/ble/ble_hs/ble_gap/functions/ble_gap_wl_set.md'
+
+            - 'GATT client':
+                - toc: 'network/ble/ble_hs/ble_gattc/ble_gattc.md'
+                - 'Definitions':
+                    - 'GATT client definitions': 'network/ble/ble_hs/ble_gattc/definitions/ble_gattc_defs.md'
+                - 'Functions':
+                    - 'ble_gattc': 'network/ble/ble_hs/ble_gattc/ble_gattc.md'
+                    - 'ble_gattc_disc_all_chrs': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_chrs.md'
+                    - 'ble_gattc_disc_all_dscs': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_dscs.md'
+                    - 'ble_gattc_disc_all_svcs': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_svcs.md'
+                    - 'ble_gattc_disc_chrs_by_uuid': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_chrs_by_uuid.md'
+                    - 'ble_gattc_disc_svc_by_uuid': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_svc_by_uuid.md'
+                    - 'ble_gattc_exchange_mtu': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_exchange_mtu.md'
+                    - 'ble_gattc_find_inc_svcs': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_find_inc_svcs.md'
+                    - 'ble_gattc_notify': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify.md'
+                    - 'ble_gattc_notify_custom': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify_custom.md'
+                    - 'ble_gattc_read': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_read.md'
+                    - 'ble_gattc_read_by_uuid': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_by_uuid.md'
+                    - 'ble_gattc_read_long': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_long.md'
+                    - 'ble_gattc_read_mult': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_mult.md'
+                    - 'ble_gattc_write': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_write.md'
+                    - 'ble_gattc_write_long': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_long.md'
+                    - 'ble_gattc_write_no_rsp': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_no_rsp.md'
+                    - 'ble_gattc_write_reliable': 'network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_reliable.md'
+
+            - 'GATT server':
+                - toc: 'network/ble/ble_hs/ble_gatts/ble_gatts.md'
+                - 'Definitions':
+                    - 'GATT server definitions': 'network/ble/ble_hs/ble_gatts/definitions/ble_gatts_defs.md'
+                - 'Functions':
+                    - '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'
+
+            - 'Identity':
+                - toc: 'network/ble/ble_hs/ble_hs_id/ble_hs_id.md'
+                - 'Functions':
+                    - 'ble_hs_id_copy_addr': 'network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_copy_addr.md'
+                    - 'ble_hs_id_set_rnd': 'network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_set_rnd.md'
+                    - 'ble_hs_id_gen_rnd': 'network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_gen_rnd.md'
+
+            - 'Other':
+                - toc: 'network/ble/ble_hs/other/other.md'
+                - 'Functions':
+                    - 'ble_eddystone_set_adv_data_uid': 'network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_uid.md'
+                    - 'ble_uuid_16_to_128': 'network/ble/ble_hs/other/functions/ble_uuid_16_to_128.md'
+                    - 'ble_ibeacon_set_adv_data': 'network/ble/ble_hs/other/functions/ble_ibeacon_set_adv_data.md'
+                    - 'ble_eddystone_set_adv_data_url': 'network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_url.md'
+                    - 'ble_uuid_128_to_16': 'network/ble/ble_hs/other/functions/ble_uuid_128_to_16.md'
+
         - API for bletiny app:
             - toc: 'network/ble/bletiny_api.md'
             - 'GAP in bletiny': 'network/ble/bletiny/bletiny_GAP.md'


[2/5] incubator-mynewt-site git commit: BLE Host API reference.

Posted by ad...@apache.org.
BLE Host API reference.


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

Branch: refs/heads/develop
Commit: e0b9d12e6ce4885184f866d190c972c23689e161
Parents: a205cf2
Author: Christopher Collins <cc...@apache.org>
Authored: Thu Jul 7 18:08:29 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Thu Jul 7 18:08:29 2016 -0700

----------------------------------------------------------------------
 docs/network/ble/ble_hs/ble_gap/ble_gap.md      |  36 +++
 .../ble_hs/ble_gap/definitions/ble_gap_defs.md  | 318 +++++++++++++++++++
 .../ble_gap/functions/ble_gap_adv_active.md     |  21 ++
 .../functions/ble_gap_adv_rsp_set_fields.md     |  25 ++
 .../ble_gap/functions/ble_gap_adv_set_fields.md |  25 ++
 .../ble_gap/functions/ble_gap_adv_start.md      |  32 ++
 .../ble_gap/functions/ble_gap_adv_stop.md       |  22 ++
 .../ble_gap/functions/ble_gap_conn_active.md    |  21 ++
 .../ble_gap/functions/ble_gap_conn_cancel.md    |  21 ++
 .../ble_gap/functions/ble_gap_conn_find.md      |  24 ++
 .../ble_hs/ble_gap/functions/ble_gap_connect.md |  32 ++
 .../ble_hs/ble_gap/functions/ble_gap_disc.md    |  29 ++
 .../ble_gap/functions/ble_gap_disc_active.md    |  21 ++
 .../ble_gap/functions/ble_gap_disc_cancel.md    |  22 ++
 .../functions/ble_gap_security_initiate.md      |  25 ++
 .../ble_gap/functions/ble_gap_terminate.md      |  25 ++
 .../ble_gap/functions/ble_gap_update_params.md  |  27 ++
 .../ble_hs/ble_gap/functions/ble_gap_wl_set.md  |  25 ++
 docs/network/ble/ble_hs/ble_gattc/ble_gattc.md  |  37 +++
 .../ble_gattc/definitions/ble_gattc_defs.md     |  82 +++++
 .../functions/ble_gattc_disc_all_chrs.md        |  29 ++
 .../functions/ble_gattc_disc_all_dscs.md        |  29 ++
 .../functions/ble_gattc_disc_all_svcs.md        |  23 ++
 .../functions/ble_gattc_disc_chrs_by_uuid.md    |  30 ++
 .../functions/ble_gattc_disc_svc_by_uuid.md     |  27 ++
 .../functions/ble_gattc_exchange_mtu.md         |  25 ++
 .../functions/ble_gattc_find_inc_svcs.md        |  29 ++
 .../ble_gattc/functions/ble_gattc_notify.md     |  24 ++
 .../functions/ble_gattc_notify_custom.md        |  27 ++
 .../ble_gattc/functions/ble_gattc_read.md       |  27 ++
 .../functions/ble_gattc_read_by_uuid.md         |  29 ++
 .../ble_gattc/functions/ble_gattc_read_long.md  |  27 ++
 .../ble_gattc/functions/ble_gattc_read_mult.md  |  29 ++
 .../ble_gattc/functions/ble_gattc_write.md      |  29 ++
 .../ble_gattc/functions/ble_gattc_write_long.md |  30 ++
 .../functions/ble_gattc_write_no_rsp.md         |  27 ++
 .../functions/ble_gattc_write_reliable.md       |  27 ++
 docs/network/ble/ble_hs/ble_gatts/ble_gatts.md  |  24 ++
 .../ble_gatts/definitions/ble_gatts_defs.md     | 187 +++++++++++
 .../ble_gatts/functions/ble_gatts_find_chr.md   |  27 ++
 .../ble_gatts/functions/ble_gatts_find_dsc.md   |  27 ++
 .../ble_gatts/functions/ble_gatts_find_svc.md   |  24 ++
 .../functions/ble_gatts_register_svcs.md        |  27 ++
 docs/network/ble/ble_hs/ble_hs.md               |  22 ++
 docs/network/ble/ble_hs/ble_hs_id/ble_hs_id.md  |  42 +++
 .../ble_hs_id/functions/ble_hs_id_copy_addr.md  |  28 ++
 .../ble_hs_id/functions/ble_hs_id_gen_rnd.md    |  24 ++
 .../ble_hs_id/functions/ble_hs_id_set_rnd.md    |  23 ++
 docs/network/ble/ble_hs/ble_hs_return_codes.md  | 290 +++++++++++++++++
 .../ble/ble_hs/init/definitions/init_defs.md    | 147 +++++++++
 .../ble/ble_hs/init/functions/ble_hs_init.md    |  24 ++
 .../ble/ble_hs/init/functions/ble_hs_start.md   |  21 ++
 docs/network/ble/ble_hs/init/init.md            |  22 ++
 .../functions/ble_eddystone_set_adv_data_uid.md |  26 ++
 .../functions/ble_eddystone_set_adv_data_url.md |  31 ++
 .../other/functions/ble_ibeacon_set_adv_data.md |  26 ++
 .../other/functions/ble_uuid_128_to_16.md       |  23 ++
 .../other/functions/ble_uuid_16_to_128.md       |  24 ++
 docs/network/ble/ble_hs/other/other.md          |  25 ++
 mkdocs.yml                                      |  84 +++++
 60 files changed, 2536 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/ble_gap.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/ble_gap.md b/docs/network/ble/ble_hs/ble_gap/ble_gap.md
new file mode 100644
index 0000000..bcc142f
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/ble_gap.md
@@ -0,0 +1,36 @@
+## <font color="F2853F" style="font-size:24pt">NimBLE Host GAP Reference</font>
+
+### Introduction
+
+The Generic Access Profile (GAP) is responsible for all connecting, advertising, scanning, and connection updating operations.
+
+### Header
+
+```c
+#include "host/ble_hs.h"
+```
+
+### Definitions
+
+[BLE host GAP definitions](definitions/ble_gap_defs.md)
+
+### Functions
+
+| Function | Description |
+|----------|-------------|
+| [ble_gap_adv_active](functions/ble_gap_adv_active.md) | Indicates whether an advertisement procedure is currently in progress. |
+| [ble_gap_adv_rsp_set_fields](functions/ble_gap_adv_rsp_set_fields.md) | Configures the data to include in subsequent scan responses. |
+| [ble_gap_adv_set_fields](functions/ble_gap_adv_set_fields.md) | Configures the data to include in subsequent advertisements. |
+| [ble_gap_adv_start](functions/ble_gap_adv_start.md) | Initiates advertising. |
+| [ble_gap_adv_stop](functions/ble_gap_adv_stop.md) | Stops the currently-active advertising procedure. |
+| [ble_gap_conn_active](functions/ble_gap_conn_active.md) | Indicates whether a connect procedure is currently in progress. |
+| [ble_gap_conn_cancel](functions/ble_gap_conn_cancel.md) | Aborts a connect procedure in progress. |
+| [ble_gap_conn_find](functions/ble_gap_conn_find.md) | Searches for a connection with the specified handle. |
+| [ble_gap_connect](functions/ble_gap_connect.md) | Initiates a connect procedure. |
+| [ble_gap_disc](functions/ble_gap_disc.md) | Performs the Limited or General Discovery Procedures. |
+| [ble_gap_disc_active](functions/ble_gap_disc_active.md) | Indicates whether a discovery procedure is currently in progress. |
+| [ble_gap_disc_cancel](functions/ble_gap_disc_cancel.md) | Cancels the discovery procedure currently in progress. |
+| [ble_gap_security_initiate](functions/ble_gap_security_initiate.md) | Initiates the GAP encryption procedure. |
+| [ble_gap_terminate](functions/ble_gap_terminate.md) | Terminates an established connection. |
+| [ble_gap_update_params](functions/ble_gap_update_params.md) | Initiates a connection parameter update procedure. |
+ [ble_gap_wl_set](functions/ble_gap_wl_set.md) | Overwrites the controller's white list with the specified contents. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/definitions/ble_gap_defs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/definitions/ble_gap_defs.md b/docs/network/ble/ble_hs/ble_gap/definitions/ble_gap_defs.md
new file mode 100644
index 0000000..8c6b6b3
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/definitions/ble_gap_defs.md
@@ -0,0 +1,318 @@
+## <font color="#F2853F" style="font-size:24pt">GAP events</font>
+
+```c
+typedef int ble_gap_event_fn(struct ble_gap_event *ctxt, void *arg);
+```
+
+```c
+#define BLE_GAP_EVENT_CONNECT               0
+#define BLE_GAP_EVENT_DISCONNECT            1
+#define BLE_GAP_EVENT_CONN_CANCEL           2
+#define BLE_GAP_EVENT_CONN_UPDATE           3
+#define BLE_GAP_EVENT_CONN_UPDATE_REQ       4
+#define BLE_GAP_EVENT_L2CAP_UPDATE_REQ      5
+#define BLE_GAP_EVENT_TERM_FAILURE          6
+#define BLE_GAP_EVENT_DISC                  7
+#define BLE_GAP_EVENT_DISC_COMPLETE         8
+#define BLE_GAP_EVENT_ADV_COMPLETE          9
+#define BLE_GAP_EVENT_ENC_CHANGE            10
+#define BLE_GAP_EVENT_PASSKEY_ACTION        11
+#define BLE_GAP_EVENT_NOTIFY                12
+```
+
+```c
+
+/**
+ * Represents a GAP-related event.  When such an event occurs, the host
+ * notifies the application by passing an instance of this structure to an
+ * application-specified callback.
+ */
+struct ble_gap_event {
+    /**
+     * Indicates the type of GAP event that occurred.  This is one of the
+     * BLE_GAP_EVENT codes.
+     */
+    uint8_t type;
+
+    /**
+     * A discriminated union containing additional details concerning the GAP
+     * event.  The 'type' field indicates which member of the union is valid.
+     */
+    union {
+        /**
+         * Represents a connection attempt.  Valid for the following event
+         * types:
+         *     o BLE_GAP_EVENT_CONNECT
+         */
+        struct {
+            /**
+             * The status of the connection attempt;
+             *     o 0: the connection was successfully established.
+             *     o BLE host error code: the connection attempt failed for
+             *       the specified reason.
+             */
+            int status;
+
+            /**
+             * Information about the established connection.  Only valid on
+             * success.
+             */
+            struct ble_gap_conn_desc conn;
+        } connect;
+
+        /**
+         * Represents a terminated connection.  Valid for the following event
+         * types:
+         *     o BLE_GAP_EVENT_DISCONNECT
+         */
+        struct {
+            /**
+             * A BLE host return code indicating the reason for the
+             * disconnect.
+             */
+            int reason;
+
+            /** Information about the terminated connection. */
+            struct ble_gap_conn_desc conn;
+        } disconnect;
+
+        /**
+         * Represents an advertising report received during a discovery
+         * procedure.  Valid for the following event types:
+         *     o BLE_GAP_EVENT_DISC
+         */
+        struct ble_gap_disc_desc disc;
+
+        /**
+         * Represents an attempt to update a connection's parameters.  Valid
+         * for the following event types:
+         *     o BLE_GAP_EVENT_CONN_UPDATE
+         */
+        struct {
+            /**
+             * The result of the connection update attempt;
+             *     o 0: the connection was successfully updated.
+             *     o BLE host error code: the connection update attempt failed
+             *       for the specified reason.
+             */
+            int status;
+
+            /**
+             * Information about the relevant connection.  If the connection
+             * update attempt was successful, this descriptor contains the
+             * updated parameters.
+             */
+            struct ble_gap_conn_desc conn;
+        } conn_update;
+
+        /**
+         * Represents a peer's request to update the connection parameters.
+         * This event is generated when a peer performs any of the following
+         * procedures:
+         *     o L2CAP Connection Parameter Update Procedure
+         *     o Link-Layer Connection Parameters Request Procedure
+         *
+         * Valid for the following event types:
+         *     o BLE_GAP_EVENT_L2CAP_UPDATE_REQ
+         *     o BLE_GAP_EVENT_CONN_UPDATE_REQ
+         * 
+         */
+        struct {
+            /**
+             * Indicates the connection parameters that the peer would like to
+             * use.
+             */
+            const struct ble_gap_upd_params *peer_params;
+
+            /**
+             * Indicates the connection parameters that the local device would
+             * like to use.  The application callback should fill this in.  By
+             * default, this struct contains the requested parameters (i.e.,
+             * it is a copy of 'peer_params').
+             */
+            struct ble_gap_upd_params *self_params;
+
+            /** Information about the relevant connection. */
+            struct ble_gap_conn_desc conn;
+        } conn_update_req;
+
+        /**
+         * Represents a failed attempt to terminate an established connection.
+         * Valid for the following event types:
+         *     o BLE_GAP_EVENT_TERM_FAILURE
+         */
+        struct {
+            /**
+             * A BLE host return code indicating the reason for the failure.
+             */
+            int status;
+
+            /** Information about the relevant connection. */
+            struct ble_gap_conn_desc conn;
+        } term_failure;
+
+        /**
+         * Represents an attempt to change the encrypted state of a
+         * connection.  Valid for the following event types:
+         *     o BLE_GAP_EVENT_ENC_CHANGE
+         */
+        struct {
+            /**
+             * Indicates the result of the encryption state change attempt;
+             *     o 0: the encrypted state was successfully updated;
+             *     o BLE host error code: the encryption state change attempt
+             *       failed for the specified reason.
+             */
+            int status;
+
+            /**
+             * Information about the relevant connection.  If the encryption
+             * state change attempt was successful, this descriptor reflects
+             * the updated state.
+             */
+            struct ble_gap_conn_desc conn;
+        } enc_change;
+
+        /**
+         * Represents a passkey query needed to complete a pairing procedure.
+         * Valid for the following event types:
+         *     o BLE_GAP_EVENT_PASSKEY_ACTION
+         */
+        struct {
+            /** Contains details about the passkey query. */
+            struct ble_gap_passkey_params params;
+
+            /** Information about the relevant connection. */
+            struct ble_gap_conn_desc conn;
+        } passkey;
+
+        /**
+         * Represents a received ATT notification or indication.
+         * Valid for the following event types:
+         *     o BLE_GAP_EVENT_NOTIFY
+         */
+        struct {
+            /** The handle of the relevant ATT attribute. */
+            uint16_t attr_handle;
+
+            /** The contents of the notification or indication. */
+            void *attr_data;
+
+            /** The number of data bytes contained in the message. */
+            uint16_t attr_len;
+
+            /** Information about the relevant connection. */
+            struct ble_gap_conn_desc conn;
+
+            /**
+             * Whether the received command is a notification or an
+             * indication;
+             *     o 0: Notification;
+             *     o 1: Indication.
+             */
+            unsigned indication:1;
+        } notify;
+    };
+};
+```
+
+```c
+struct ble_gap_sec_state {
+    unsigned encrypted:1;
+    unsigned authenticated:1;
+    unsigned bonded:1;
+};
+```
+
+```c
+/**
+ * @param discoverable_mode     One of the following constants:
+ *                                  o BLE_GAP_DISC_MODE_NON
+ *                                      (non-discoverable; 3.C.9.2.2).
+ *                                  o BLE_GAP_DISC_MODE_LTD
+ *                                      (limited-discoverable; 3.C.9.2.3).
+ *                                  o BLE_GAP_DISC_MODE_GEN
+ *                                      (general-discoverable; 3.C.9.2.4).
+ * @param connectable_mode      One of the following constants:
+ *                                  o BLE_GAP_CONN_MODE_NON
+ *                                      (non-connectable; 3.C.9.3.2).
+ *                                  o BLE_GAP_CONN_MODE_DIR
+ *                                      (directed-connectable; 3.C.9.3.3).
+ *                                  o BLE_GAP_CONN_MODE_UND
+ *                                      (undirected-connectable; 3.C.9.3.4).
+ */
+struct ble_gap_adv_params {
+    /*** Mandatory fields. */
+    uint8_t conn_mode;
+    uint8_t disc_mode;
+
+    /*** Optional fields; assign 0 to make the stack calculate them. */
+    uint16_t itvl_min;
+    uint16_t itvl_max;
+    uint8_t channel_map;
+    uint8_t filter_policy;
+    uint8_t high_duty_cycle:1;
+};
+```
+
+```c
+struct ble_gap_conn_desc {
+    struct ble_gap_sec_state sec_state;
+    uint8_t peer_ota_addr[6];
+    uint8_t peer_id_addr[6];
+    uint8_t our_id_addr[6];
+    uint8_t our_ota_addr[6];
+    uint16_t conn_handle;
+    uint16_t conn_itvl;
+    uint16_t conn_latency;
+    uint16_t supervision_timeout;
+    uint8_t peer_ota_addr_type;
+    uint8_t peer_id_addr_type;
+    uint8_t our_id_addr_type;
+    uint8_t our_ota_addr_type;
+    uint8_t role;
+    uint8_t master_clock_accuracy;
+};
+```
+
+```c
+struct ble_gap_conn_params {
+    uint16_t scan_itvl;
+    uint16_t scan_window;
+    uint16_t itvl_min;
+    uint16_t itvl_max;
+    uint16_t latency;
+    uint16_t supervision_timeout;
+    uint16_t min_ce_len;
+    uint16_t max_ce_len;
+};
+```
+
+```c
+struct ble_gap_disc_params {
+    uint16_t itvl;
+    uint16_t window;
+    uint8_t filter_policy;
+    uint8_t limited:1;
+    uint8_t passive:1;
+    uint8_t filter_duplicates:1;
+};
+```
+
+```c
+struct ble_gap_upd_params {
+    uint16_t itvl_min;
+    uint16_t itvl_max;
+    uint16_t latency;
+    uint16_t supervision_timeout;
+    uint16_t min_ce_len;
+    uint16_t max_ce_len;
+};
+```
+
+```c
+struct ble_gap_passkey_params {
+    uint8_t action;
+    uint32_t numcmp;
+};
+```

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_active.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_active.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_active.md
new file mode 100644
index 0000000..df103ab
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_active.md
@@ -0,0 +1,21 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_adv\_active</font>
+
+```c
+int
+ble_gap_adv_active(void)
+```
+
+### Description
+
+Indicates whether an advertisement procedure is currently in progress. 
+
+### Parameters
+
+None
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | No advertisement procedure in progress. |
+| 1 | Advertisement procedure in progress. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_rsp_set_fields.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_rsp_set_fields.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_rsp_set_fields.md
new file mode 100644
index 0000000..4333457
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_rsp_set_fields.md
@@ -0,0 +1,25 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_adv\_rsp\_set\_fields</font>
+
+```c
+int
+ble_gap_adv_rsp_set_fields(const struct ble_hs_adv_fields *rsp_fields)
+```
+
+### Description
+
+Configures the data to include in subsequent scan responses. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| adv\_fields | Specifies the scan response data. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EBUSY | Advertising is in progress. |
+| BLE\_HS\_EMSGSIZE | The specified data is too large to fit in an advertisement. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_set_fields.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_set_fields.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_set_fields.md
new file mode 100644
index 0000000..74d6d66
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_set_fields.md
@@ -0,0 +1,25 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_adv\_set\_fields</font>
+
+```c
+int
+ble_gap_adv_set_fields(const struct ble_hs_adv_fields *adv_fields)
+```
+
+### Description
+
+Configures the data to include in subsequent advertisements. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| adv\_fields | Specifies the advertisement data. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EBUSY | Advertising is in progress. |
+| BLE\_HS\_EMSGSIZE | The specified data is too large to fit in an advertisement. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_start.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_start.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_start.md
new file mode 100644
index 0000000..ce6bf5e
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_start.md
@@ -0,0 +1,32 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_adv\_start</font>
+
+```c
+int
+ble_gap_adv_start(uint8_t own_addr_type, uint8_t peer_addr_type,
+                  const uint8_t *peer_addr, int32_t duration_ms,
+                  const struct ble_gap_adv_params *adv_params,
+                  ble_gap_event_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates advertising. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| own\_addr\_type | The type of address the stack should use for itself.  Valid values are: <ul><li>BLE\_ADDR\_TYPE\_PUBLIC</li> <li>BLE\_ADDR\_TYPE\_RANDOM</li> <li>BLE\_ADDR\_TYPE\_RPA\_PUB\_DEFAULT</li> <li>BLE\_ADDR\_TYPE\_RPA\_RND\_DEFAULT</li></ul> |
+| peer\_addr\_type | Address type of the peer's identity address. Valid values are: <ul><li>BLE\_ADDR\_TYPE\_PUBLIC</li> <li>BLE\_ADDR\_TYPE\_RANDOM</li></ul> This parameter is ignored unless directed advertising is being used. |
+| peer\_addr | The peer's six-byte identity address. This parameter is ignored unless directed advertising is being used. |
+| duration\_ms | The duration of the advertisement procedure. On expiration, the procedure ends and a BLE\_GAP\_EVENT\_ADV\_COMPLETE event is reported.  Units are milliseconds.  Specify BLE\_HS\_FOREVER for no expiration. |
+| adv\_params | Additional arguments specifying the particulars of the advertising procedure. |
+| cb | The callback to associate with this advertising procedure.  If advertising ends, the event is reported through this callback.  If advertising results in a connection, the connection inherits this callback as its event-reporting mechanism. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_stop.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_stop.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_stop.md
new file mode 100644
index 0000000..adb3d87
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_stop.md
@@ -0,0 +1,22 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_adv\_stop</font>
+
+```c
+int
+ble_gap_adv_stop(void)
+```
+
+### Description
+
+Stops the currently-active advertising procedure.  A success return code indicates that advertising has been fully aborted; a new advertising procedure can be initiated immediately. 
+
+### Parameters
+
+None
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EALREADY | There is no active advertising procedure. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_active.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_active.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_active.md
new file mode 100644
index 0000000..22a7bff
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_active.md
@@ -0,0 +1,21 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_conn\_active</font>
+
+```c
+int
+ble_gap_conn_active(void)
+```
+
+### Description
+
+Indicates whether a connect procedure is currently in progress. 
+
+### Parameters
+
+None
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | No connect procedure in progress. |
+| 1 | Connect procedure in progress. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_cancel.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_cancel.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_cancel.md
new file mode 100644
index 0000000..4ce05c5
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_cancel.md
@@ -0,0 +1,21 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_conn\_cancel</font>
+
+```c
+int
+ble_gap_conn_cancel(void)
+```
+
+### Description
+
+Aborts a connect procedure in progress. 
+
+### Parameters
+
+None
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_find.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_find.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_find.md
new file mode 100644
index 0000000..e107e9f
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_find.md
@@ -0,0 +1,24 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_conn\_find</font>
+
+```c
+int
+ble_gap_conn_find(uint16_t handle, struct ble_gap_conn_desc *out_desc)
+```
+
+### Description
+
+Searches for a connection with the specified handle.  If a matching connection is found, the supplied connection descriptor is filled correspondingly. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| handle | The connection handle to search for. |
+| out\_desc | On success, this is populated with information relating to the matching connection.  Pass NULL if you don't need this information. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_ENOTCONN | No matching connection was found. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_connect.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_connect.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_connect.md
new file mode 100644
index 0000000..44b5b40
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_connect.md
@@ -0,0 +1,32 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_connect</font>
+
+```c
+int
+ble_gap_connect(uint8_t own_addr_type,
+                uint8_t peer_addr_type, const uint8_t *peer_addr,
+                const struct ble_gap_conn_params *conn_params,
+                ble_gap_event_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates a connect procedure. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| own\_addr\_type | The type of address the stack should use for itself during connection establishment. <ul><li>BLE\_ADDR\_TYPE\_PUBLIC</li> <li>BLE\_ADDR\_TYPE\_RANDOM</li> <li>BLE\_ADDR\_TYPE\_RPA\_PUB\_DEFAULT</li> <li>BLE\_ADDR\_TYPE\_RPA\_RND\_DEFAULT</li></ul> |
+| peer\_addr\_type | The peer's address type.  One of: <ul><li>BLE\_HCI\_CONN\_PEER\_ADDR\_PUBLIC</li> <li>BLE\_HCI\_CONN\_PEER\_ADDR\_RANDOM</li> <li>BLE\_HCI\_CONN\_PEER\_ADDR\_PUBLIC\_IDENT</li> <li>BLE\_HCI\_CONN\_PEER\_ADDR\_RANDOM\_IDENT</li> <li>BLE\_GAP\_ADDR\_TYPE\_WL</li></ul> |
+| peer\_addr | The identity address of the peer to connect to. This parameter is ignored when the white list is used. |
+| duration\_ms | The duration of the discovery procedure. On expiration, the procedure ends and a BLE\_GAP\_EVENT\_DISC\_COMPLETE event is reported.  Units are milliseconds. |
+| conn\_params | Additional arguments specifying the particulars of the connect procedure.  Specify null for default values. |
+| cb | The callback to associate with this connect procedure.  When the connect procedure completes, the result is reported through this callback.  If the connect procedure succeeds, the connection inherits this callback as its event-reporting mechanism. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc.md
new file mode 100644
index 0000000..d4cd67a
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc.md
@@ -0,0 +1,29 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_disc</font>
+
+```c
+int
+ble_gap_disc(uint8_t own_addr_type, int32_t duration_ms,
+             const struct ble_gap_disc_params *disc_params,
+             ble_gap_event_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Performs the Limited or General Discovery Procedures. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| own\_addr\_type | The type of address the stack should use for itself when sending scan requests.  Valid values are: <ul><li>BLE\_ADDR\_TYPE\_PUBLIC</li> <li>BLE\_ADDR\_TYPE\_RANDOM</li> <li>BLE\_ADDR\_TYPE\_RPA\_PUB\_DEFAULT</li> <li>BLE\_ADDR\_TYPE\_RPA\_RND\_DEFAULT</li></ul> This parameter is ignored unless active scanning is being used. |
+| duration\_ms | The duration of the discovery procedure. On expiration, the procedure ends and a BLE\_GAP\_EVENT\_DISC\_COMPLETE event is reported.  Units are milliseconds.  Specify BLE\_HS\_FOREVER for no expiration. |
+| disc\_params | Additional arguments specifying the particulars of the discovery procedure. |
+| cb | The callback to associate with this discovery procedure.  Advertising reports and discovery termination events are reported through this callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc_active.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc_active.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc_active.md
new file mode 100644
index 0000000..a094ab9
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc_active.md
@@ -0,0 +1,21 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_disc\_active</font>
+
+```c
+int
+ble_gap_disc_active(void)
+```
+
+### Description
+
+Indicates whether a discovery procedure is currently in progress. 
+
+### Parameters
+
+None
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | No discovery procedure in progress. |
+| 1 | Discovery procedure in progress. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc_cancel.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc_cancel.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc_cancel.md
new file mode 100644
index 0000000..f89b461
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_disc_cancel.md
@@ -0,0 +1,22 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_disc\_cancel</font>
+
+```c
+int
+ble_gap_disc_cancel(void)
+```
+
+### Description
+
+Cancels the discovery procedure currently in progress.  A success return code indicates that scanning has been fully aborted; a new discovery or connect procedure can be initiated immediately. 
+
+### Parameters
+
+None
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EALREADY | There is no discovery procedure to cancel. |
+| other | Other nonzero on unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_security_initiate.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_security_initiate.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_security_initiate.md
new file mode 100644
index 0000000..7e23d99
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_security_initiate.md
@@ -0,0 +1,25 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_security\_initiate</font>
+
+```c
+int
+ble_gap_security_initiate(uint16_t conn_handle)
+```
+
+### Description
+
+Initiates the GAP encryption procedure. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The handle corresponding to the connection to encrypt. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_ENOTCONN | The there is no connection with the specified handle. |
+| BLE\_HS\_EALREADY | An encrpytion procedure for this connection is already in progress. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_terminate.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_terminate.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_terminate.md
new file mode 100644
index 0000000..4797f74
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_terminate.md
@@ -0,0 +1,25 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_terminate</font>
+
+```c
+int
+ble_gap_terminate(uint16_t conn_handle, uint8_t hci_reason)
+```
+
+### Description
+
+Terminates an established connection. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The handle corresponding to the connection to terminate. |
+| hci\_reason | The HCI error code to indicate as the reason for termination. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_ENOTCONN | There is no connection with the specified handle. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_update_params.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_update_params.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_update_params.md
new file mode 100644
index 0000000..6f5547d
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_update_params.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_update\_params</font>
+
+```c
+int
+ble_gap_update_params(uint16_t conn_handle,
+                      const struct ble_gap_upd_params *params)
+```
+
+### Description
+
+Initiates a connection parameter update procedure. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The handle corresponding to the connection to update. |
+| params | The connection parameters to attempt to update to. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_ENOTCONN | The there is no connection with the specified handle. |
+| BLE\_HS\_EALREADY | A connection update procedure for this connection is already in progress. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_wl_set.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_wl_set.md b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_wl_set.md
new file mode 100644
index 0000000..5876cfb
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gap/functions/ble_gap_wl_set.md
@@ -0,0 +1,25 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gap\_wl\_set</font>
+
+```c
+int
+ble_gap_wl_set(const struct ble_gap_white_entry *white_list,
+               uint8_t white_list_count)
+```
+
+### Description
+
+Overwrites the controller's white list with the specified contents. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| white\_list | The entries to write to the white list. |
+| white\_list\_count | The number of entries in the white list. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/ble_gattc.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/ble_gattc.md b/docs/network/ble/ble_hs/ble_gattc/ble_gattc.md
new file mode 100644
index 0000000..9ed260c
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/ble_gattc.md
@@ -0,0 +1,37 @@
+## <font color="F2853F" style="font-size:24pt">NimBLE Host GATT Client Reference</font>
+
+### Introduction
+
+The Generic Attribute Profile (GATT) manages all activities involving services, characteristics, and descriptors.  The client half of the GATT API initiates GATT procedures.
+
+### Header
+
+```c
+#include "host/ble_hs.h"
+```
+
+### Definitions
+
+[BLE host GATT client definitions](definitions/ble_gattc_defs.md)
+
+### Functions
+
+| Function | Description |
+|----------|-------------|
+| [ble_gattc_disc_all_chrs](functions/ble_gattc_disc_all_chrs.md) | Initiates GATT procedure: Discover All Characteristics of a Service. |
+| [ble_gattc_disc_all_dscs](functions/ble_gattc_disc_all_dscs.md) | Initiates GATT procedure: Discover All Characteristic Descriptors. |
+| [ble_gattc_disc_all_svcs](functions/ble_gattc_disc_all_svcs.md) | Initiates GATT procedure: Discover All Primary Services. |
+| [ble_gattc_disc_chrs_by_uuid](functions/ble_gattc_disc_chrs_by_uuid.md) | Initiates GATT procedure: Discover Characteristics by UUID. |
+| [ble_gattc_disc_svc_by_uuid](functions/ble_gattc_disc_svc_by_uuid.md) | Initiates GATT procedure: Discover Primary Service by Service UUID. |
+| [ble_gattc_exchange_mtu](functions/ble_gattc_exchange_mtu.md) | Initiates GATT procedure: Exchange MTU. |
+| [ble_gattc_find_inc_svcs](functions/ble_gattc_find_inc_svcs.md) | Initiates GATT procedure: Find Included Services. |
+| [ble_gattc_notify](functions/ble_gattc_notify.md) | Sends a characteristic notification. |
+| [ble_gattc_notify_custom](functions/ble_gattc_notify_custom.md) | Sends a "free-form" characteristic notification. |
+| [ble_gattc_read](functions/ble_gattc_read.md) | Initiates GATT procedure: Read Characteristic Value. |
+| [ble_gattc_read_by_uuid](functions/ble_gattc_read_by_uuid.md) | Initiates GATT procedure: Read Using Characteristic UUID. |
+| [ble_gattc_read_long](functions/ble_gattc_read_long.md) | Initiates GATT procedure: Read Long Characteristic Values. |
+| [ble_gattc_read_mult](functions/ble_gattc_read_mult.md) | Initiates GATT procedure: Read Multiple Characteristic Values. |
+| [ble_gattc_write](functions/ble_gattc_write.md) | Initiates GATT procedure: Write Characteristic Value. |
+| [ble_gattc_write_long](functions/ble_gattc_write_long.md) | Initiates GATT procedure: Write Long Characteristic Values. |
+| [ble_gattc_write_no_rsp](functions/ble_gattc_write_no_rsp.md) | Initiates GATT procedure: Write Without Response. |
+| [ble_gattc_write_reliable](functions/ble_gattc_write_reliable.md) | Initiates GATT procedure: Reliable Writes. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/definitions/ble_gattc_defs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/definitions/ble_gattc_defs.md b/docs/network/ble/ble_hs/ble_gattc/definitions/ble_gattc_defs.md
new file mode 100644
index 0000000..089761a
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/definitions/ble_gattc_defs.md
@@ -0,0 +1,82 @@
+## <font color="#F2853F" style="font-size:24pt">GATT Client Definitions</font>
+
+```c
+struct ble_gatt_error {
+    uint16_t status;
+    uint16_t att_handle;
+};
+```
+
+```c
+struct ble_gatt_svc {
+    uint16_t start_handle;
+    uint16_t end_handle;
+    uint8_t uuid128[16];
+};
+```
+
+```c
+struct ble_gatt_attr {
+    uint16_t handle;
+    uint16_t offset;
+    uint16_t value_len;
+    const void *value;
+};
+```
+
+```c
+struct ble_gatt_chr {
+    uint16_t def_handle;
+    uint16_t val_handle;
+    uint8_t properties;
+    uint8_t uuid128[16];
+};
+```
+
+```c
+struct ble_gatt_dsc {
+    uint16_t handle;
+    uint8_t uuid128[16];
+};
+```
+
+```c
+typedef int ble_gatt_mtu_fn(uint16_t conn_handle,
+                            const struct ble_gatt_error *error,
+                            uint16_t mtu, void *arg);
+```
+
+```c
+typedef int ble_gatt_disc_svc_fn(uint16_t conn_handle,
+                                 const struct ble_gatt_error *error,
+                                 const struct ble_gatt_svc *service,
+                                 void *arg);
+```
+
+```c
+typedef int ble_gatt_attr_fn(uint16_t conn_handle,
+                             const struct ble_gatt_error *error,
+                             const struct ble_gatt_attr *attr,
+                             void *arg);
+```
+
+```c
+typedef int ble_gatt_reliable_attr_fn(uint16_t conn_handle,
+                                      const struct ble_gatt_error *error,
+                                      const struct ble_gatt_attr *attrs,
+                                      uint8_t num_attrs, void *arg);
+```
+
+```c
+typedef int ble_gatt_chr_fn(uint16_t conn_handle,
+                            const struct ble_gatt_error *error,
+                            const struct ble_gatt_chr *chr, void *arg);
+```
+
+```c
+typedef int ble_gatt_dsc_fn(uint16_t conn_handle,
+                            const struct ble_gatt_error *error,
+                            uint16_t chr_def_handle,
+                            const struct ble_gatt_dsc *dsc,
+                            void *arg);
+```

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_chrs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_chrs.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_chrs.md
new file mode 100644
index 0000000..85b1032
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_chrs.md
@@ -0,0 +1,29 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_disc\_all\_chrs</font>
+
+```c
+int
+ble_gattc_disc_all_chrs(uint16_t conn_handle, uint16_t start_handle,
+                        uint16_t end_handle, ble_gatt_chr_fn *cb,
+                        void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Discover All Characteristics of a Service. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| start\_handle | The handle to begin the search at (generally the service definition handle). |
+| end\_handle | The handle to end the search at (generally the last handle in the service). |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_dscs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_dscs.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_dscs.md
new file mode 100644
index 0000000..f3a6380
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_dscs.md
@@ -0,0 +1,29 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_disc\_all\_dscs</font>
+
+```c
+int
+ble_gattc_disc_all_dscs(uint16_t conn_handle, uint16_t chr_def_handle,
+                        uint16_t chr_end_handle,
+                        ble_gatt_dsc_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Discover All Characteristic Descriptors. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| chr\_def\_handle | The handle of the characteristic definition attribute. |
+| chr\_end\_handle | The last handle in the characteristic definition. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_svcs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_svcs.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_svcs.md
new file mode 100644
index 0000000..bf37569
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_all_svcs.md
@@ -0,0 +1,23 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_disc\_all\_svcs</font>
+
+```c
+int
+ble_gattc_disc_all_svcs(uint16_t conn_handle, ble_gatt_disc_svc_fn *cb,
+                        void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Discover All Primary Services. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+None

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_chrs_by_uuid.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_chrs_by_uuid.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_chrs_by_uuid.md
new file mode 100644
index 0000000..9db26ee
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_chrs_by_uuid.md
@@ -0,0 +1,30 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_disc\_chrs\_by\_uuid</font>
+
+```c
+int
+ble_gattc_disc_chrs_by_uuid(uint16_t conn_handle, uint16_t start_handle,
+                            uint16_t end_handle, const void *uuid128,
+                            ble_gatt_chr_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Discover Characteristics by UUID. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| start\_handle | The handle to begin the search at (generally the service definition handle). |
+| end\_handle | The handle to end the search at (generally the last handle in the service). |
+| chr\_uuid128 | The 128-bit UUID of the characteristic to discover. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_svc_by_uuid.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_svc_by_uuid.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_svc_by_uuid.md
new file mode 100644
index 0000000..bd3b308
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_disc_svc_by_uuid.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_disc\_svc\_by\_uuid</font>
+
+```c
+int
+ble_gattc_disc_svc_by_uuid(uint16_t conn_handle, const void *svc_uuid128,
+                           ble_gatt_disc_svc_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Discover Primary Service by Service UUID. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| service\_uuid128 | The 128-bit UUID of the service to discover. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_exchange_mtu.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_exchange_mtu.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_exchange_mtu.md
new file mode 100644
index 0000000..81de2b4
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_exchange_mtu.md
@@ -0,0 +1,25 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_exchange\_mtu</font>
+
+```c
+int
+ble_gattc_exchange_mtu(uint16_t conn_handle, ble_gatt_mtu_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Exchange MTU. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_find_inc_svcs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_find_inc_svcs.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_find_inc_svcs.md
new file mode 100644
index 0000000..9aaa630
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_find_inc_svcs.md
@@ -0,0 +1,29 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_find\_inc\_svcs</font>
+
+```c
+int
+ble_gattc_find_inc_svcs(uint16_t conn_handle, uint16_t start_handle,
+                        uint16_t end_handle,
+                        ble_gatt_disc_svc_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Find Included Services. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| start\_handle | The handle to begin the search at (generally the service definition handle). |
+| end\_handle | The handle to end the search at (generally the last handle in the service). |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify.md
new file mode 100644
index 0000000..6545cce
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify.md
@@ -0,0 +1,24 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_notify</font>
+
+```c
+int
+ble_gattc_notify(uint16_t conn_handle, uint16_t chr_val_handle)
+```
+
+### Description
+
+Sends a characteristic notification.  The content of the message is read from the specified characteristic. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| chr\_val\_handle | The value attribute handle of the characteristic to include in the outgoing notification. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify_custom.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify_custom.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify_custom.md
new file mode 100644
index 0000000..c9820e8
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_notify_custom.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_notify\_custom</font>
+
+```c
+int
+ble_gattc_notify_custom(uint16_t conn_handle, uint16_t chr_val_handle,
+                        const void *attr_data, uint16_t attr_data_len)
+```
+
+### Description
+
+Sends a "free-form" characteristic notification.  The content of the message is specified in the attr parameter. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| chr\_val\_handle | The attribute handle to indicate in the outgoing notification. |
+| attr\_data | The characteristic value to include in the outgoing notification. |
+| attr\_data\_len | The number of bytes of attribute data to include in the notification. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read.md
new file mode 100644
index 0000000..19d49b0
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_read</font>
+
+```c
+int
+ble_gattc_read(uint16_t conn_handle, uint16_t attr_handle,
+               ble_gatt_attr_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Read Characteristic Value. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| attr\_handle | The handle of the characteristic value to read. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_by_uuid.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_by_uuid.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_by_uuid.md
new file mode 100644
index 0000000..365ef78
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_by_uuid.md
@@ -0,0 +1,29 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_read\_by\_uuid</font>
+
+```c
+int
+ble_gattc_read_by_uuid(uint16_t conn_handle, uint16_t start_handle,
+                       uint16_t end_handle, const void *uuid128,
+                       ble_gatt_attr_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Read Using Characteristic UUID. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| start\_handle | The first handle to search (generally the handle of the service definition). |
+| end\_handle | The last handle to search (generally the last handle in the service definition). |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_long.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_long.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_long.md
new file mode 100644
index 0000000..89f8d73
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_long.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_read\_long</font>
+
+```c
+int
+ble_gattc_read_long(uint16_t conn_handle, uint16_t handle,
+                    ble_gatt_attr_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Read Long Characteristic Values. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| handle | The handle of the characteristic value to read. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_mult.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_mult.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_mult.md
new file mode 100644
index 0000000..2956d13
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_read_mult.md
@@ -0,0 +1,29 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_read\_mult</font>
+
+```c
+int
+ble_gattc_read_mult(uint16_t conn_handle, const uint16_t *handles,
+                    uint8_t num_handles, ble_gatt_attr_fn *cb,
+                    void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Read Multiple Characteristic Values. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| handles | An array of 16-bit attribute handles to read. |
+| num\_handles | The number of entries in the "handles" array. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write.md
new file mode 100644
index 0000000..ec074c1
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write.md
@@ -0,0 +1,29 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_write</font>
+
+```c
+int
+ble_gattc_write(uint16_t conn_handle, uint16_t attr_handle, const void *value,
+                uint16_t value_len, ble_gatt_attr_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Write Characteristic Value. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| attr\_handle | The handle of the characteristic value to write to. |
+| value | The value to write to the characteristic. |
+| value\_len | The number of bytes to write. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_long.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_long.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_long.md
new file mode 100644
index 0000000..69f1f89
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_long.md
@@ -0,0 +1,30 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_write\_long</font>
+
+```c
+int
+ble_gattc_write_long(uint16_t conn_handle, uint16_t attr_handle,
+                     const void *value, uint16_t value_len,
+                     ble_gatt_attr_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Write Long Characteristic Values. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| attr\_handle | The handle of the characteristic value to write to. |
+| value | The value to write to the characteristic. |
+| value\_len | The number of bytes to write. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_no_rsp.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_no_rsp.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_no_rsp.md
new file mode 100644
index 0000000..3983b8b
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_no_rsp.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_write\_no\_rsp</font>
+
+```c
+int
+ble_gattc_write_no_rsp(uint16_t conn_handle, uint16_t attr_handle,
+                       const void *value, uint16_t value_len)
+```
+
+### Description
+
+Initiates GATT procedure: Write Without Response. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| attr\_handle | The handle of the characteristic value to write to. |
+| value | The value to write to the characteristic. |
+| value\_len | The number of bytes to write. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| [BLE host core return code](../../ble_hs_return_codes/#return-codes-core) | Unexpected error. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_reliable.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_reliable.md b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_reliable.md
new file mode 100644
index 0000000..302eb99
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gattc/functions/ble_gattc_write_reliable.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gattc\_write\_reliable</font>
+
+```c
+int
+ble_gattc_write_reliable(uint16_t conn_handle,
+                         const struct ble_gatt_attr *attrs,
+                         int num_attrs, ble_gatt_reliable_attr_fn *cb,
+                         void *cb_arg)
+```
+
+### Description
+
+Initiates GATT procedure: Reliable Writes. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| conn\_handle | The connection over which to execute the procedure. |
+| attrs | An array of attribute descriptors; specifies which characteristics to write to and what data to write to them. |
+| num\_attrs | The number of characteristics to write; equal to the number of elements in the 'attrs' array. |
+| cb | The function to call to report procedure status updates; null for no callback. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+None

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/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
new file mode 100644
index 0000000..33123a9
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gatts/ble_gatts.md
@@ -0,0 +1,24 @@
+## <font color="F2853F" style="font-size:24pt">NimBLE Host GATT Client Reference</font>
+
+### Introduction
+
+The Generic Attribute Profile (GATT) manages all activities involving services, characteristics, and descriptors.  The server half of the GATT API handles registration and responding to GATT clients.
+
+### Header
+
+```c
+#include "host/ble_hs.h"
+```
+
+### Definitions
+
+[BLE host GATT server definitions](definitions/ble_gatts_defs.md)
+
+### Functions
+
+| Function | Description |
+|----------|-------------|
+| [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. |
+| [ble_gatts_find_svc](functions/ble_gatts_find_svc.md) | Retrieves the attribute handle associated with a local GATT service. |
+| [ble_gatts_register_svcs](functions/ble_gatts_register_svcs.md) | Registers a set of services, characteristics, and descriptors to be accessed by GATT clients. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gatts/definitions/ble_gatts_defs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gatts/definitions/ble_gatts_defs.md b/docs/network/ble/ble_hs/ble_gatts/definitions/ble_gatts_defs.md
new file mode 100644
index 0000000..a87491a
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gatts/definitions/ble_gatts_defs.md
@@ -0,0 +1,187 @@
+## <font color="#F2853F" style="font-size:24pt">GATT Client Definitions/font>
+
+```c
+typedef int ble_gatt_access_fn(uint16_t conn_handle, uint16_t attr_handle,
+                               uint8_t op, struct ble_gatt_access_ctxt *ctxt,
+                               void *arg);
+```
+
+```c
+typedef uint16_t ble_gatt_chr_flags;
+```
+
+```c
+struct ble_gatt_chr_def {
+    /**
+     * Pointer to first element in a uint8_t[16]; use the BLE_UUID16 macro for
+     * 16-bit UUIDs; NULL if there are no more characteristics in the service.
+     */
+    const uint8_t *uuid128;
+
+    /**
+     * Callback that gets executed when this characteristic is read or
+     * written.
+     */
+    ble_gatt_access_fn *access_cb;
+
+    /** Optional argument for callback. */
+    void *arg;
+
+    /**
+     * Array of this characteristic's descriptors.  NULL if no descriptors.
+     * Do not include CCCD; it gets added automatically if this
+     * characteristic's notify or indicate flag is set.
+     */
+    struct ble_gatt_dsc_def *descriptors;
+
+    /** Specifies the set of permitted operations for this characteristic. */
+    ble_gatt_chr_flags flags;
+
+    /** 
+     * At registration time, this is filled in with the characteristic's value
+     * attribute handle.
+     */
+    uint16_t * const val_handle;
+};
+```
+
+```c
+struct ble_gatt_svc_def {
+    /**
+     * One of the following:
+     *     o BLE_GATT_SVC_TYPE_PRIMARY - primary service
+     *     o BLE_GATT_SVC_TYPE_SECONDARY - secondary service
+     *     o 0 - No more services in this array.
+     */
+    uint8_t type;
+
+    /**
+     * Pointer to first element in a uint8_t[16]; use the BLE_UUID16 macro for
+     * 16-bit UUIDs.
+     */
+    const uint8_t *uuid128;
+
+    /**
+     * Array of pointers to other service definitions.  These services are
+     * reported as "included services" during service discovery.  Terminate the
+     * array with NULL.
+     */
+    const struct ble_gatt_svc_def **includes;
+
+    /**
+     * Array of characteristic definitions corresponding to characteristics
+     * belonging to this service.
+     */
+    const struct ble_gatt_chr_def *characteristics;
+};
+```
+
+```c
+struct ble_gatt_access_ctxt {
+    union {
+        /**
+         * The characteristic definition corresponding to the characteristic
+         * being accessed.  This is what the app registered at startup.
+         */
+        const struct ble_gatt_chr_def *chr;
+
+        /**
+         * The descriptor definition corresponding to the descriptor being
+         * accessed.  This is what the app registered at startup.
+         */
+        const struct ble_gatt_dsc_def *dsc;
+    };
+
+    struct ble_att_svr_access_ctxt *att;
+};
+```
+
+```c
+struct ble_gatt_dsc_def {
+    /**
+     * The first element in a uint8_t[16]; use the BLE_UUID16 macro for 16-bit
+     * UUIDs; NULL if there are no more descriptors in the characteristic.
+     */
+    uint8_t *uuid128;
+
+    /** Specifies the set of permitted operations for this descriptor. */
+    uint8_t att_flags;
+
+    /** Callback that gets executed when the descriptor is read or written. */
+    ble_gatt_access_fn *access_cb;
+
+    /** Optional argument for callback. */
+    void *arg;
+};
+```
+
+```c
+/**
+ * Context passed to the registration callback; represents the GATT service,
+ * characteristic, or descriptor being registered.
+ */
+union ble_gatt_register_ctxt {
+    /** Service; valid if op == BLE_GATT_REGISTER_OP_SVC. */
+    struct {
+        /** The ATT handle of the service definition attribute. */
+        uint16_t handle;
+
+        /**
+         * The service definition representing the service being
+         * registered.
+         */
+        const struct ble_gatt_svc_def *svc_def;
+    } svc;
+
+    /** Characteristic; valid if op == BLE_GATT_REGISTER_OP_CHR. */
+    struct {
+        /** The ATT handle of the characteristic definition attribute. */
+        uint16_t def_handle;
+
+        /** The ATT handle of the characteristic value attribute. */
+        uint16_t val_handle;
+
+        /**
+         * The characteristic definition representing the characteristic being
+         * registered.
+         */
+        const struct ble_gatt_chr_def *chr_def;
+
+        /**
+         * The service definition corresponding to the characteristic's parent
+         * service.
+         */
+        const struct ble_gatt_svc_def *svc_def;
+    } chr;
+
+    /** Descriptor; valid if op == BLE_GATT_REGISTER_OP_DSC. */
+    struct {
+        /** The ATT handle of the descriptor definition attribute. */
+        uint16_t handle;
+
+        /**
+         * The descriptor definition corresponding to the descriptor being
+         * registered.
+         */
+        const struct ble_gatt_dsc_def *dsc_def;
+
+        /**
+         * The characteristic definition corresponding to the descriptor's
+         * parent characteristic.
+         */
+        const struct ble_gatt_chr_def *chr_def;
+
+        /**
+         * The service definition corresponding to the descriptor's grandparent
+         * service
+         */
+        const struct ble_gatt_svc_def *svc_def;
+    } dsc;
+};
+```
+
+```c
+typedef void ble_gatt_register_fn(uint8_t op,
+                                  union ble_gatt_register_ctxt *ctxt,
+                                  void *arg);
+```

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_chr.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_chr.md b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_chr.md
new file mode 100644
index 0000000..27cb728
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_chr.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gatts\_find\_chr</font>
+
+```c
+int
+ble_gatts_find_chr(const void *svc_uuid128, const void *chr_uuid128,
+                   uint16_t *out_def_handle, uint16_t *out_val_handle)
+```
+
+### Description
+
+Retrieves the pair of attribute handles associated with a local GATT characteristic. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| svc\_uuid128 | The UUID of the parent service. |
+| chr\_uuid128 | The UUID of the characteristic to look up. |
+| out\_def\_handle | On success, populated with the handle of the characteristic definition attribute. Pass null if you don't need this value. |
+| out\_val\_handle | On success, populated with the handle of the characteristic value attribute. Pass null if you don't need this value. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_ENOENT | The specified service or characteristic could not be found. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_dsc.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_dsc.md b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_dsc.md
new file mode 100644
index 0000000..6a2dcc1
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_dsc.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gatts\_find\_dsc</font>
+
+```c
+int
+ble_gatts_find_dsc(const void *svc_uuid128, const void *chr_uuid128,
+                   const void *dsc_uuid128, uint16_t *out_handle)
+```
+
+### Description
+
+Retrieves the attribute handle associated with a local GATT descriptor. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| svc\_uuid128 | The UUID of the grandparent service. |
+| chr\_uuid128 | The UUID of the parent characteristic. |
+| dsc\_uuid128 | The UUID of the descriptor ro look up. |
+| out\_handle | On success, populated with the handle of the descripytor attribute.  Pass null if you don't need this value. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_ENOENT | The specified service, characteristic, or descriptor could not be found. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_svc.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_svc.md b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_svc.md
new file mode 100644
index 0000000..3df3349
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_find_svc.md
@@ -0,0 +1,24 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gatts\_find\_svc</font>
+
+```c
+int
+ble_gatts_find_svc(const void *uuid128, uint16_t *out_handle)
+```
+
+### Description
+
+Retrieves the attribute handle associated with a local GATT service. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| uuid128 | The UUID of the service to look up. |
+| out\_handle | On success, populated with the handle of the service attribute.  Pass null if you don't need this value. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_ENOENT | The specified service could not be found. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_register_svcs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_register_svcs.md b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_register_svcs.md
new file mode 100644
index 0000000..593ae80
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_gatts/functions/ble_gatts_register_svcs.md
@@ -0,0 +1,27 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_gatts\_register\_svcs</font>
+
+```c
+int
+ble_gatts_register_svcs(const struct ble_gatt_svc_def *svcs,
+                        ble_gatt_register_fn *cb, void *cb_arg)
+```
+
+### Description
+
+Registers a set of services, characteristics, and descriptors to be accessed by GATT clients. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| svcs | A table of the service definitions to be registered. |
+| cb | The function to call for each service, characteristic, and descriptor that gets registered. |
+| cb\_arg | The optional argument to pass to the callback function. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_ENOMEM | Registration failed due to resource exhaustion. |
+| BLE\_HS\_EINVAL | The service definition table contains an invalid element. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_hs.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_hs.md b/docs/network/ble/ble_hs/ble_hs.md
new file mode 100644
index 0000000..efde78a
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_hs.md
@@ -0,0 +1,22 @@
+# NimBLE Host
+
+### Introduction
+
+At a high level, the NimBLE stack is is divided into two components:
+
+* Host
+* Controller
+
+This document is an API reference for the host component.  If you are interested in the general structure of the NimBLE stack and its non-host components, you might want to read the [BLE introduction](../ble_intro.md).
+
+The host sits directly below the application, and it serves as the interface to the application for all BLE operations.
+
+### Reference
+
+* [NimBLE Host Return Codes](ble_hs_return_codes.md)
+* [Initialization and Configuration](init/init.md)
+* [Generic Access Protocol (GAP)](ble_gap/ble_gap.md)
+* [Generic Attribute Profile (GATT) Client](ble_gattc/ble_gattc.md)
+* [Generic Attribute Profile (GATT) Server](ble_gatts/ble_gatts.md)
+* [Identity](ble_hs_id/ble_hs_id.md)
+* [Other](other/other.md)

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_hs_id/ble_hs_id.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_hs_id/ble_hs_id.md b/docs/network/ble/ble_hs/ble_hs_id/ble_hs_id.md
new file mode 100644
index 0000000..f34162a
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_hs_id/ble_hs_id.md
@@ -0,0 +1,42 @@
+## <font color="F2853F" style="font-size:24pt">NimBLE Host GAP Reference</font>
+
+### Introduction
+
+The identity API provides facilities for querying and configuring your device's addresses.  BLE's addressing scheme is quite involved; the summary that follows is only a brief introduction.
+
+BLE defines four address types:
+
+| Type                          | Description                                                                                     | Identity? | Configured with                             |
+|-------------------------------|-------------------------------------------------------------------------------------------------|-----------|---------------------------------------------|
+| Public                        | Address assigned by manufacturer; the three most significant bytes form the manufacturer's OUI. | Yes       | N/A; read from controller at startup.       |
+| Static random                 | Randomly generated address.                                                                     | Yes       | *ble_hs_id_set_rnd()*                       |
+| Resolvable private (RPA)      | Address randomly generated from an identity address and an identity resolving key (IRK).        | No        | N/A; generated by controller periodically.  |
+| Non-resolvable private (NRPA) | Randomly generated address.                                                                     | No        | *ble_hs_id_set_rnd()*                       |
+
+#### Identity Addresses
+
+The third column in the above table indicates the _identity_ property of each address type.  An identity address never changes, and a device can be identified by one of its unique identity addresses.
+
+Non-identity addresses are used by devices supporting BLE privacy.  A device using the privacy feature frequently changes its own address to a newly-generated non-identity address.  By cycling its address, the device makes it impossible for eavesdroppers to track its location.
+
+A device can have up to two identity addresses at once: one public and one static random.  As indicated in the above table, the public identity address cannot be configured; the static random identity address can be set by calling *ble_hs_id_set_rnd()*.
+
+The address type is selected on a per-GAP-procedure basis.  Each time you initiate a GAP procedure, you indicate which address type the device should use for the duration of the procedure.
+
+### Header
+
+```c
+#include "host/ble_hs.h"
+```
+
+### Definitions
+
+None.
+
+### Functions
+
+| Function | Description |
+|----------|-------------|
+| [ble_hs_id_copy_addr](functions/ble_hs_id_copy_addr.md) | Retrieves one of the device's identity addresses. |
+| [ble_hs_id_gen_rnd](functions/ble_hs_id_gen_rnd.md) | Generates a new random address. |
+| [ble_hs_id_set_rnd](functions/ble_hs_id_set_rnd.md) | Sets the device's random address. |

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/e0b9d12e/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_copy_addr.md
----------------------------------------------------------------------
diff --git a/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_copy_addr.md b/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_copy_addr.md
new file mode 100644
index 0000000..ff6896d
--- /dev/null
+++ b/docs/network/ble/ble_hs/ble_hs_id/functions/ble_hs_id_copy_addr.md
@@ -0,0 +1,28 @@
+## <font color="#F2853F" style="font-size:24pt">ble\_hs\_id\_copy\_addr</font>
+
+```c
+int
+ble_hs_id_copy_addr(uint8_t id_addr_type, uint8_t *out_id_addr,
+                    int *out_is_nrpa)
+```
+
+### Description
+
+Retrieves one of the device's identity addresses.  The device can have two identity addresses: one public and one random.  The id\_addr\_type argument specifies which of these two addresses to retrieve. 
+
+### Parameters
+
+| *Parameter* | *Description* |
+|-------------|---------------|
+| id\_addr\_type | The type of identity address to retrieve. Valid values are: <ul><li>BLE\_ADDR\_TYPE\_PUBLIC</li> <li>BLE\_ADDR\_TYPE\_RANDOM</li></ul> |
+| out\_id\_addr | On success, the requested identity address is copied into this buffer.  The buffer must be at least six bytes in size. |
+| out\_is\_nrpa | On success, the pointed-to value indicates whether the retrieved address is a non-resolvable private address. |
+
+### Returned values
+
+| *Value* | *Condition* |
+|---------|-------------|
+| 0 | Success. |
+| BLE\_HS\_EINVAL | An invalid address type was specified. |
+| BLE\_HS\_ENOADDR | The device does not have an identity address of the requested type. |
+| other | Other ble host core code on error. |



[3/5] incubator-mynewt-site git commit: Added missing steps to primo_blinky tutorial.

Posted by ad...@apache.org.
Added missing steps to primo_blinky tutorial.

This closes #105. This change will be cherry-picked into master branch.


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

Branch: refs/heads/develop
Commit: 6755be5534d9bfe16d8a4cfd6b63e13fa619c813
Parents: 53bbfbb
Author: Brian Giori <br...@gmail.com>
Authored: Fri Jul 8 10:55:38 2016 -0700
Committer: aditihilbert <ad...@runtime.io>
Committed: Fri Jul 8 11:59:19 2016 -0700

----------------------------------------------------------------------
 docs/os/tutorials/blinky_primo.md | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/6755be55/docs/os/tutorials/blinky_primo.md
----------------------------------------------------------------------
diff --git a/docs/os/tutorials/blinky_primo.md b/docs/os/tutorials/blinky_primo.md
index 7f0d406..07d1dc6 100644
--- a/docs/os/tutorials/blinky_primo.md
+++ b/docs/os/tutorials/blinky_primo.md
@@ -45,8 +45,20 @@ Licensed under GNU GPL v2
 For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
 ```
+Next, make sure that you have checked out the newt develop branch and rebuilt newt.
+```
+$ cd $GOPATH/src/mynewt.apache.org/newt
+$ git checkout develop
+$ git pull
+$ cd newt
+$ go install
+```
+**Note:** This step can be removed once the changes have been pushed to master.
+
 You can now use openocd to upload to Arduino Primo board via the USB port itself.
 
+
+
 <br>
 
 
@@ -110,7 +122,6 @@ Would you like to upgrade repository apache-mynewt-core from 0.9.0-none to 0.0.0
 
 Create two targets - one for the bootloader and one for the Primo board.  
 
-
 ```
 $ newt target create primoblinky
 $ newt target set primoblinky app=@apache-mynewt-core/apps/blinky bsp=@apache-mynewt-core/hw/bsp/arduino_primo_nrf52 build_profile=debug
@@ -133,6 +144,13 @@ targets/primoblinky
     build_profile=optimized
 ```
 
+If you are using openocd you must set the openocd_debug feature for both primo_boot and primoblinky.
+
+```
+$ newt target set primo_boot features=openocd_debug
+$ newt target set primoblinky features=openocd_debug
+```
+
 <br>
 
 ### Build the target executables 


[5/5] incubator-mynewt-site git commit: Changed title of bletiny app usage API only on develop

Posted by ad...@apache.org.
Changed title of bletiny app usage API only on develop


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

Branch: refs/heads/develop
Commit: d2def2645fbb808f86d23a06762a7b11fb00a121
Parents: bd1c1cc
Author: aditihilbert <ad...@runtime.io>
Authored: Fri Jul 8 13:55:54 2016 -0700
Committer: aditihilbert <ad...@runtime.io>
Committed: Fri Jul 8 13:55:54 2016 -0700

----------------------------------------------------------------------
 mkdocs.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/d2def264/mkdocs.yml
----------------------------------------------------------------------
diff --git a/mkdocs.yml b/mkdocs.yml
index c24de92..b25ea6e 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -431,7 +431,7 @@ pages:
                     - 'ble_eddystone_set_adv_data_url': 'network/ble/ble_hs/other/functions/ble_eddystone_set_adv_data_url.md'
                     - 'ble_uuid_128_to_16': 'network/ble/ble_hs/other/functions/ble_uuid_128_to_16.md'
 
-        - API for bletiny app:
+        - bletiny app Usage API:
             - toc: 'network/ble/bletiny_api.md'
             - 'GAP in bletiny': 'network/ble/bletiny/bletiny_GAP.md'
             - 'GATT in bletiny': 'network/ble/bletiny/bletiny_GATT.md'


[4/5] incubator-mynewt-site git commit: Merge branch 'ble_hs_api' of https://github.com/ccollins476ad/incubator-mynewt-site into develop

Posted by ad...@apache.org.
Merge branch 'ble_hs_api' of https://github.com/ccollins476ad/incubator-mynewt-site into develop

This closes #104. Pull request by ccollins476ad


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

Branch: refs/heads/develop
Commit: bd1c1ccdc3e1349abfba4606ed68d608a5c71d17
Parents: 6755be5 e0b9d12
Author: aditihilbert <ad...@runtime.io>
Authored: Fri Jul 8 13:21:12 2016 -0700
Committer: aditihilbert <ad...@runtime.io>
Committed: Fri Jul 8 13:21:12 2016 -0700

----------------------------------------------------------------------
 docs/network/ble/ble_hs/ble_gap/ble_gap.md      |  36 +++
 .../ble_hs/ble_gap/definitions/ble_gap_defs.md  | 318 +++++++++++++++++++
 .../ble_gap/functions/ble_gap_adv_active.md     |  21 ++
 .../functions/ble_gap_adv_rsp_set_fields.md     |  25 ++
 .../ble_gap/functions/ble_gap_adv_set_fields.md |  25 ++
 .../ble_gap/functions/ble_gap_adv_start.md      |  32 ++
 .../ble_gap/functions/ble_gap_adv_stop.md       |  22 ++
 .../ble_gap/functions/ble_gap_conn_active.md    |  21 ++
 .../ble_gap/functions/ble_gap_conn_cancel.md    |  21 ++
 .../ble_gap/functions/ble_gap_conn_find.md      |  24 ++
 .../ble_hs/ble_gap/functions/ble_gap_connect.md |  32 ++
 .../ble_hs/ble_gap/functions/ble_gap_disc.md    |  29 ++
 .../ble_gap/functions/ble_gap_disc_active.md    |  21 ++
 .../ble_gap/functions/ble_gap_disc_cancel.md    |  22 ++
 .../functions/ble_gap_security_initiate.md      |  25 ++
 .../ble_gap/functions/ble_gap_terminate.md      |  25 ++
 .../ble_gap/functions/ble_gap_update_params.md  |  27 ++
 .../ble_hs/ble_gap/functions/ble_gap_wl_set.md  |  25 ++
 docs/network/ble/ble_hs/ble_gattc/ble_gattc.md  |  37 +++
 .../ble_gattc/definitions/ble_gattc_defs.md     |  82 +++++
 .../functions/ble_gattc_disc_all_chrs.md        |  29 ++
 .../functions/ble_gattc_disc_all_dscs.md        |  29 ++
 .../functions/ble_gattc_disc_all_svcs.md        |  23 ++
 .../functions/ble_gattc_disc_chrs_by_uuid.md    |  30 ++
 .../functions/ble_gattc_disc_svc_by_uuid.md     |  27 ++
 .../functions/ble_gattc_exchange_mtu.md         |  25 ++
 .../functions/ble_gattc_find_inc_svcs.md        |  29 ++
 .../ble_gattc/functions/ble_gattc_notify.md     |  24 ++
 .../functions/ble_gattc_notify_custom.md        |  27 ++
 .../ble_gattc/functions/ble_gattc_read.md       |  27 ++
 .../functions/ble_gattc_read_by_uuid.md         |  29 ++
 .../ble_gattc/functions/ble_gattc_read_long.md  |  27 ++
 .../ble_gattc/functions/ble_gattc_read_mult.md  |  29 ++
 .../ble_gattc/functions/ble_gattc_write.md      |  29 ++
 .../ble_gattc/functions/ble_gattc_write_long.md |  30 ++
 .../functions/ble_gattc_write_no_rsp.md         |  27 ++
 .../functions/ble_gattc_write_reliable.md       |  27 ++
 docs/network/ble/ble_hs/ble_gatts/ble_gatts.md  |  24 ++
 .../ble_gatts/definitions/ble_gatts_defs.md     | 187 +++++++++++
 .../ble_gatts/functions/ble_gatts_find_chr.md   |  27 ++
 .../ble_gatts/functions/ble_gatts_find_dsc.md   |  27 ++
 .../ble_gatts/functions/ble_gatts_find_svc.md   |  24 ++
 .../functions/ble_gatts_register_svcs.md        |  27 ++
 docs/network/ble/ble_hs/ble_hs.md               |  22 ++
 docs/network/ble/ble_hs/ble_hs_id/ble_hs_id.md  |  42 +++
 .../ble_hs_id/functions/ble_hs_id_copy_addr.md  |  28 ++
 .../ble_hs_id/functions/ble_hs_id_gen_rnd.md    |  24 ++
 .../ble_hs_id/functions/ble_hs_id_set_rnd.md    |  23 ++
 docs/network/ble/ble_hs/ble_hs_return_codes.md  | 290 +++++++++++++++++
 .../ble/ble_hs/init/definitions/init_defs.md    | 147 +++++++++
 .../ble/ble_hs/init/functions/ble_hs_init.md    |  24 ++
 .../ble/ble_hs/init/functions/ble_hs_start.md   |  21 ++
 docs/network/ble/ble_hs/init/init.md            |  22 ++
 .../functions/ble_eddystone_set_adv_data_uid.md |  26 ++
 .../functions/ble_eddystone_set_adv_data_url.md |  31 ++
 .../other/functions/ble_ibeacon_set_adv_data.md |  26 ++
 .../other/functions/ble_uuid_128_to_16.md       |  23 ++
 .../other/functions/ble_uuid_16_to_128.md       |  24 ++
 docs/network/ble/ble_hs/other/other.md          |  25 ++
 mkdocs.yml                                      |  84 +++++
 60 files changed, 2536 insertions(+)
----------------------------------------------------------------------