Add 16-bit value at the end of the buffer Adds 16-bit value in little endian format at the end of buffer. Increments the data length of a buffer to account for more data at the end.
Add (8-bit) byte at the end of the buffer Increments the data length of the buffer to account for more data at the end.
Remove and convert 16 bits from the beginning of the buffer. Same idea as with net_buf_simple_pull(), but a helper for operating on 16-bit little endian data.
Remove a 8-bit value from the beginning of the buffer Same idea as with net_buf_simple_pull(), but a helper for operating on 8-bit values.
Initialize a model message. Clears the message buffer contents, and encodes the given opcode. The message buffer will be ready for filling in payload data.
Send an Access Layer message.
Prepare data to be added at the end of the buffer Increments the data length of a buffer to account for more data at the end.
Adjust the length of a mbuf, trimming either from the head or the tail of the mbuf.
Remove data from the beginning of the buffer. Removes data from the beginning of the buffer by modifying the data pointer and buffer length.
Remove data from the beginning of the buffer. Removes data from the beginning of the buffer by modifying the data pointer and buffer length.
Remove and convert 16 bits from the beginning of the buffer. Same idea as with net_buf_simple_pull(), but a helper for operating on 16-bit big endian data.
Push 8-bit value to the beginning of the buffer Adds 8-bit value the beginning of the 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.
Add 16-bit value at the end of the buffer Adds 16-bit value in big endian format at the end of buffer. Increments the data length of a buffer to account for more data at the end.
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.
Add 32-bit value at the end of the buffer Adds 32-bit value in little endian format at the end of buffer. Increments the data length of a buffer to account for more data at the end.
Push data to the beginning of the buffer. Modifies the data pointer and buffer length to account for more data in the beginning of the buffer.
Add 32-bit value at the end of the buffer Adds 32-bit value in big endian format at the end of buffer. Increments the data length of a buffer to account for more data at the end.
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.
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. If there is room, it will add up to "max_protohdr - len" extra bytes to the contiguous region, in an attempt to avoid being called next time.
Transmits a response or error message over the specified connection. The specified rc and err_status values control what gets sent as follows: o If rc == 0: tx an affirmative response. o Else if err_status != 0: tx an error response. o Else: tx nothing. In addition, if transmission of an affirmative response fails, an error is sent instead.
Remove and convert 32 bits from the beginning of the buffer. Same idea as with net_buf_simple_pull(), but a helper for operating on 32-bit little endian data.
Remove and convert 32 bits from the beginning of the buffer. Same idea as with net_buf_simple_pull(), but a helper for operating on 32-bit big endian data.
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.
Sends a "free-form" characteristic notification. This function consumes the supplied mbuf regardless of the outcome.
Put a buffer into a list Put a buffer to the end of a list. If the buffer contains follow-up fragments this function will take care of inserting them as well into the list.
Increment the reference count of a buffer.
Release a mbuf back to the pool
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.
Push 16-bit value to the beginning of the buffer Adds 16-bit value in big endian format to the beginning of the buffer.
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.
Push 24-bit value to the beginning of the buffer Adds 24-bit value in big endian format to the beginning of the buffer.
Clone buffer state, using the same data buffer. Initializes a buffer to point to the same data as an existing buffer. Allows operations on the same data without altering the length and offset of the original.
Add 24-bit value at the end of the buffer Adds 24-bit value in little endian format at the end of buffer. Increments the data length of a buffer to account for more data at the end.
Calculates the length of an mbuf chain. Calculates the length of an mbuf chain. If the mbuf contains a packet header, you should use `OS_MBUF_PKTLEN()` as a more efficient alternative to this function.
Sends a "free-form" characteristic indication. The provided mbuf contains the indication payload. This function consumes the supplied mbuf regardless of the outcome.
$handle value notification *
Transmits the L2CAP payload contained in the specified mbuf. The supplied mbuf is consumed, regardless of the outcome of the function call.
Allocates an mbuf to be used for an ATT response. If an mbuf cannot be allocated, the received request mbuf is reused for the error response.
Higher level functionality
Logs the content of an `os_mbuf` structure. This function iterates over each byte in the provided `os_mbuf` and logs its value in hexadecimal format using the `BLE_HS_LOG` macro with the log level set to DEBUG.
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. The specified mbuf chain does not need to contain a packet header.
Writes the received value from a characteristic write to the given destination.
Push 16-bit value to the beginning of the buffer Adds 16-bit value in little endian format to the beginning of the buffer.
Remove and convert 24 bits from the beginning of the buffer. Same idea as with net_buf_simple_pull(), but a helper for operating on 24-bit little endian data.
Initiates GATT procedure: Write Characteristic Value. This function consumes the supplied mbuf regardless of the outcome.
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.
Send an SDU (Service Data Unit) over an L2CAP channel. This function sends an SDU over the specified L2CAP channel. The SDU is encapsulated in L2CAP frames and transmitted to the remote device.
$multiple handle value notification *
Dispatches an incoming ATT read-multiple-response to the appropriate active GATT procedure.
Handles an incoming read-response for the specified read-long-characteristic-values proc.
Calls a read-multiple-characteristics proc's callback with the specified parameters. If the proc has no callback, this function is a no-op.
Copy a packet header from one mbuf to another.
Initiates GATT procedure: Write Long Characteristic Values. This function consumes the supplied mbuf regardless of the outcome.
Performs a memory compare of the specified region of an mbuf chain against a flat buffer.
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.
Removes and frees empty mbufs from the front of a chain. If the chain contains a packet header, it is preserved.
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.
Saves Client Supported Features for specified connection.
Sends ACL data from host to controller.
Initiate an L2CAP connection. This function initiates an L2CAP connection to a remote device with the specified connection handle, Protocol/Service Multiplexer (PSM), Maximum Transmission Unit (MTU) size, and receive SDU buffer. When the connection is established or if there is an error during the connection process, the provided callback function will be invoked with the corresponding event information.
Check if the L2CAP channel is ready to receive an SDU. This function checks if the specified L2CAP channel is ready to receive an SDU (Service Data Unit). It can be used to determine if the channel is in a state where it can accept incoming data.
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.
Transmits an HCI ACL data packet. This function consumes the supplied mbuf, regardless of the outcome.
Writes the received value from a characteristic write to the given destination.
Writes the received value from a characteristic write to the given destination.
Writes the received value from a characteristic write to the given destination.
Writes the received value from a characteristic write to the given destination.
Writes the received value from a characteristic write to the given destination.
Associates incoming data packet with a connection handle of the sender. If flow control is disabled, this function is a no-op.
Enqueues an ACL data packet for transmission. This function consumes the supplied mbuf, regardless of the outcome.
Called when a data packet is received from the controller. This function consumes the supplied mbuf, regardless of the outcome.
$handle value indication *
Dispatches an incoming ATT read-response to the appropriate active GATT procedure.
Dispatches an incoming ATT read-blob-response to the appropriate active GATT procedure.
Dispatches an incoming ATT prepare-write-response to the appropriate active GATT procedure.
Processes an incoming L2CAP fragment.
Fills a Find-By-Type-Value-Response with single entry.
Handles an incoming read-response for the specified find-included-services proc.
Handles an incoming read-response for the specified read-characteristic-value proc.
Handles an incoming prepare-write-response for the specified write-long-cahracteristic-values proc.
Handles an incoming prepare-write-response for the specified write-reliable-cahracteristic-values proc.
Iterate through all valid network credentials to decrypt a message.
Send a mesh model message. Send a mesh model layer message out into the mesh network without having instantiated the relevant mesh models.
Transmits a packet over a connection-oriented channel. This function only consumes the supplied mbuf on success.
Adds a packet (i.e. packet header mbuf) to an mqueue. The event associated with the mqueue gets posted to the specified eventq.
Increases the length of an mbuf chain by inserting a gap at the specified offset. The contents of the gap are indeterminate. If the mbuf chain contains a packet header, its total length is increased accordingly. This function never frees the provided mbuf chain.
Duplicate a chain of mbufs. Return the start of the duplicated chain.
Deprecated. Should not be used. Use ble_gatts_notify_custom instead.
Deprecated. Should not be used. Use ble_gatts_indicate_custom instead.
Sends ACL data from controller to host.
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.
Fills the supplied mbuf with the variable length Handles-Information-List field of a Find-By-Type-Value ATT response.
Fills the supplied mbuf with the variable length Information Data field of a Find Information ATT response.
Called when a data packet is received from the controller. This function consumes the supplied mbuf, regardless of the outcome.
Performs a read or write access on a client characteritic configuration descriptor (CCCD).
Applies a pullup operation to the supplied mbuf and returns a pointer to the start of the mbuf data. This is simply a convenience function which allows the user to access the mbuf data without a cast. On failure, the provided mbuf is freed.
Sends ACL data from host to controller.