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/23 21:38:44 UTC
[5/6] incubator-mynewt-site git commit: Updated BLE Host API. This
closes #108
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-site/blob/df4054b9/develop/mkdocs/search_index.json
----------------------------------------------------------------------
diff --git a/develop/mkdocs/search_index.json b/develop/mkdocs/search_index.json
index 5418021..21b640d 100644
--- a/develop/mkdocs/search_index.json
+++ b/develop/mkdocs/search_index.json
@@ -7397,7 +7397,7 @@
},
{
"location": "/network/ble/ble_hs/init/init/",
- "text": "NimBLE Host Init and Config Reference\n\n\nIntroduction\n\n\nThis section is a reference on initializing and configuring the NimBLE host.\n\n\nHeader\n\n\n#include \nhost/ble_hs.h\n\n\n\n\n\n\nDefinitions\n\n\nBLE host init and config definitions\n\n\nFunctions\n\n\n\n\n\n\n\n\nFunction\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nble_hs_init\n\n\nInitializes the NimBLE host.\n\n\n\n\n\n\nble_hs_start\n\n\nSynchronizes the host with the controller by sending a sequence of HCI commands.",
+ "text": "NimBLE Host Init and Config Reference\n\n\nIntroduction\n\n\nThis section is a reference on initializing and configuring the NimBLE host.\n\n\nHeader\n\n\n#include \nhost/ble_hs.h\n\n\n\n\n\n\nDefinitions\n\n\nBLE host init and config definitions\n\n\nFunctions\n\n\n\n\n\n\n\n\nFunction\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nble_hs_init\n\n\nInitializes the NimBLE host.\n\n\n\n\n\n\nble_hs_rx_data\n\n\nCalled when a data packet is received from the controller.\n\n\n\n\n\n\nble_hs_start\n\n\nSynchronizes the host with the controller by sending a sequence of HCI commands.",
"title": "toc"
},
{
@@ -7422,7 +7422,7 @@
},
{
"location": "/network/ble/ble_hs/init/init/#functions",
- "text": "Function Description ble_hs_init Initializes the NimBLE host. ble_hs_start Synchronizes the host with the controller by sending a sequence of HCI commands.",
+ "text": "Function Description ble_hs_init Initializes the NimBLE host. ble_hs_rx_data Called when a data packet is received from the controller. ble_hs_start Synchronizes the host with the controller by sending a sequence of HCI commands.",
"title": "Functions"
},
{
@@ -7437,7 +7437,7 @@
},
{
"location": "/network/ble/ble_hs/init/functions/ble_hs_init/",
- "text": "ble_hs_init\n\n\nint\n\n\nble_hs_init\n(\n \nstruct\n \nos_eventq\n \n*app_evq\n,\n \nstruct\n \nble_hs_cfg\n \n*cfg\n\n)\n\n\n\n\n\nDescription\n\n\nInitializes 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. \n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\napp_evq\n\n\nThe event queue associated with the host parent task.\n\n\n\n\n\n\ncfg\n\n\nThe set of configuration settings to initialize the host with. Specify null for defaults.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
+ "text": "ble_hs_init\n\n\nint\n\n\nble_hs_init\n(\n \nstruct\n \nos_eventq\n \n*app_evq\n,\n \nstruct\n \nble_hs_cfg\n \n*cfg\n\n)\n\n\n\n\n\nDescription\n\n\nInitializes 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.\n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\napp_evq\n\n\nThe event queue associated with the host parent task.\n\n\n\n\n\n\ncfg\n\n\nThe set of configuration settings to initialize the host with. Specify null for defaults.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
"title": "ble_hs_init"
},
{
@@ -7461,8 +7461,33 @@
"title": "Returned values"
},
{
+ "location": "/network/ble/ble_hs/init/functions/ble_hs_rx_data/",
+ "text": "ble_hs_rx_data\n\n\nint\n\n\nble_hs_rx_data\n(\nstruct\n \nos_mbuf\n \n**om\n)\n\n\n\n\n\nDescription\n\n\nCalled when a data packet is received from the controller. This function consumes the supplied mbuf, regardless of the outcome.\n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nom\n\n\nThe incoming data packet, beginning with the HCI ACL data header.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
+ "title": "ble_hs_rx_data"
+ },
+ {
+ "location": "/network/ble/ble_hs/init/functions/ble_hs_rx_data/#ble95hs95rx95data",
+ "text": "int ble_hs_rx_data ( struct os_mbuf **om )",
+ "title": "ble_hs_rx_data"
+ },
+ {
+ "location": "/network/ble/ble_hs/init/functions/ble_hs_rx_data/#description",
+ "text": "Called when a data packet is received from the controller. This function consumes the supplied mbuf, regardless of the outcome.",
+ "title": "Description"
+ },
+ {
+ "location": "/network/ble/ble_hs/init/functions/ble_hs_rx_data/#parameters",
+ "text": "Parameter Description om The incoming data packet, beginning with the HCI ACL data header.",
+ "title": "Parameters"
+ },
+ {
+ "location": "/network/ble/ble_hs/init/functions/ble_hs_rx_data/#returned-values",
+ "text": "Value Condition 0 Success. Core return code Unexpected error.",
+ "title": "Returned values"
+ },
+ {
"location": "/network/ble/ble_hs/init/functions/ble_hs_start/",
- "text": "ble_hs_start\n\n\nint\n\n\nble_hs_start\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nSynchronizes 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. \n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
+ "text": "ble_hs_start\n\n\nint\n\n\nble_hs_start\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nSynchronizes 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.\n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
"title": "ble_hs_start"
},
{
@@ -7487,7 +7512,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/ble_gap/",
- "text": "NimBLE Host GAP Reference\n\n\nIntroduction\n\n\nThe Generic Access Profile (GAP) is responsible for all connecting, advertising, scanning, and connection updating operations.\n\n\nHeader\n\n\n#include \nhost/ble_hs.h\n\n\n\n\n\n\nDefinitions\n\n\nBLE host GAP definitions\n\n\nFunctions\n\n\n\n\n\n\n\n\nFunction\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nble_gap_adv_active\n\n\nIndicates whether an advertisement procedure is currently in progress.\n\n\n\n\n\n\nble_gap_adv_rsp_set_fields\n\n\nConfigures the data to include in subsequent scan responses.\n\n\n\n\n\n\nble_gap_adv_set_fields\n\n\nConfigures the data to include in subsequent advertisements.\n\n\n\n\n\n\nble_gap_adv_start\n\n\nInitiates advertising.\n\n\n\n\n\n\nble_gap_adv_stop\n\n\nStops the currently-active advertising procedure.\n\n\n\n\n\n\nble_gap_conn_active\n\n\nIndicates whether a connect procedure is currently in progress.\n\n\n\n\n\n\nble_gap_conn_cancel\n\n\nAborts a connect procedure in progres
s.\n\n\n\n\n\n\nble_gap_conn_find\n\n\nSearches for a connection with the specified handle.\n\n\n\n\n\n\nble_gap_connect\n\n\nInitiates a connect procedure.\n\n\n\n\n\n\nble_gap_disc\n\n\nPerforms the Limited or General Discovery Procedures.\n\n\n\n\n\n\nble_gap_disc_active\n\n\nIndicates whether a discovery procedure is currently in progress.\n\n\n\n\n\n\nble_gap_disc_cancel\n\n\nCancels the discovery procedure currently in progress.\n\n\n\n\n\n\nble_gap_security_initiate\n\n\nInitiates the GAP encryption procedure.\n\n\n\n\n\n\nble_gap_terminate\n\n\nTerminates an established connection.\n\n\n\n\n\n\nble_gap_update_params\n\n\nInitiates a connection parameter update procedure.\n\n\n\n\n\n\nble_gap_wl_set\n\n\nOverwrites the controller's white list with the specified contents.",
+ "text": "NimBLE Host GAP Reference\n\n\nIntroduction\n\n\nThe Generic Access Profile (GAP) is responsible for all connecting, advertising, scanning, and connection updating operations.\n\n\nHeader\n\n\n#include \nhost/ble_hs.h\n\n\n\n\n\n\nDefinitions\n\n\nBLE host GAP definitions\n\n\nFunctions\n\n\n\n\n\n\n\n\nFunction\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nble_gap_adv_active\n\n\nIndicates whether an advertisement procedure is currently in progress.\n\n\n\n\n\n\nble_gap_adv_rsp_set_fields\n\n\nConfigures the data to include in subsequent scan responses.\n\n\n\n\n\n\nble_gap_adv_set_fields\n\n\nConfigures the data to include in subsequent advertisements.\n\n\n\n\n\n\nble_gap_adv_start\n\n\nInitiates advertising.\n\n\n\n\n\n\nble_gap_adv_stop\n\n\nStops the currently-active advertising procedure.\n\n\n\n\n\n\nble_gap_conn_active\n\n\nIndicates whether a connect procedure is currently in progress.\n\n\n\n\n\n\nble_gap_conn_cancel\n\n\nAborts a connect procedure in progres
s.\n\n\n\n\n\n\nble_gap_conn_find\n\n\nSearches for a connection with the specified handle.\n\n\n\n\n\n\nble_gap_conn_rssi\n\n\nRetrieves the most-recently measured RSSI for the specified connection.\n\n\n\n\n\n\nble_gap_connect\n\n\nInitiates a connect procedure.\n\n\n\n\n\n\nble_gap_disc\n\n\nPerforms the Limited or General Discovery Procedures.\n\n\n\n\n\n\nble_gap_disc_active\n\n\nIndicates whether a discovery procedure is currently in progress.\n\n\n\n\n\n\nble_gap_disc_cancel\n\n\nCancels the discovery procedure currently in progress.\n\n\n\n\n\n\nble_gap_security_initiate\n\n\nInitiates the GAP encryption procedure.\n\n\n\n\n\n\nble_gap_terminate\n\n\nTerminates an established connection.\n\n\n\n\n\n\nble_gap_update_params\n\n\nInitiates a connection parameter update procedure.\n\n\n\n\n\n\nble_gap_wl_set\n\n\nOverwrites the controller's white list with the specified contents.",
"title": "toc"
},
{
@@ -7512,22 +7537,22 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/ble_gap/#functions",
- "text": "Function Description ble_gap_adv_active Indicates whether an advertisement procedure is currently in progress. ble_gap_adv_rsp_set_fields Configures the data to include in subsequent scan responses. ble_gap_adv_set_fields Configures the data to include in subsequent advertisements. ble_gap_adv_start Initiates advertising. ble_gap_adv_stop Stops the currently-active advertising procedure. ble_gap_conn_active Indicates whether a connect procedure is currently in progress. ble_gap_conn_cancel Aborts a connect procedure in progress. ble_gap_conn_find Searches for a connection with the specified handle. ble_gap_connect Initiates a connect procedure. ble_gap_disc Performs the Limited or General Discovery Procedures. ble_gap_disc_active Indicates whether a discovery procedure is currently in progress. ble_gap_disc_cancel Cancels the discovery procedure currently in progress. ble_gap_security_initiate Initiates the
GAP encryption procedure. ble_gap_terminate Terminates an established connection. ble_gap_update_params Initiates a connection parameter update procedure. ble_gap_wl_set Overwrites the controller's white list with the specified contents.",
+ "text": "Function Description ble_gap_adv_active Indicates whether an advertisement procedure is currently in progress. ble_gap_adv_rsp_set_fields Configures the data to include in subsequent scan responses. ble_gap_adv_set_fields Configures the data to include in subsequent advertisements. ble_gap_adv_start Initiates advertising. ble_gap_adv_stop Stops the currently-active advertising procedure. ble_gap_conn_active Indicates whether a connect procedure is currently in progress. ble_gap_conn_cancel Aborts a connect procedure in progress. ble_gap_conn_find Searches for a connection with the specified handle. ble_gap_conn_rssi Retrieves the most-recently measured RSSI for the specified connection. ble_gap_connect Initiates a connect procedure. ble_gap_disc Performs the Limited or General Discovery Procedures. ble_gap_disc_active Indicates whether a discovery procedure is currently in progress. ble_gap_disc_cancel Cance
ls the discovery procedure currently in progress. ble_gap_security_initiate Initiates the GAP encryption procedure. ble_gap_terminate Terminates an established connection. ble_gap_update_params Initiates a connection parameter update procedure. ble_gap_wl_set Overwrites the controller's white list with the specified contents.",
"title": "Functions"
},
{
"location": "/network/ble/ble_hs/ble_gap/definitions/ble_gap_defs/",
- "text": "GAP events\n\n\ntypedef\n \nint\n \nble_gap_event_fn\n(\nstruct\n \nble_gap_event\n \n*ctxt\n, \nvoid\n \n*arg\n);\n\n\n\n\n\n#define BLE_GAP_EVENT_CONNECT 0\n\n\n#define BLE_GAP_EVENT_DISCONNECT 1\n\n\n#define BLE_GAP_EVENT_CONN_CANCEL 2\n\n\n#define BLE_GAP_EVENT_CONN_UPDATE 3\n\n\n#define BLE_GAP_EVENT_CONN_UPDATE_REQ 4\n\n\n#define BLE_GAP_EVENT_L2CAP_UPDATE_REQ 5\n\n\n#define BLE_GAP_EVENT_TERM_FAILURE 6\n\n\n#define BLE_GAP_EVENT_DISC 7\n\n\n#define BLE_GAP_EVENT_DISC_COMPLETE 8\n\n\n#define BLE_GAP_EVENT_ADV_COMPLETE 9\n\n\n#define BLE_GAP_EVENT_ENC_CHANGE 10\n\n\n#define BLE_GAP_EVENT_PASSKEY_ACTION 11\n\n\n#define BLE_GAP_EVENT_NOTIFY 12\n\n\n\n\n\n\n/**\n\n\n * Represents a GAP-related event. When such an event occurs, the host\n\n\n * notifies the application by passing an instance of this structure to an\n\n\n * applica
tion-specified callback.\n\n\n */\n\n\nstruct\n \nble_gap_event\n {\n \n/**\n\n\n * Indicates the type of GAP event that occurred. This is one of the\n\n\n * BLE_GAP_EVENT codes.\n\n\n */\n\n \nuint8_t\n \ntype\n;\n\n \n/**\n\n\n * A discriminated union containing additional details concerning the GAP\n\n\n * event. The \ntype\n field indicates which member of the union is valid.\n\n\n */\n\n \nunion\n {\n \n/**\n\n\n * Represents a connection attempt. Valid for the following event\n\n\n * types:\n\n\n * o BLE_GAP_EVENT_CONNECT\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * The status of the connection attempt;\n\n\n * o 0: the connection was successfully established.\n\n\n * o BLE host error code: the connection attempt failed for\n\n\n * the specified reason.\n\n\n */\n\n \nint\n \nstatus\n;\n\n
\n/**\n\n\n * Information about the established connection. Only valid on\n\n\n * success.\n\n\n */\n\n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n } \nconnect\n;\n\n \n/**\n\n\n * Represents a terminated connection. Valid for the following event\n\n\n * types:\n\n\n * o BLE_GAP_EVENT_DISCONNECT\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * A BLE host return code indicating the reason for the\n\n\n * disconnect.\n\n\n */\n\n \nint\n \nreason\n;\n\n \n/** Information about the terminated connection. */\n\n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n } \ndisconnect\n;\n\n \n/**\n\n\n * Represents an advertising report received during a discovery\n\n\n * procedure. Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_DISC\n\n\n */\n\n \n
struct\n \nble_gap_disc_desc\n \ndisc\n;\n\n \n/**\n\n\n * Represents an attempt to update a connection\ns parameters. Valid\n\n\n * for the following event types:\n\n\n * o BLE_GAP_EVENT_CONN_UPDATE\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * The result of the connection update attempt;\n\n\n * o 0: the connection was successfully updated.\n\n\n * o BLE host error code: the connection update attempt failed\n\n\n * for the specified reason.\n\n\n */\n\n \nint\n \nstatus\n;\n\n \n/**\n\n\n * Information about the relevant connection. If the connection\n\n\n * update attempt was successful, this descriptor contains the\n\n\n * updated parameters.\n\n\n */\n\n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n } \nconn_update\n;\n\n \n/**\n\n\n * Represents
a peer\ns request to update the connection parameters.\n\n\n * This event is generated when a peer performs any of the following\n\n\n * procedures:\n\n\n * o L2CAP Connection Parameter Update Procedure\n\n\n * o Link-Layer Connection Parameters Request Procedure\n\n\n *\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_L2CAP_UPDATE_REQ\n\n\n * o BLE_GAP_EVENT_CONN_UPDATE_REQ\n\n\n * \n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * Indicates the connection parameters that the peer would like to\n\n\n * use.\n\n\n */\n\n \nconst\n \nstruct\n \nble_gap_upd_params\n \n*peer_params\n;\n\n \n/**\n\n\n * Indicates the connection parameters that the local device would\n\n\n * like to use. The application callback should fill this in. By\n\n\n * default, this struct conta
ins the requested parameters (i.e.,\n\n\n * it is a copy of \npeer_params\n).\n\n\n */\n\n \nstruct\n \nble_gap_upd_params\n \n*self_params\n;\n\n \n/** Information about the relevant connection. */\n\n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n } \nconn_update_req\n;\n\n \n/**\n\n\n * Represents a failed attempt to terminate an established connection.\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_TERM_FAILURE\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * A BLE host return code indicating the reason for the failure.\n\n\n */\n\n \nint\n \nstatus\n;\n\n \n/** Information about the relevant connection. */\n\n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n } \nterm_failure\n;\n\n \n/**\n\n\n * Represents an attempt to change the encrypted state of a\n\n\n * c
onnection. Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_ENC_CHANGE\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * Indicates the result of the encryption state change attempt;\n\n\n * o 0: the encrypted state was successfully updated;\n\n\n * o BLE host error code: the encryption state change attempt\n\n\n * failed for the specified reason.\n\n\n */\n\n \nint\n \nstatus\n;\n\n \n/**\n\n\n * Information about the relevant connection. If the encryption\n\n\n * state change attempt was successful, this descriptor reflects\n\n\n * the updated state.\n\n\n */\n\n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n } \nenc_change\n;\n\n \n/**\n\n\n * Represents a passkey query needed to complete a pairing procedure.\n\n\n * Valid for the following event types:\n\n\
n * o BLE_GAP_EVENT_PASSKEY_ACTION\n\n\n */\n\n \nstruct\n {\n \n/** Contains details about the passkey query. */\n\n \nstruct\n \nble_gap_passkey_params\n \nparams\n;\n\n \n/** Information about the relevant connection. */\n\n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n } \npasskey\n;\n\n \n/**\n\n\n * Represents a received ATT notification or indication.\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_NOTIFY\n\n\n */\n\n \nstruct\n {\n \n/** The handle of the relevant ATT attribute. */\n\n \nuint16_t\n \nattr_handle\n;\n\n \n/** The contents of the notification or indication. */\n\n \nvoid\n \n*attr_data\n;\n\n \n/** The number of data bytes contained in the message. */\n\n \nuint16_t\n \nattr_len\n;\n\n \n/** Information about the relevant connection. */\n\
n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n\n \n/**\n\n\n * Whether the received command is a notification or an\n\n\n * indication;\n\n\n * o 0: Notification;\n\n\n * o 1: Indication.\n\n\n */\n\n \nunsigned\n \nindication\n:\n1\n;\n } \nnotify\n;\n };\n};\n\n\n\n\n\nstruct\n \nble_gap_sec_state\n {\n \nunsigned\n \nencrypted\n:\n1\n;\n \nunsigned\n \nauthenticated\n:\n1\n;\n \nunsigned\n \nbonded\n:\n1\n;\n};\n\n\n\n\n\n/**\n\n\n * @param discoverable_mode One of the following constants:\n\n\n * o BLE_GAP_DISC_MODE_NON\n\n\n * (non-discoverable; 3.C.9.2.2).\n\n\n * o BLE_GAP_DISC_MODE_LTD\n\n\n * (limited-discoverable; 3.C.9.2.3).\n\n\n * o BLE_GAP_DISC_MODE_GEN\n\n\n *
(general-discoverable; 3.C.9.2.4).\n\n\n * @param connectable_mode One of the following constants:\n\n\n * o BLE_GAP_CONN_MODE_NON\n\n\n * (non-connectable; 3.C.9.3.2).\n\n\n * o BLE_GAP_CONN_MODE_DIR\n\n\n * (directed-connectable; 3.C.9.3.3).\n\n\n * o BLE_GAP_CONN_MODE_UND\n\n\n * (undirected-connectable; 3.C.9.3.4).\n\n\n */\n\n\nstruct\n \nble_gap_adv_params\n {\n \n/*** Mandatory fields. */\n\n \nuint8_t\n \nconn_mode\n;\n \nuint8_t\n \ndisc_mode\n;\n\n \n/*** Optional fields; assign 0 to make the stack calculate them. */\n\n \nuint16_t\n \nitvl_min\n;\n \nuint16_t\n \nitvl_max\n;\n \nuint8_t\n \nchannel_map\n;\n \nuint8_t\n \nfilter_policy\n;\n \nuint8_t\n \nhigh_duty_cycle\n:\n1\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_co
nn_desc\n {\n \nstruct\n \nble_gap_sec_state\n \nsec_state\n;\n \nuint8_t\n \npeer_ota_addr\n[\n6\n];\n \nuint8_t\n \npeer_id_addr\n[\n6\n];\n \nuint8_t\n \nour_id_addr\n[\n6\n];\n \nuint8_t\n \nour_ota_addr\n[\n6\n];\n \nuint16_t\n \nconn_handle\n;\n \nuint16_t\n \nconn_itvl\n;\n \nuint16_t\n \nconn_latency\n;\n \nuint16_t\n \nsupervision_timeout\n;\n \nuint8_t\n \npeer_ota_addr_type\n;\n \nuint8_t\n \npeer_id_addr_type\n;\n \nuint8_t\n \nour_id_addr_type\n;\n \nuint8_t\n \nour_ota_addr_type\n;\n \nuint8_t\n \nrole\n;\n \nuint8_t\n \nmaster_clock_accuracy\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_conn_params\n {\n \nuint16_t\n \nscan_itvl\n;\n \nuint16_t\n \nscan_window\n;\n \nuint16_t\n \nitvl_min\n;\n \nuint16_t\n \nitvl_max\n;\n \nuint16_t\n \nlatency\n;\n \nuint16_t\n \nsupervision_timeout\n;\n \nuint16_t\n \nmin_ce_len\n;\n \nuint16_t\n \nmax_ce_len\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_disc_params\n {\n \nuint1
6_t\n \nitvl\n;\n \nuint16_t\n \nwindow\n;\n \nuint8_t\n \nfilter_policy\n;\n \nuint8_t\n \nlimited\n:\n1\n;\n \nuint8_t\n \npassive\n:\n1\n;\n \nuint8_t\n \nfilter_duplicates\n:\n1\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_upd_params\n {\n \nuint16_t\n \nitvl_min\n;\n \nuint16_t\n \nitvl_max\n;\n \nuint16_t\n \nlatency\n;\n \nuint16_t\n \nsupervision_timeout\n;\n \nuint16_t\n \nmin_ce_len\n;\n \nuint16_t\n \nmax_ce_len\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_passkey_params\n {\n \nuint8_t\n \naction\n;\n \nuint32_t\n \nnumcmp\n;\n};",
+ "text": "GAP events\n\n\ntypedef\n \nint\n \nble_gap_event_fn\n(\nstruct\n \nble_gap_event\n \n*ctxt\n, \nvoid\n \n*arg\n);\n\n\n\n\n\n#define BLE_GAP_EVENT_CONNECT 0\n\n\n#define BLE_GAP_EVENT_DISCONNECT 1\n\n\n#define BLE_GAP_EVENT_CONN_CANCEL 2\n\n\n#define BLE_GAP_EVENT_CONN_UPDATE 3\n\n\n#define BLE_GAP_EVENT_CONN_UPDATE_REQ 4\n\n\n#define BLE_GAP_EVENT_L2CAP_UPDATE_REQ 5\n\n\n#define BLE_GAP_EVENT_TERM_FAILURE 6\n\n\n#define BLE_GAP_EVENT_DISC 7\n\n\n#define BLE_GAP_EVENT_DISC_COMPLETE 8\n\n\n#define BLE_GAP_EVENT_ADV_COMPLETE 9\n\n\n#define BLE_GAP_EVENT_ENC_CHANGE 10\n\n\n#define BLE_GAP_EVENT_PASSKEY_ACTION 11\n\n\n#define BLE_GAP_EVENT_NOTIFY_RX 12\n\n\n#define BLE_GAP_EVENT_NOTIFY_TX 13\n\n\n#define BLE_GAP_EVENT_SUBSCRIBE 14\n\n\n\n\n\n\n/**\n\n\n * Represents a GAP-related event. When such an event occurs,
the host\n\n\n * notifies the application by passing an instance of this structure to an\n\n\n * application-specified callback.\n\n\n */\n\n\nstruct\n \nble_gap_event\n {\n \n/**\n\n\n * Indicates the type of GAP event that occurred. This is one of the\n\n\n * BLE_GAP_EVENT codes.\n\n\n */\n\n \nuint8_t\n \ntype\n;\n\n \n/**\n\n\n * A discriminated union containing additional details concerning the GAP\n\n\n * event. The \ntype\n field indicates which member of the union is valid.\n\n\n */\n\n \nunion\n {\n \n/**\n\n\n * Represents a connection attempt. Valid for the following event\n\n\n * types:\n\n\n * o BLE_GAP_EVENT_CONNECT\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * The status of the connection attempt;\n\n\n * o 0: the connection was successfully established.\n\n\n * o BLE host error code: the connection attempt failed for\n\n\n
* the specified reason.\n\n\n */\n\n \nint\n \nstatus\n;\n\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n } \nconnect\n;\n\n \n/**\n\n\n * Represents a terminated connection. Valid for the following event\n\n\n * types:\n\n\n * o BLE_GAP_EVENT_DISCONNECT\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * A BLE host return code indicating the reason for the\n\n\n * disconnect.\n\n\n */\n\n \nint\n \nreason\n;\n\n \n/** Information about the connection prior to termination. */\n\n \nstruct\n \nble_gap_conn_desc\n \nconn\n;\n } \ndisconnect\n;\n\n \n/**\n\n\n * Represents an advertising report received during a discovery\n\n\n * procedure. Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_DISC\n\n\n */\n
\n \nstruct\n \nble_gap_disc_desc\n \ndisc\n;\n\n \n/**\n\n\n * Represents an attempt to update a connection\ns parameters. If the\n\n\n * attempt was successful, the connection\ns descriptor reflects the\n\n\n * updated parameters.\n\n\n *\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_CONN_UPDATE\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * The result of the connection update attempt;\n\n\n * o 0: the connection was successfully updated.\n\n\n * o BLE host error code: the connection update attempt failed\n\n\n * for the specified reason.\n\n\n */\n\n \nint\n \nstatus\n;\n\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n } \nconn_update\n;\n\n \n/**\n\n\n * Represents a peer\ns request to update the connectio
n parameters.\n\n\n * This event is generated when a peer performs any of the following\n\n\n * procedures:\n\n\n * o L2CAP Connection Parameter Update Procedure\n\n\n * o Link-Layer Connection Parameters Request Procedure\n\n\n *\n\n\n * To reject the request, return a non-zero HCI error code. The value\n\n\n * returned is the reject reason given to the controller.\n\n\n *\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_L2CAP_UPDATE_REQ\n\n\n * o BLE_GAP_EVENT_CONN_UPDATE_REQ\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * Indicates the connection parameters that the peer would like to\n\n\n * use.\n\n\n */\n\n \nconst\n \nstruct\n \nble_gap_upd_params\n \n*peer_params\n;\n\n \n/**\n\n\n * Indicates the connection parameters that the local device would\n\n\n
* like to use. The application callback should fill this in. By\n\n\n * default, this struct contains the requested parameters (i.e.,\n\n\n * it is a copy of \npeer_params\n).\n\n\n */\n\n \nstruct\n \nble_gap_upd_params\n \n*self_params\n;\n\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n } \nconn_update_req\n;\n\n \n/**\n\n\n * Represents a failed attempt to terminate an established connection.\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_TERM_FAILURE\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * A BLE host return code indicating the reason for the failure.\n\n\n */\n\n \nint\n \nstatus\n;\n\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n } \nterm_failure\n;\n\n \n/**\n\n\n
* Represents an attempt to change the encrypted state of a\n\n\n * connection. If the attempt was successful, the connection\n\n\n * descriptor reflects the updated encrypted state.\n\n\n *\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_ENC_CHANGE\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * Indicates the result of the encryption state change attempt;\n\n\n * o 0: the encrypted state was successfully updated;\n\n\n * o BLE host error code: the encryption state change attempt\n\n\n * failed for the specified reason.\n\n\n */\n\n \nint\n \nstatus\n;\n\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n } \nenc_change\n;\n\n \n/**\n\n\n * Represents a passkey query needed to complete a pairing procedure.\n\n\n *\n\n\n
* Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_PASSKEY_ACTION\n\n\n */\n\n \nstruct\n {\n \n/** Contains details about the passkey query. */\n\n \nstruct\n \nble_gap_passkey_params\n \nparams\n;\n\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n } \npasskey\n;\n\n \n/**\n\n\n * Represents a received ATT notification or indication.\n\n\n *\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_NOTIFY_RX\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * The contents of the notification or indication. If the\n\n\n * application wishes to retain this mbuf for later use, it must\n\n\n * set this pointer to NULL to prevent the stack from freeing it.\n\n\n */\n\n \nstruct\n \nos_mbuf\n \n*om\n;\n\n \n/** The handle of
the relevant ATT attribute. */\n\n \nuint16_t\n \nattr_handle\n;\n\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n\n \n/**\n\n\n * Whether the received command is a notification or an\n\n\n * indication;\n\n\n * o 0: Notification;\n\n\n * o 1: Indication.\n\n\n */\n\n \nuint8_t\n \nindication\n:\n1\n;\n } \nnotify_rx\n;\n\n \n/**\n\n\n * Represents a transmitted ATT notification or indication, or a\n\n\n * completed indication transaction.\n\n\n *\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_NOTIFY_TX\n\n\n */\n\n \nstruct\n {\n \n/**\n\n\n * The status of the notification or indication transaction;\n\n\n * o 0: Command successfully sent;\n\n\n * o BLE_HS_EDO
NE: Confirmation (indication ack) received;\n\n\n * o BLE_HS_ETIMEOUT: Confirmation (indication ack) never\n\n\n * received;\n\n\n * o Other return code: Error.\n\n\n */\n\n \nint\n \nstatus\n;\n\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n\n \n/** The handle of the relevant characterstic value. */\n\n \nuint16_t\n \nattr_handle\n;\n\n \n/**\n\n\n * Whether the transmitted command is a notification or an\n\n\n * indication;\n\n\n * o 0: Notification;\n\n\n * o 1: Indication.\n\n\n */\n\n \nuint8_t\n \nindication\n:\n1\n;\n } \nnotify_tx\n;\n\n \n/**\n\n\n * Represents a state change in a peer\ns subscription status. In this\n\n\n * comment, the term \nupdate\n is used to refer to
either a notification\n\n\n * or an indication. This event is triggered by any of the following\n\n\n * occurrences:\n\n\n * o Peer enables or disables updates via a CCCD write.\n\n\n * o Connection is about to be terminated and the peer is\n\n\n * subscribed to updates.\n\n\n * o Peer is now subscribed to updates after its state was restored\n\n\n * from persistence. This happens when bonding is restored.\n\n\n *\n\n\n * Valid for the following event types:\n\n\n * o BLE_GAP_EVENT_SUBSCRIBE\n\n\n */\n\n \nstruct\n {\n \n/** The handle of the relevant connection. */\n\n \nuint16_t\n \nconn_handle\n;\n\n \n/** The value handle of the relevant characteristic. */\n\n \nuint16_t\n \nattr_handle\n;\n\n \n/** One of the BLE_GAP_SUBSCRIBE_REASON codes. */\n\n \nuint8_t\n \nreason\n;\n\n \n/
** Whether the peer was previously subscribed to notifications. */\n\n \nuint8_t\n \nprev_notify\n:\n1\n;\n\n \n/** Whether the peer is currently subscribed to notifications. */\n\n \nuint8_t\n \ncur_notify\n:\n1\n;\n\n \n/** Whether the peer was previously subscribed to indications. */\n\n \nuint8_t\n \nprev_indicate\n:\n1\n;\n\n \n/** Whether the peer is currently subscribed to indications. */\n\n \nuint8_t\n \ncur_indicate\n:\n1\n;\n } \nsubscribe\n;\n };\n};\n\n\n\n\n\n#define BLE_GAP_CONN_MODE_NON 0\n\n\n#define BLE_GAP_CONN_MODE_DIR 1\n\n\n#define BLE_GAP_CONN_MODE_UND 2\n\n\n\n\n\n\n#define BLE_GAP_DISC_MODE_NON 0\n\n\n#define BLE_GAP_DISC_MODE_LTD 1\n\n\n#define BLE_GAP_DISC_MODE_GEN 2\n\n\n\n\n\n\nstruct\n \nble_gap_white_entry\n {\n \nuint8_t\n \naddr_type\n;\n \nuint8_t\n \naddr\n[\n6\n];\n};\n\n\n
\n\n\n/*** Reason codes for the subscribe GAP event. */\n\n\n\n/** Peer\ns CCCD subscription state changed due to a descriptor write. */\n\n\n#define BLE_GAP_SUBSCRIBE_REASON_WRITE 1\n\n\n\n/** Peer\ns CCCD subscription state cleared due to connection termination. */\n\n\n#define BLE_GAP_SUBSCRIBE_REASON_TERM 2\n\n\n\n/**\n\n\n * Peer\ns CCCD subscription state changed due to restore from persistence\n\n\n * (bonding restored).\n\n\n */\n\n\n#define BLE_GAP_SUBSCRIBE_REASON_RESTORE 3\n\n\n\n\n\n\nstruct\n \nble_gap_sec_state\n {\n \nunsigned\n \nencrypted\n:\n1\n;\n \nunsigned\n \nauthenticated\n:\n1\n;\n \nunsigned\n \nbonded\n:\n1\n;\n};\n\n\n\n\n\n/**\n\n\n * @param discoverable_mode One of the following constants:\n\n\n * o BLE_GAP_DISC_MODE_NON\n\n\n * (non-discoverable; 3.C.9.2.2).\n\n\n * o BLE_GAP_DISC_MODE_LTD\n\n\n *
(limited-discoverable; 3.C.9.2.3).\n\n\n * o BLE_GAP_DISC_MODE_GEN\n\n\n * (general-discoverable; 3.C.9.2.4).\n\n\n * @param connectable_mode One of the following constants:\n\n\n * o BLE_GAP_CONN_MODE_NON\n\n\n * (non-connectable; 3.C.9.3.2).\n\n\n * o BLE_GAP_CONN_MODE_DIR\n\n\n * (directed-connectable; 3.C.9.3.3).\n\n\n * o BLE_GAP_CONN_MODE_UND\n\n\n * (undirected-connectable; 3.C.9.3.4).\n\n\n */\n\n\nstruct\n \nble_gap_adv_params\n {\n \n/*** Mandatory fields. */\n\n \nuint8_t\n \nconn_mode\n;\n \nuint8_t\n \ndisc_mode\n;\n\n \n/*** Optional fields; assign 0 to make the stack calculate them. */\n\n \nuint16_t\n \nitvl_min\n;\n \nuint16_t\n \nitvl_max\n;\n \nuint8_t\n
\nchannel_map\n;\n \nuint8_t\n \nfilter_policy\n;\n \nuint8_t\n \nhigh_duty_cycle\n:\n1\n;\n};\n\n\n\n\n\n#define BLE_GAP_ROLE_MASTER 0\n\n\n#define BLE_GAP_ROLE_SLAVE 1\n\n\n\n\n\n\nstruct\n \nble_gap_conn_desc\n {\n \nstruct\n \nble_gap_sec_state\n \nsec_state\n;\n \nuint8_t\n \npeer_ota_addr\n[\n6\n];\n \nuint8_t\n \npeer_id_addr\n[\n6\n];\n \nuint8_t\n \nour_id_addr\n[\n6\n];\n \nuint8_t\n \nour_ota_addr\n[\n6\n];\n \nuint16_t\n \nconn_handle\n;\n \nuint16_t\n \nconn_itvl\n;\n \nuint16_t\n \nconn_latency\n;\n \nuint16_t\n \nsupervision_timeout\n;\n \nuint8_t\n \npeer_ota_addr_type\n;\n \nuint8_t\n \npeer_id_addr_type\n;\n \nuint8_t\n \nour_id_addr_type\n;\n \nuint8_t\n \nour_ota_addr_type\n;\n \nuint8_t\n \nrole\n;\n \nuint8_t\n \nmaster_clock_accuracy\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_conn_params\n {\n \nuint16_t\n \nscan_itvl\n;\n \nuint16_t\n \nscan_window\n;\n \nuint16_t\n \nitvl_
min\n;\n \nuint16_t\n \nitvl_max\n;\n \nuint16_t\n \nlatency\n;\n \nuint16_t\n \nsupervision_timeout\n;\n \nuint16_t\n \nmin_ce_len\n;\n \nuint16_t\n \nmax_ce_len\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_disc_params\n {\n \nuint16_t\n \nitvl\n;\n \nuint16_t\n \nwindow\n;\n \nuint8_t\n \nfilter_policy\n;\n \nuint8_t\n \nlimited\n:\n1\n;\n \nuint8_t\n \npassive\n:\n1\n;\n \nuint8_t\n \nfilter_duplicates\n:\n1\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_upd_params\n {\n \nuint16_t\n \nitvl_min\n;\n \nuint16_t\n \nitvl_max\n;\n \nuint16_t\n \nlatency\n;\n \nuint16_t\n \nsupervision_timeout\n;\n \nuint16_t\n \nmin_ce_len\n;\n \nuint16_t\n \nmax_ce_len\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_passkey_params\n {\n \nuint8_t\n \naction\n;\n \nuint32_t\n \nnumcmp\n;\n};\n\n\n\n\n\nstruct\n \nble_gap_disc_desc\n {\n \n/*** Common fields. */\n\n \nuint8_t\n \nevent_type\n;\n \nuint8_t\n \naddr_type\n;\n \nuint8_t\n \nlength_data\n;\n \ni
nt8_t\n \nrssi\n;\n \nuint8_t\n \naddr\n[\n6\n];\n\n \n/*** LE advertising report fields; both null if no data present. */\n\n \nuint8_t\n \n*data\n;\n \nstruct\n \nble_hs_adv_fields\n \n*fields\n;\n\n \n/***\n\n\n * LE direct advertising report fields; direct_addr_type is\n\n\n * BLE_GAP_ADDR_TYPE_NONE if direct address fields are not present.\n\n\n */\n\n \nuint8_t\n \ndirect_addr_type\n;\n \nuint8_t\n \ndirect_addr\n[\n6\n];\n};",
"title": "GAP definitions"
},
{
"location": "/network/ble/ble_hs/ble_gap/definitions/ble_gap_defs/#gap-events",
- "text": "typedef int ble_gap_event_fn ( struct ble_gap_event *ctxt , void *arg ); #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 /** * 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 {\n /** * Indicates the type of GAP event that
occurred. This is one of the * BLE_GAP_EVENT codes. */ \n uint8_t type ;\n\n /** * A discriminated union containing additional details concerning the GAP * event. The type field indicates which member of the union is valid. */ \n union {\n /** * Represents a connection attempt. Valid for the following event * types: * o BLE_GAP_EVENT_CONNECT */ \n struct {\n /** * 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. */ \n int status ;\n\n /** * Information about the established connection. Only valid on * success. */ \n struct ble_gap_conn_desc conn ;\n } connect ;\n\n
/** * Represents a terminated connection. Valid for the following event * types: * o BLE_GAP_EVENT_DISCONNECT */ \n struct {\n /** * A BLE host return code indicating the reason for the * disconnect. */ \n int reason ;\n\n /** Information about the terminated connection. */ \n struct ble_gap_conn_desc conn ;\n } disconnect ;\n\n /** * Represents an advertising report received during a discovery * procedure. Valid for the following event types: * o BLE_GAP_EVENT_DISC */ \n struct ble_gap_disc_desc disc ;\n\n /** * Represents an attempt to update a connection s parameters. Valid * for the following event types: * o BLE_GAP_EVENT_CONN_UPDATE */ \n struct {\n /** * The resul
t 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. */ \n int status ;\n\n /** * Information about the relevant connection. If the connection * update attempt was successful, this descriptor contains the * updated parameters. */ \n struct ble_gap_conn_desc conn ;\n } conn_update ;\n\n /** * 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_EVE
NT_L2CAP_UPDATE_REQ * o BLE_GAP_EVENT_CONN_UPDATE_REQ * */ \n struct {\n /** * Indicates the connection parameters that the peer would like to * use. */ \n const struct ble_gap_upd_params *peer_params ;\n\n /** * 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 ). */ \n struct ble_gap_upd_params *self_params ;\n\n /** Information about the relevant connection. */ \n struct ble_gap_conn_desc conn ;\n } conn_update_req ;\n\n /** * Represents a failed attempt to terminate an established connection. * Valid for the following event types:
* o BLE_GAP_EVENT_TERM_FAILURE */ \n struct {\n /** * A BLE host return code indicating the reason for the failure. */ \n int status ;\n\n /** Information about the relevant connection. */ \n struct ble_gap_conn_desc conn ;\n } term_failure ;\n\n /** * Represents an attempt to change the encrypted state of a * connection. Valid for the following event types: * o BLE_GAP_EVENT_ENC_CHANGE */ \n struct {\n /** * 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. */ \n int status ;\n\n /** * Information about the relev
ant connection. If the encryption * state change attempt was successful, this descriptor reflects * the updated state. */ \n struct ble_gap_conn_desc conn ;\n } enc_change ;\n\n /** * Represents a passkey query needed to complete a pairing procedure. * Valid for the following event types: * o BLE_GAP_EVENT_PASSKEY_ACTION */ \n struct {\n /** Contains details about the passkey query. */ \n struct ble_gap_passkey_params params ;\n\n /** Information about the relevant connection. */ \n struct ble_gap_conn_desc conn ;\n } passkey ;\n\n /** * Represents a received ATT notification or indication. * Valid for the following event types: * o BLE_GAP_EVENT_NOTIFY */ \n struct {\n /** The handle of the relevant ATT attribute. */ \n
uint16_t attr_handle ;\n\n /** The contents of the notification or indication. */ \n void *attr_data ;\n\n /** The number of data bytes contained in the message. */ \n uint16_t attr_len ;\n\n /** Information about the relevant connection. */ \n struct ble_gap_conn_desc conn ;\n\n /** * Whether the received command is a notification or an * indication; * o 0: Notification; * o 1: Indication. */ \n unsigned indication : 1 ;\n } notify ;\n };\n}; struct ble_gap_sec_state {\n unsigned encrypted : 1 ;\n unsigned authenticated : 1 ;\n unsigned bonded : 1 ;\n}; /** * @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 {\n /*** Mandatory fields. */ \n uint8_t conn_mode ;\n uint8_t disc_mode ;\n\n /*** Optional fields; assign 0 to make the stack calculate them. */ \n uint16_t itvl_min ;\n uint16_t itvl_
max ;\n uint8_t channel_map ;\n uint8_t filter_policy ;\n uint8_t high_duty_cycle : 1 ;\n}; struct ble_gap_conn_desc {\n struct ble_gap_sec_state sec_state ;\n uint8_t peer_ota_addr [ 6 ];\n uint8_t peer_id_addr [ 6 ];\n uint8_t our_id_addr [ 6 ];\n uint8_t our_ota_addr [ 6 ];\n uint16_t conn_handle ;\n uint16_t conn_itvl ;\n uint16_t conn_latency ;\n uint16_t supervision_timeout ;\n uint8_t peer_ota_addr_type ;\n uint8_t peer_id_addr_type ;\n uint8_t our_id_addr_type ;\n uint8_t our_ota_addr_type ;\n uint8_t role ;\n uint8_t master_clock_accuracy ;\n}; struct ble_gap_conn_params {\n uint16_t scan_itvl ;\n uint16_t scan_window ;\n uint16_t itvl_min ;\n uint16_t itvl_max ;\n uint16_t latency ;\n uint16_t supervision_timeout ;\n uint16_t min_ce_len ;\n uint16_t max_ce_len ;\n}; struct ble_gap_disc_params {\n uint1
6_t itvl ;\n uint16_t window ;\n uint8_t filter_policy ;\n uint8_t limited : 1 ;\n uint8_t passive : 1 ;\n uint8_t filter_duplicates : 1 ;\n}; struct ble_gap_upd_params {\n uint16_t itvl_min ;\n uint16_t itvl_max ;\n uint16_t latency ;\n uint16_t supervision_timeout ;\n uint16_t min_ce_len ;\n uint16_t max_ce_len ;\n}; struct ble_gap_passkey_params {\n uint8_t action ;\n uint32_t numcmp ;\n};",
+ "text": "typedef int ble_gap_event_fn ( struct ble_gap_event *ctxt , void *arg ); #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_RX 12 #define BLE_GAP_EVENT_NOTIFY_TX 13 #define BLE_GAP_EVENT_SUBSCRIBE 14 /** * 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 c
allback. */ struct ble_gap_event {\n /** * Indicates the type of GAP event that occurred. This is one of the * BLE_GAP_EVENT codes. */ \n uint8_t type ;\n\n /** * A discriminated union containing additional details concerning the GAP * event. The type field indicates which member of the union is valid. */ \n union {\n /** * Represents a connection attempt. Valid for the following event * types: * o BLE_GAP_EVENT_CONNECT */ \n struct {\n /** * 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. */ \n int status ;\n\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n } connect
;\n\n /** * Represents a terminated connection. Valid for the following event * types: * o BLE_GAP_EVENT_DISCONNECT */ \n struct {\n /** * A BLE host return code indicating the reason for the * disconnect. */ \n int reason ;\n\n /** Information about the connection prior to termination. */ \n struct ble_gap_conn_desc conn ;\n } disconnect ;\n\n /** * Represents an advertising report received during a discovery * procedure. Valid for the following event types: * o BLE_GAP_EVENT_DISC */ \n struct ble_gap_disc_desc disc ;\n\n /** * Represents an attempt to update a connection s parameters. If the * attempt was successful, the connection s descriptor reflects the * updated parameters. * * Valid for th
e following event types: * o BLE_GAP_EVENT_CONN_UPDATE */ \n struct {\n /** * 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. */ \n int status ;\n\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n } conn_update ;\n\n /** * 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 * * To reject the request, return a non-zero HCI error code. The value * returned is the
reject reason given to the controller. * * Valid for the following event types: * o BLE_GAP_EVENT_L2CAP_UPDATE_REQ * o BLE_GAP_EVENT_CONN_UPDATE_REQ */ \n struct {\n /** * Indicates the connection parameters that the peer would like to * use. */ \n const struct ble_gap_upd_params *peer_params ;\n\n /** * 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 ). */ \n struct ble_gap_upd_params *self_params ;\n\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n } conn_update_req ;\n\n /** * Represents a failed
attempt to terminate an established connection. * Valid for the following event types: * o BLE_GAP_EVENT_TERM_FAILURE */ \n struct {\n /** * A BLE host return code indicating the reason for the failure. */ \n int status ;\n\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n } term_failure ;\n\n /** * Represents an attempt to change the encrypted state of a * connection. If the attempt was successful, the connection * descriptor reflects the updated encrypted state. * * Valid for the following event types: * o BLE_GAP_EVENT_ENC_CHANGE */ \n struct {\n /** * Indicates the result of the encryption state change attempt; * o 0: the encrypted state was successfully updated; * o BLE h
ost error code: the encryption state change attempt * failed for the specified reason. */ \n int status ;\n\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n } enc_change ;\n\n /** * Represents a passkey query needed to complete a pairing procedure. * * Valid for the following event types: * o BLE_GAP_EVENT_PASSKEY_ACTION */ \n struct {\n /** Contains details about the passkey query. */ \n struct ble_gap_passkey_params params ;\n\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n } passkey ;\n\n /** * Represents a received ATT notification or indication. * * Valid for the following event types: * o BLE_GAP_EVENT_NOTIFY_RX */ \n struct {\n /
** * The contents of the notification or indication. If the * application wishes to retain this mbuf for later use, it must * set this pointer to NULL to prevent the stack from freeing it. */ \n struct os_mbuf *om ;\n\n /** The handle of the relevant ATT attribute. */ \n uint16_t attr_handle ;\n\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n\n /** * Whether the received command is a notification or an * indication; * o 0: Notification; * o 1: Indication. */ \n uint8_t indication : 1 ;\n } notify_rx ;\n\n /** * Represents a transmitted ATT notification or indication, or a * completed indication transaction. * * Valid for the following event types: * o BLE_GAP_EV
ENT_NOTIFY_TX */ \n struct {\n /** * The status of the notification or indication transaction; * o 0: Command successfully sent; * o BLE_HS_EDONE: Confirmation (indication ack) received; * o BLE_HS_ETIMEOUT: Confirmation (indication ack) never * received; * o Other return code: Error. */ \n int status ;\n\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n\n /** The handle of the relevant characterstic value. */ \n uint16_t attr_handle ;\n\n /** * Whether the transmitted command is a notification or an * indication; * o 0: Notification; * o 1: Indication. */ \n uint8_t indication : 1 ;\n } n
otify_tx ;\n\n /** * Represents a state change in a peer s subscription status. In this * comment, the term update is used to refer to either a notification * or an indication. This event is triggered by any of the following * occurrences: * o Peer enables or disables updates via a CCCD write. * o Connection is about to be terminated and the peer is * subscribed to updates. * o Peer is now subscribed to updates after its state was restored * from persistence. This happens when bonding is restored. * * Valid for the following event types: * o BLE_GAP_EVENT_SUBSCRIBE */ \n struct {\n /** The handle of the relevant connection. */ \n uint16_t conn_handle ;\n\n /** The value handle of the relevant characteristic. */ \n uint16_t attr_handle ;\n\n /*
* One of the BLE_GAP_SUBSCRIBE_REASON codes. */ \n uint8_t reason ;\n\n /** Whether the peer was previously subscribed to notifications. */ \n uint8_t prev_notify : 1 ;\n\n /** Whether the peer is currently subscribed to notifications. */ \n uint8_t cur_notify : 1 ;\n\n /** Whether the peer was previously subscribed to indications. */ \n uint8_t prev_indicate : 1 ;\n\n /** Whether the peer is currently subscribed to indications. */ \n uint8_t cur_indicate : 1 ;\n } subscribe ;\n };\n}; #define BLE_GAP_CONN_MODE_NON 0 #define BLE_GAP_CONN_MODE_DIR 1 #define BLE_GAP_CONN_MODE_UND 2 #define BLE_GAP_DISC_MODE_NON 0 #define BLE_GAP_DISC_MODE_LTD 1 #define BLE_GAP_DISC_MODE_GEN 2 struct ble_gap_white_entry {\n uint8_t addr_type ;\n uint8_t addr [ 6 ];\n};
/*** Reason codes for the subscribe GAP event. */ /** Peer s CCCD subscription state changed due to a descriptor write. */ #define BLE_GAP_SUBSCRIBE_REASON_WRITE 1 /** Peer s CCCD subscription state cleared due to connection termination. */ #define BLE_GAP_SUBSCRIBE_REASON_TERM 2 /** * Peer s CCCD subscription state changed due to restore from persistence * (bonding restored). */ #define BLE_GAP_SUBSCRIBE_REASON_RESTORE 3 struct ble_gap_sec_state {\n unsigned encrypted : 1 ;\n unsigned authenticated : 1 ;\n unsigned bonded : 1 ;\n}; /** * @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 {\n /*** Mandatory fields. */ \n uint8_t conn_mode ;\n uint8_t disc_mode ;\n\n /*** Optional fields; assign 0 to make the stack calculate them. */ \n uint16_t itvl_min ;\n uint16_t itvl_max ;\n uint8_t channel_map ;\n uint8_t filter_policy ;\n uint8_t high_duty_cycle : 1 ;\n}; #define BLE_GAP_ROLE_MASTER 0 #define BLE_GAP_ROLE_SLAVE
1 struct ble_gap_conn_desc {\n struct ble_gap_sec_state sec_state ;\n uint8_t peer_ota_addr [ 6 ];\n uint8_t peer_id_addr [ 6 ];\n uint8_t our_id_addr [ 6 ];\n uint8_t our_ota_addr [ 6 ];\n uint16_t conn_handle ;\n uint16_t conn_itvl ;\n uint16_t conn_latency ;\n uint16_t supervision_timeout ;\n uint8_t peer_ota_addr_type ;\n uint8_t peer_id_addr_type ;\n uint8_t our_id_addr_type ;\n uint8_t our_ota_addr_type ;\n uint8_t role ;\n uint8_t master_clock_accuracy ;\n}; struct ble_gap_conn_params {\n uint16_t scan_itvl ;\n uint16_t scan_window ;\n uint16_t itvl_min ;\n uint16_t itvl_max ;\n uint16_t latency ;\n uint16_t supervision_timeout ;\n uint16_t min_ce_len ;\n uint16_t max_ce_len ;\n}; struct ble_gap_disc_params {\n uint16_t itvl ;\n uint16_t window ;\n uint8_t filter_policy ;\n uint8_t limited : 1 ;\n
uint8_t passive : 1 ;\n uint8_t filter_duplicates : 1 ;\n}; struct ble_gap_upd_params {\n uint16_t itvl_min ;\n uint16_t itvl_max ;\n uint16_t latency ;\n uint16_t supervision_timeout ;\n uint16_t min_ce_len ;\n uint16_t max_ce_len ;\n}; struct ble_gap_passkey_params {\n uint8_t action ;\n uint32_t numcmp ;\n}; struct ble_gap_disc_desc {\n /*** Common fields. */ \n uint8_t event_type ;\n uint8_t addr_type ;\n uint8_t length_data ;\n int8_t rssi ;\n uint8_t addr [ 6 ];\n\n /*** LE advertising report fields; both null if no data present. */ \n uint8_t *data ;\n struct ble_hs_adv_fields *fields ;\n\n /*** * LE direct advertising report fields; direct_addr_type is * BLE_GAP_ADDR_TYPE_NONE if direct address fields are not present. */ \n uint8_t direct_addr_type ;\n uint8_t direct_addr [ 6 ];\n};",
"title": "GAP events"
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_active/",
- "text": "ble_gap_adv_active\n\n\nint\n\n\nble_gap_adv_active\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nIndicates whether an advertisement procedure is currently in progress. \n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nNo advertisement procedure in progress.\n\n\n\n\n\n\n1\n\n\nAdvertisement procedure in progress.",
+ "text": "ble_gap_adv_active\n\n\nint\n\n\nble_gap_adv_active\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nIndicates whether an advertisement procedure is currently in progress.\n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nNo advertisement procedure in progress.\n\n\n\n\n\n\n1\n\n\nAdvertisement procedure in progress.",
"title": "ble_gap_adv_active"
},
{
@@ -7552,7 +7577,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_rsp_set_fields/",
- "text": "ble_gap_adv_rsp_set_fields\n\n\nint\n\n\nble_gap_adv_rsp_set_fields\n(\nconst\n \nstruct\n \nble_hs_adv_fields\n \n*rsp_fields\n)\n\n\n\n\n\nDescription\n\n\nConfigures the data to include in subsequent scan responses. \n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nadv_fields\n\n\nSpecifies the scan response data.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nBLE_HS_EBUSY\n\n\nAdvertising is in progress.\n\n\n\n\n\n\nBLE_HS_EMSGSIZE\n\n\nThe specified data is too large to fit in an advertisement.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
+ "text": "ble_gap_adv_rsp_set_fields\n\n\nint\n\n\nble_gap_adv_rsp_set_fields\n(\nconst\n \nstruct\n \nble_hs_adv_fields\n \n*rsp_fields\n)\n\n\n\n\n\nDescription\n\n\nConfigures the data to include in subsequent scan responses.\n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nadv_fields\n\n\nSpecifies the scan response data.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nBLE_HS_EBUSY\n\n\nAdvertising is in progress.\n\n\n\n\n\n\nBLE_HS_EMSGSIZE\n\n\nThe specified data is too large to fit in an advertisement.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
"title": "ble_gap_adv_rsp_set_fields"
},
{
@@ -7577,7 +7602,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_set_fields/",
- "text": "ble_gap_adv_set_fields\n\n\nint\n\n\nble_gap_adv_set_fields\n(\nconst\n \nstruct\n \nble_hs_adv_fields\n \n*adv_fields\n)\n\n\n\n\n\nDescription\n\n\nConfigures the data to include in subsequent advertisements. \n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nadv_fields\n\n\nSpecifies the advertisement data.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nBLE_HS_EBUSY\n\n\nAdvertising is in progress.\n\n\n\n\n\n\nBLE_HS_EMSGSIZE\n\n\nThe specified data is too large to fit in an advertisement.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
+ "text": "ble_gap_adv_set_fields\n\n\nint\n\n\nble_gap_adv_set_fields\n(\nconst\n \nstruct\n \nble_hs_adv_fields\n \n*adv_fields\n)\n\n\n\n\n\nDescription\n\n\nConfigures the data to include in subsequent advertisements.\n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nadv_fields\n\n\nSpecifies the advertisement data.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nBLE_HS_EBUSY\n\n\nAdvertising is in progress.\n\n\n\n\n\n\nBLE_HS_EMSGSIZE\n\n\nThe specified data is too large to fit in an advertisement.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
"title": "ble_gap_adv_set_fields"
},
{
@@ -7602,7 +7627,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_start/",
- "text": "ble_gap_adv_start\n\n\nint\n\n\nble_gap_adv_start\n(\n \nuint8_t\n \nown_addr_type\n,\n \nuint8_t\n \npeer_addr_type\n,\n \nconst\n \nuint8_t\n \n*peer_addr\n,\n \nint32_t\n \nduration_ms\n,\n \nconst\n \nstruct\n \nble_gap_adv_params\n \n*adv_params\n,\n \nble_gap_event_fn\n \n*cb\n,\n \nvoid\n \n*cb_arg\n\n)\n\n\n\n\n\nDescription\n\n\nInitiates advertising. \n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nown_addr_type\n\n\nThe type of address the stack should use for itself. Valid values are: \nBLE_ADDR_TYPE_PUBLIC\n \nBLE_ADDR_TYPE_RANDOM\n \nBLE_ADDR_TYPE_RPA_PUB_DEFAULT\n \nBLE_ADDR_TYPE_RPA_RND_DEFAULT\n\n\n\n\n\n\npeer_addr_type\n\n\nAddress type of the peer's identity address. Valid values are: \nBLE_ADDR_TYPE_PUBLIC\n \nBLE_ADDR_TYPE_RANDOM\n This parameter is igno
red unless directed advertising is being used.\n\n\n\n\n\n\npeer_addr\n\n\nThe peer's six-byte identity address. This parameter is ignored unless directed advertising is being used.\n\n\n\n\n\n\nduration_ms\n\n\nThe 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.\n\n\n\n\n\n\nadv_params\n\n\nAdditional arguments specifying the particulars of the advertising procedure.\n\n\n\n\n\n\ncb\n\n\nThe 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.\n\n\n\n\n\n\ncb_arg\n\n\nThe optional argument to pass to the callback function.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\
n\n\nUnexpected error.",
+ "text": "ble_gap_adv_start\n\n\nint\n\n\nble_gap_adv_start\n(\n \nuint8_t\n \nown_addr_type\n,\n \nuint8_t\n \npeer_addr_type\n,\n \nconst\n \nuint8_t\n \n*peer_addr\n,\n \nint32_t\n \nduration_ms\n,\n \nconst\n \nstruct\n \nble_gap_adv_params\n \n*adv_params\n,\n \nble_gap_event_fn\n \n*cb\n,\n \nvoid\n \n*cb_arg\n\n)\n\n\n\n\n\nDescription\n\n\nInitiates advertising.\n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nown_addr_type\n\n\nThe type of address the stack should use for itself. Valid values are: \nBLE_ADDR_TYPE_PUBLIC\n \nBLE_ADDR_TYPE_RANDOM\n \nBLE_ADDR_TYPE_RPA_PUB_DEFAULT\n \nBLE_ADDR_TYPE_RPA_RND_DEFAULT\n\n\n\n\n\n\npeer_addr_type\n\n\nAddress type of the peer's identity address. Valid values are: \nBLE_ADDR_TYPE_PUBLIC\n \nBLE_ADDR_TYPE_RANDOM\n This parameter is ignor
ed unless directed advertising is being used.\n\n\n\n\n\n\npeer_addr\n\n\nThe peer's six-byte identity address. This parameter is ignored unless directed advertising is being used.\n\n\n\n\n\n\nduration_ms\n\n\nThe 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.\n\n\n\n\n\n\nadv_params\n\n\nAdditional arguments specifying the particulars of the advertising procedure.\n\n\n\n\n\n\ncb\n\n\nThe 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.\n\n\n\n\n\n\ncb_arg\n\n\nThe optional argument to pass to the callback function.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n
\n\nUnexpected error.",
"title": "ble_gap_adv_start"
},
{
@@ -7627,7 +7652,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_adv_stop/",
- "text": "ble_gap_adv_stop\n\n\nint\n\n\nble_gap_adv_stop\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nStops the currently-active advertising procedure. A success return code indicates that advertising has been fully aborted; a new advertising procedure can be initiated immediately. \n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nBLE_HS_EALREADY\n\n\nThere is no active advertising procedure.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
+ "text": "ble_gap_adv_stop\n\n\nint\n\n\nble_gap_adv_stop\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nStops the currently-active advertising procedure. A success return code indicates that advertising has been fully aborted; a new advertising procedure can be initiated immediately.\n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nBLE_HS_EALREADY\n\n\nThere is no active advertising procedure.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
"title": "ble_gap_adv_stop"
},
{
@@ -7652,7 +7677,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_active/",
- "text": "ble_gap_conn_active\n\n\nint\n\n\nble_gap_conn_active\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nIndicates whether a connect procedure is currently in progress. \n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nNo connect procedure in progress.\n\n\n\n\n\n\n1\n\n\nConnect procedure in progress.",
+ "text": "ble_gap_conn_active\n\n\nint\n\n\nble_gap_conn_active\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nIndicates whether a connect procedure is currently in progress.\n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nNo connect procedure in progress.\n\n\n\n\n\n\n1\n\n\nConnect procedure in progress.",
"title": "ble_gap_conn_active"
},
{
@@ -7677,7 +7702,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_cancel/",
- "text": "ble_gap_conn_cancel\n\n\nint\n\n\nble_gap_conn_cancel\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nAborts a connect procedure in progress. \n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
+ "text": "ble_gap_conn_cancel\n\n\nint\n\n\nble_gap_conn_cancel\n(\nvoid\n)\n\n\n\n\n\nDescription\n\n\nAborts a connect procedure in progress.\n\n\nParameters\n\n\nNone\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
"title": "ble_gap_conn_cancel"
},
{
@@ -7702,7 +7727,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_find/",
- "text": "ble_gap_conn_find\n\n\nint\n\n\nble_gap_conn_find\n(\n \nuint16_t\n \nhandle\n,\n \nstruct\n \nble_gap_conn_desc\n \n*out_desc\n\n)\n\n\n\n\n\nDescription\n\n\nSearches for a connection with the specified handle. If a matching connection is found, the supplied connection descriptor is filled correspondingly. \n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nhandle\n\n\nThe connection handle to search for.\n\n\n\n\n\n\nout_desc\n\n\nOn success, this is populated with information relating to the matching connection. Pass NULL if you don't need this information.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nBLE_HS_ENOTCONN\n\n\nNo matching connection was found.",
+ "text": "ble_gap_conn_find\n\n\nint\n\n\nble_gap_conn_find\n(\n \nuint16_t\n \nhandle\n,\n \nstruct\n \nble_gap_conn_desc\n \n*out_desc\n\n)\n\n\n\n\n\nDescription\n\n\nSearches for a connection with the specified handle. If a matching connection is found, the supplied connection descriptor is filled correspondingly.\n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nhandle\n\n\nThe connection handle to search for.\n\n\n\n\n\n\nout_desc\n\n\nOn success, this is populated with information relating to the matching connection. Pass NULL if you don't need this information.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nBLE_HS_ENOTCONN\n\n\nNo matching connection was found.",
"title": "ble_gap_conn_find"
},
{
@@ -7727,7 +7752,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_conn_rssi/",
- "text": "ble_gap_conn_rssi\n\n\nint\n\n\nble_gap_conn_rssi\n(\n \nuint16_t\n \nconn_handle\n,\n \nint8_t\n \n*out_rssi\n\n)\n\n\n\n\n\nDescription\n\n\nRetrieves the most-recently measured RSSI for the specified connection. A connection's RSSI is updated whenever a data channel PDU is received. \n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nconn_handle\n\n\nSpecifies the connection to query.\n\n\n\n\n\n\nout_rssi\n\n\nOn success, the retrieved RSSI is written here.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nHCI return code\n\n\nThe controller rejected the request.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
+ "text": "ble_gap_conn_rssi\n\n\nint\n\n\nble_gap_conn_rssi\n(\n \nuint16_t\n \nconn_handle\n,\n \nint8_t\n \n*out_rssi\n\n)\n\n\n\n\n\nDescription\n\n\nRetrieves the most-recently measured RSSI for the specified connection. A connection's RSSI is updated whenever a data channel PDU is received.\n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nconn_handle\n\n\nSpecifies the connection to query.\n\n\n\n\n\n\nout_rssi\n\n\nOn success, the retrieved RSSI is written here.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nHCI return code\n\n\nThe controller rejected the request.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
"title": "ble_gap_conn_rssi"
},
{
@@ -7752,12 +7777,12 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_connect/",
- "text": "ble_gap_connect\n\n\nint\n\n\nble_gap_connect\n(\n \nuint8_t\n \nown_addr_type\n,\n \nuint8_t\n \npeer_addr_type\n,\n \nconst\n \nuint8_t\n \n*peer_addr\n,\n \nconst\n \nstruct\n \nble_gap_conn_params\n \n*conn_params\n,\n \nble_gap_event_fn\n \n*cb\n,\n \nvoid\n \n*cb_arg\n\n)\n\n\n\n\n\nDescription\n\n\nInitiates a connect procedure. \n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nown_addr_type\n\n\nThe type of address the stack should use for itself during connection establishment. \nBLE_ADDR_TYPE_PUBLIC\n \nBLE_ADDR_TYPE_RANDOM\n \nBLE_ADDR_TYPE_RPA_PUB_DEFAULT\n \nBLE_ADDR_TYPE_RPA_RND_DEFAULT\n\n\n\n\n\n\npeer_addr_type\n\n\nThe peer's address type. One of: \nBLE_HCI_CONN_PEER_ADDR_PUBLIC\n \nBLE_HCI_CONN_PEER_ADDR_RANDOM\n \nBLE_HCI_CONN_PEER_ADDR_PUBLIC_IDENT\n \nBLE_HCI_CONN_PEER_ADDR_RAN
DOM_IDENT\n \nBLE_GAP_ADDR_TYPE_WL\n\n\n\n\n\n\npeer_addr\n\n\nThe identity address of the peer to connect to. This parameter is ignored when the white list is used.\n\n\n\n\n\n\nduration_ms\n\n\nThe duration of the discovery procedure. On expiration, the procedure ends and a BLE_GAP_EVENT_DISC_COMPLETE event is reported. Units are milliseconds.\n\n\n\n\n\n\nconn_params\n\n\nAdditional arguments specifying the particulars of the connect procedure. Specify null for default values.\n\n\n\n\n\n\ncb\n\n\nThe 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.\n\n\n\n\n\n\ncb_arg\n\n\nThe optional argument to pass to the callback function.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSuccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.
",
+ "text": "ble_gap_connect\n\n\nint\n\n\nble_gap_connect\n(\n \nuint8_t\n \nown_addr_type\n,\n \nuint8_t\n \npeer_addr_type\n,\n \nconst\n \nuint8_t\n \n*peer_addr\n,\n \nint32_t\n \nduration_ms\n,\n \nconst\n \nstruct\n \nble_gap_conn_params\n \n*conn_params\n,\n \nble_gap_event_fn\n \n*cb\n,\n \nvoid\n \n*cb_arg\n\n)\n\n\n\n\n\nDescription\n\n\nInitiates a connect procedure.\n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nown_addr_type\n\n\nThe type of address the stack should use for itself during connection establishment. \nBLE_ADDR_TYPE_PUBLIC\n \nBLE_ADDR_TYPE_RANDOM\n \nBLE_ADDR_TYPE_RPA_PUB_DEFAULT\n \nBLE_ADDR_TYPE_RPA_RND_DEFAULT\n\n\n\n\n\n\npeer_addr_type\n\n\nThe peer's address type. One of: \nBLE_HCI_CONN_PEER_ADDR_PUBLIC\n \nBLE_HCI_CONN_PEER_ADDR_RANDOM\n \nBLE_HCI
_CONN_PEER_ADDR_PUBLIC_IDENT\n \nBLE_HCI_CONN_PEER_ADDR_RANDOM_IDENT\n \nBLE_GAP_ADDR_TYPE_WL\n\n\n\n\n\n\npeer_addr\n\n\nThe identity address of the peer to connect to. This parameter is ignored when the white list is used.\n\n\n\n\n\n\nduration_ms\n\n\nThe duration of the discovery procedure. On expiration, the procedure ends and a BLE_GAP_EVENT_DISC_COMPLETE event is reported. Units are milliseconds.\n\n\n\n\n\n\nconn_params\n\n\nAdditional arguments specifying the particulars of the connect procedure. Specify null for default values.\n\n\n\n\n\n\ncb\n\n\nThe 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.\n\n\n\n\n\n\ncb_arg\n\n\nThe optional argument to pass to the callback function.\n\n\n\n\n\n\n\n\nReturned values\n\n\n\n\n\n\n\n\nValue\n\n\nCondition\n\n\n\n\n\n\n\n\n\n\n0\n\n\nSu
ccess.\n\n\n\n\n\n\nCore return code\n\n\nUnexpected error.",
"title": "ble_gap_connect"
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_connect/#ble95gap95connect",
- "text": "int ble_gap_connect (\n uint8_t own_addr_type ,\n uint8_t peer_addr_type ,\n const uint8_t *peer_addr ,\n const struct ble_gap_conn_params *conn_params ,\n ble_gap_event_fn *cb ,\n void *cb_arg \n)",
+ "text": "int ble_gap_connect (\n uint8_t own_addr_type ,\n uint8_t peer_addr_type ,\n const uint8_t *peer_addr ,\n int32_t duration_ms ,\n const struct ble_gap_conn_params *conn_params ,\n ble_gap_event_fn *cb ,\n void *cb_arg \n)",
"title": "ble_gap_connect"
},
{
@@ -7777,7 +7802,7 @@
},
{
"location": "/network/ble/ble_hs/ble_gap/functions/ble_gap_disc/",
- "text": "ble_gap_disc\n\n\nint\n\n\nble_gap_disc\n(\n \nuint8_t\n \nown_addr_type\n,\n \nint32_t\n \nduration_ms\n,\n \nconst\n \nstruct\n \nble_gap_disc_params\n \n*disc_params\n,\n \nble_gap_event_fn\n \n*cb\n,\n \nvoid\n \n*cb_arg\n\n)\n\n\n\n\n\nDescription\n\n\nPerforms the Limited or General Discovery Procedures. \n\n\nParameters\n\n\n\n\n\n\n\n\nParameter\n\n\nDescription\n\n\n\n\n\n\n\n\n\n\nown_addr_type\n\n\nThe type of address the stack should use for itself when sending scan requests. Valid values are: \nBLE_ADDR_TYPE_PUBLIC\n \nBLE_ADDR_TYPE_RANDOM\n \nBLE_ADDR_TYPE_RPA_PUB_DEFAULT\n \nBLE_ADDR_TYPE_RPA_RND_DEFAULT\n This parameter is ignored unless active scanning is being used.\n\n\n\n\n\n\nduration_ms\n\n\nThe duration of the discovery procedure. On expiration, the procedure ends and a BLE_GAP_EVENT_DISC_COMPLETE event is reported. Units are mi
lliseconds. Specify BLE_HS_FOREVER for no expiration.\n\n\n\n\n\n\ndisc_params\n\n\nAdditional arguments specifying the particulars of the discovery procedure.\n\n\n\n\n\n\ncb\n\n\nThe callback to associate with this discover
<TRUNCATED>