mirror of https://github.com/ARMmbed/mbed-os.git
add mtu events
parent
1492dc1e2a
commit
c452d8ff0e
|
@ -492,6 +492,37 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Function invoked when the connections changes the ATT_MTU which controls
|
||||
* the maximum size of an attribute that can be read in a single L2CAP packet
|
||||
* which might be fragmented across multiple packets.
|
||||
*
|
||||
* @param connectionHandle The handle of the connection that changed the size.
|
||||
* @param attMtuSize
|
||||
*/
|
||||
virtual void onAttMtuChanged(
|
||||
connection_handle_t connectionHandle,
|
||||
uint16_t attMtuSize
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Function invoked when the connections changes the maximum number of octets
|
||||
* that can be sent or received by the controller in a single packet.
|
||||
*
|
||||
* @param connectionHandle The handle of the connection that changed the size.
|
||||
* @param txSize Number of octets we can send on this connection in a single packet.
|
||||
* @param rxSize Number of octets we can receive on this connection in a single packet.
|
||||
*/
|
||||
virtual void onPacketPaylodSizeChanged(
|
||||
connection_handle_t connectionHandle,
|
||||
uint16_t txSize,
|
||||
uint16_t rxSize
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Prevent polymorphic deletion and avoid unnecessary virtual destructor
|
||||
|
|
|
@ -627,6 +627,17 @@ private:
|
|||
phy_t rx_phy
|
||||
);
|
||||
|
||||
virtual void on_att_mtu_changed(
|
||||
Handle_t connection_handle,
|
||||
uint16_t att_mtu_size
|
||||
);
|
||||
|
||||
virtual void on_packet_paylod_size_changed(
|
||||
Handle_t connection_handle,
|
||||
uint16_t tx_size,
|
||||
uint16_t rx_size
|
||||
);
|
||||
|
||||
virtual void on_phy_update_complete(
|
||||
pal::hci_error_code_t hci_status,
|
||||
Handle_t connection_handle,
|
||||
|
|
|
@ -44,6 +44,23 @@ struct Gap {
|
|||
ble::phy_t rx_phy
|
||||
) = 0;
|
||||
|
||||
/**
|
||||
* @copydoc Gap::EventHandler::onAttMtuChanged
|
||||
*/
|
||||
virtual void on_att_mtu_changed(
|
||||
Handle_t connection_handle,
|
||||
uint16_t att_mtu_size
|
||||
) = 0;
|
||||
|
||||
/**
|
||||
* @copydoc Gap::EventHandler::onPacketPaylodSizeChanged
|
||||
*/
|
||||
virtual void on_packet_paylod_size_changed(
|
||||
Handle_t connection_handle,
|
||||
uint16_t tx_size,
|
||||
uint16_t rx_size
|
||||
) = 0;
|
||||
|
||||
/**
|
||||
* @copydoc Gap::EventHandler::onPhyUpdateComplete
|
||||
*/
|
||||
|
|
|
@ -860,6 +860,23 @@ void GenericGap::on_read_phy(
|
|||
}
|
||||
}
|
||||
|
||||
void GenericGap::on_att_mtu_changed(
|
||||
Handle_t connection_handle,
|
||||
uint16_t att_mtu_size
|
||||
)
|
||||
{
|
||||
onAttMtuChanged(connectionHandle, attMtuSize);
|
||||
}
|
||||
|
||||
void GenericGap::on_packet_paylod_size_changed(
|
||||
Handle_t connection_handle,
|
||||
uint16_t tx_size,
|
||||
uint16_t rx_size
|
||||
)
|
||||
{
|
||||
onPacketPaylodSizeChanged(connectionHandle, txSize, rxSize);
|
||||
}
|
||||
|
||||
void GenericGap::on_phy_update_complete(
|
||||
pal::hci_error_code_t hci_status,
|
||||
Handle_t connection_handle,
|
||||
|
|
Loading…
Reference in New Issue