Retrieves the ATT MTU of the specified connection. If an MTU exchange for this connection has occurred, the MTU is the lower of the two peers' preferred values. Otherwise, the MTU is the default value of 23.
Retrieves the preferred ATT MTU. This is the value indicated by the device during an ATT MTU exchange.
Sets the preferred ATT MTU; the device will indicate this value in all subsequent ATT MTU exchanges. The ATT MTU of a connection is equal to the lower of the two peers' preferred MTU values. The ATT MTU is what dictates the maximum size of any message sent during a GATT procedure.
Reads a locally registered attribute. If the specified attribute handle corresponds to a GATT characteristic value or descriptor, the read is performed by calling the registered GATT access callback.
Writes a locally registered attribute. This function consumes the supplied mbuf regardless of the outcome. If the specified attribute handle corresponds to a GATT characteristic value or descriptor, the write is performed by calling the registered GATT access callback.
Configures the device to advertise Eddystone UID beacons.
Configures the device to advertise Eddystone URL beacons.
Indicates whether an advertisement procedure is currently in progress.
Configures the data to include in subsequent scan responses.
Configures the fields to include in subsequent scan responses. This is a convenience wrapper for ble_gap_adv_rsp_set_data().
Configures the data to include in subsequent advertisements.
Configures the fields to include in subsequent advertisements. This is a convenience wrapper for ble_gap_adv_set_data().
@brief Start advertising
Stops the currently-active advertising procedure. A success return code indicates that advertising has been fully aborted and a new advertising procedure can be initiated immediately.
Indicates whether a connect procedure is currently in progress.
Aborts a connect procedure in progress.
Searches for a connection with the specified handle. If a matching connection is found, the supplied connection descriptor is filled correspondingly.
Searches for a connection with a peer with the specified address. If a matching connection is found, the supplied connection descriptor is filled correspondingly.
Retrieves the most-recently measured RSSI for the specified connection. A connection's RSSI is updated whenever a data channel PDU is received.
Initiates a connect procedure.
Performs the Limited or General Discovery Procedures.
Indicates whether a discovery procedure is currently in progress.
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.
Initiates the GAP encryption procedure as a master. This is for testing only and should not be used by application. Use ble_gap_security_initiate() instead.
Registers listener for GAP events
Unregisters listener for GAP events
Initiates an extended connect procedure.
Performs the Limited or General Extended Discovery Procedures.
Initiates the GAP pairing procedure as a master. This is for testing only and should not be used by application. Use ble_gap_security_initiate() instead.
Read PHYs used for specified connection.
Initiates the GAP security procedure.
Configures a connection to use the specified GAP event callback. A connection's GAP event callback is first specified when the connection is created, either via advertising or initiation. This function replaces the callback that was last configured.
Set preferred default PHYs to be used for connections.
Set preferred PHYs to be used for connection.
Set privacy mode for specified peer device
Terminates an established connection.
Unpairs a device with the specified address. The keys related to that peer device are removed from storage and peer address is removed from the resolve list from the controller. If a peer is connected, the connection is terminated.
Unpairs the oldest bonded peer device. The keys related to that peer device are removed from storage and peer address is removed from the resolve list from the controller. If a peer is connected, the connection is terminated.
Initiates a connection parameter update procedure.
Overwrites the controller's white list with the specified contents.
Initiates GATT procedure: Discover All Characteristics of a Service.
Initiates GATT procedure: Discover All Characteristic Descriptors.
Initiates GATT procedure: Discover All Primary Services.
Initiates GATT procedure: Discover Characteristics by UUID.
Initiates GATT procedure: Discover Primary Service by Service UUID.
Initiates GATT procedure: Exchange MTU.
Initiates GATT procedure: Find Included Services.
Sends a characteristic indication. The content of the message is read from the specified characteristic.
Sends a "free-form" characteristic indication. The provided mbuf contains the indication payload. This function consumes the supplied mbuf regardless of the outcome.
Sends a characteristic notification. The content of the message is read from the specified characteristic.
Sends a "free-form" characteristic notification. This function consumes the supplied mbuf regardless of the outcome.
Initiates GATT procedure: Read Characteristic Value.
Initiates GATT procedure: Read Using Characteristic UUID.
Initiates GATT procedure: Read Long Characteristic Values.
Initiates GATT procedure: Read Multiple Characteristic Values.
Initiates GATT procedure: Write Characteristic Value. This function consumes the supplied mbuf regardless of the outcome.
Initiates GATT procedure: Write Characteristic Value (flat buffer version).
Initiates GATT procedure: Write Long Characteristic Values. This function consumes the supplied mbuf regardless of the outcome.
Initiates GATT procedure: Write Without Response. This function consumes the supplied mbuf regardless of the outcome.
Initiates GATT procedure: Write Without Response. This function consumes the supplied mbuf regardless of the outcome.
Initiates GATT procedure: Reliable Writes. This function consumes the supplied mbufs regardless of the outcome.
Queues a set of service definitions for registration. All services queued in this manner get registered when ble_gatts_start() is called.
Send notification (or indication) to any connected devices that have subscribed for notification (or indication) for specified characteristic.
Adjusts a host configuration object's settings to accommodate the specified service definition array. This function adds the counts to the appropriate fields in the supplied configuration object without clearing them first, so it can be called repeatedly with different inputs to calculate totals. Be sure to zero the GATT server settings prior to the first call to this function.
Retrieves the pair of attribute handles associated with a local GATT characteristic.
Retrieves the attribute handle associated with a local GATT descriptor.
Retrieves the attribute handle associated with a local GATT service.
Resets the GATT server to its initial state. On success, this function removes all supported services, characteristics, and descriptors. This function requires that: o No peers are connected, and o No GAP operations are active (advertise, discover, or connect).
Prints dump of local GATT database. This is useful to log local state of database in human readable form.
Makes all registered services available to peers. This function gets called automatically by the NimBLE host on startup; manual calls are only necessary for replacing the set of supported services with a new one. This function requires that: o No peers are connected, and o No GAP operations are active (advertise, discover, or connect).
Set visibility of local GATT service. Invisible services are not removed from database but are not discoverable by peer devices. Service Changed should be handled by application when needed by calling ble_svc_gatt_changed().
Designates the specified event queue for NimBLE host work. By default, the host uses the default event queue and runs in the main task. This function is useful if you want the host to run in a different task.
Queries the controller for the channel map used with the specified connection. The channel map is represented as an array of five bytes, with each bit corresponding to an individual channel. The array is interpreted as little-endian, such that: map & 0x01 --> Channel 0. map & 0x02 --> Channel 1. ... map & 0x01 --> Channel 8.
Instructs the controller to use the specified channel map. The channel map is represented as an array of five bytes, with each bit corresponding to an individual channel. The array is interpreted as little-endian, such that: map & 0x01 --> Channel 0. map & 0x02 --> Channel 1. ... map & 0x01 --> Channel 8.
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.
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.
Determines the best address type to use for automatic address type resolution. Calculation of the best address type is done as follows:
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!).
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.
@brief Indicates whether the host is enabled. The host is enabled if it is starting or fully started. It is disabled if it is stopping or stopped.
Allocates an mbuf suitable for an ATT command packet. The resulting packet has sufficient leading space for:
Allocates an mbuf and fills it with the contents of the specified flat buffer.
Copies the contents of an mbuf into the specified flat buffer. If the flat buffer is too small to contain the mbuf's contents, it is filled to capacity and BLE_HS_EMSGSIZE is returned.
Causes the host to reset the NimBLE stack as soon as possible. The application is notified when the reset occurs via the host reset callback.
Enqueues a host start event to the default event queue. The actual host startup is performed in the host parent task, but using the default queue here ensures the event won't run until the end of main() when this is called during system initialization. This allows the application to configure the host package in the meantime.
@brief Called when the system is shutting down. Stops the BLE host.
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. This function must only be called in the host parent
task. A safe alternative for starting the stack from any task is to call
@brief Stops the BLE host.
Indicates whether the host has synchronized with the controller. Synchronization must occur before any host procedures can be performed.
@brief Compares two Bluetooth UUIDs.
@brief Copy Bluetooth UUID
@brief Constructs a UUID object from a byte array.
@brief Converts the specified UUID to its string representation.
@brief Converts the specified 16-bit UUID to a uint16_t.
Adjust the length of a mbuf, trimming either from the head or the tail of the mbuf.
Append data onto a mbuf
Reads data from one mbuf and appends it to another. On error, the specified data range may be partially appended. Neither mbuf is required to contain an mbuf packet header.
Performs a memory compare of the specified region of an mbuf chain against a flat buffer.
Compares the contents of two mbuf chains. The ranges of the two chains to be compared are specified via the two offset parameters and the len parameter. Neither mbuf chain is required to contain a packet header.
Attaches a second mbuf chain onto the end of the first. If the first chain contains a packet header, the header's length is updated. If the second chain has a packet header, its header is cleared.
Copies the contents of a flat buffer into an mbuf chain, starting at the specified destination offset. If the mbuf is too small for the source data, it is extended as necessary. If the destination mbuf contains a packet header, the header length is updated.
Duplicate a chain of mbufs. Return the start of the duplicated chain.
Increases the length of an mbuf chain by the specified amount. If there is not sufficient room in the last buffer, a new buffer is allocated and appended to the chain. It is an error to request more data than can fit in a single buffer.
Release a mbuf back to the pool
Free a chain of mbufs
Get an mbuf from the mbuf pool. The mbuf is allocated, and initialized prior to being returned.
Allocate a new packet header mbuf out of the os_mbuf_pool.
Locates the specified absolute offset within an mbuf chain. The offset can be one past than the total length of the chain, but no greater.
Creates a single chained mbuf from m1 and m2 utilizing all the available buffer space in all mbufs in the resulting chain. In other words, ensures there is no leading space in any mbuf in the resulting chain and trailing space only in the last mbuf in the chain. Mbufs from either chain may be freed if not needed. No mbufs are allocated. Note that mbufs from m2 are added to the end of m1. If m1 has a packet header, it is retained and length updated. If m2 has a packet header it is discarded. If m1 is NULL, NULL is returned and m2 is left untouched.
Initialize a pool of mbufs.
Increases the length of an mbuf chain by adding data to the front. If there is insufficient room in the leading mbuf, additional mbufs are allocated and prepended as necessary. If this function fails to allocate an mbuf, the entire chain is freed.
Prepends a chunk of empty data to the specified mbuf chain and ensures the chunk is contiguous. If either operation fails, the specified mbuf chain is freed and NULL is returned.
Rearrange a mbuf chain so that len bytes are contiguous, and in the data area of an mbuf (so that OS_MBUF_DATA() will work on a structure of size len.) Returns the resulting mbuf chain on success, free's it and returns NULL on failure.
Removes and frees empty mbufs from the front of a chain. If the chain contains a packet header, it is preserved.
Checks if a memory block was allocated from the specified mempool.
Get a memory block from a memory pool
Puts the memory block back into the pool
Puts the memory block back into the pool, ignoring the put callback, if any. This function should only be called from a put callback to free a block without causing infinite recursion.
Clears a memory pool.
Initializes an extended memory pool. Extended attributes (e.g., callbacks) are not specified when this function is called; they are assigned manually after initialization.
Get information about the next system memory pool.
Initialize a memory pool.
Performs an integrity check of the specified mempool. This function attempts to detect memory corruption in the specified memory pool.
Remove and return a single mbuf from the mbuf queue. Does not block.
Initializes an mqueue. An mqueue is a queue of mbufs that ties to a particular task's event queue. Mqueues form a helper API around a common paradigm: wait on an event queue until at least one packet is available, then process a queue of packets.
Adds a packet (i.e. packet header mbuf) to an mqueue. The event associated with the mqueue gets posted to the specified eventq.
Count the number of blocks in all the mbuf pools that are allocated.
Allocate a mbuf from msys. Based upon the data size requested, os_msys_get() will choose the mbuf pool that has the best fit.
Allocate a packet header structure from the MSYS pool. See os_msys_register() for a description of MSYS.
Return the number of free blocks in Msys
MSYS is a system level mbuf registry. Allows the system to share packet buffers amongst the various networking stacks that can be running simultaeneously.
De-registers all mbuf pools from msys.
Type of UUID
The host will free the attribute mbuf automatically after the callback is executed. The application can take ownership of the mbuf and prevent it from being freed by assigning NULL to attr->om.
The host will free the attribute mbufs automatically after the callback is executed. The application can take ownership of the mbufs and prevent them from being freed by assigning NULL to each attribute's om field.
@brief Stack reset callback
@typedef ble_hs_stop_fn @brief Callback function; reports the result of a host stop procedure.
@brief Stack sync callback
Searches the store for the first object matching the specified criteria. If a match is found, it is deleted from the store.
Searches the store for an object matching the specified criteria. If a match is found, it is read from the store and the dst parameter is populated with the retrieved object.
Indicates an inability to perform a store operation. This callback should do one of two things: o Address the problem and return 0, indicating that the store operation should proceed. o Return nonzero to indicate that the store operation should be aborted.
Writes the specified object to the store. If an object with the same identity is already in the store, it is replaced. If the store lacks sufficient capacity to write the object, this function may remove previously stored values to make room.
Block put callback function. If configured, this callback gets executed whenever a block is freed to the corresponding extended mempool. Note: The os_memblock_put() function calls this callback instead of freeing the block itself. Therefore, it is the callback's responsibility to free the block via a call to os_memblock_put_from_cb().
A discriminated union containing additional details concerning the GAP event. The 'type' field indicates which member of the union is valid.
The GATT operation being performed dictates which field in this union is valid. If a characteristic is being accessed, the chr field is valid. Otherwise a descriptor is being accessed, in which case the dsc field is valid.
The value of the op field determines which field in this union is valid.
A discriminated union containing additional details concerning the L2CAP event. The 'type' field indicates which member of the union is valid.
Used as a key for store lookups. This union must be accompanied by an object type code to indicate which field is valid.
Additional data related to the event; the valid field is inferred from the obj_type,event_code pair.
Represents stored data. This union must be accompanied by an object type code to indicate which field is valid.
Universal UUID type, to be used for any-UUID static allocation