blob: f2812900fa418b9f31025b2eecb2bdfbb33e35e4 [file] [log] [blame]
#ifndef SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_L2CAP_TEST_PACKETS_H_
#define SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_L2CAP_TEST_PACKETS_H_
#include "src/connectivity/bluetooth/core/bt-host/common/byte_buffer.h"
#include "src/connectivity/bluetooth/core/bt-host/hci/hci.h"
#include "src/connectivity/bluetooth/core/bt-host/l2cap/l2cap.h"
#include "src/connectivity/bluetooth/core/bt-host/l2cap/types.h"
namespace bt::l2cap::testing {
// Signaling Packets
DynamicByteBuffer AclCommandRejectNotUnderstoodRsp(l2cap::CommandId id,
hci::ConnectionHandle handle,
ChannelId chan_id = kSignalingChannelId);
DynamicByteBuffer AclExtFeaturesInfoReq(l2cap::CommandId id, hci::ConnectionHandle handle);
DynamicByteBuffer AclExtFeaturesInfoRsp(l2cap::CommandId id, hci::ConnectionHandle handle,
l2cap::ExtendedFeatures features);
DynamicByteBuffer AclFixedChannelsSupportedInfoReq(l2cap::CommandId id,
hci::ConnectionHandle handle);
DynamicByteBuffer AclFixedChannelsSupportedInfoRsp(l2cap::CommandId id,
hci::ConnectionHandle handle,
l2cap::FixedChannelsSupported chan_mask);
DynamicByteBuffer AclNotSupportedInformationResponse(l2cap::CommandId id,
hci::ConnectionHandle handle);
DynamicByteBuffer AclConfigReq(l2cap::CommandId id, hci::ConnectionHandle handle,
l2cap::ChannelId dst_id, l2cap::ChannelParameters params);
DynamicByteBuffer AclConfigRsp(l2cap::CommandId id, hci::ConnectionHandle link_handle,
l2cap::ChannelId src_id, l2cap::ChannelParameters params);
DynamicByteBuffer AclConnectionReq(l2cap::CommandId id, hci::ConnectionHandle link_handle,
l2cap::ChannelId src_id, l2cap::PSM psm);
DynamicByteBuffer AclConnectionRsp(
l2cap::CommandId id, hci::ConnectionHandle link_handle, l2cap::ChannelId src_id,
l2cap::ChannelId dst_id, l2cap::ConnectionResult result = l2cap::ConnectionResult::kSuccess);
DynamicByteBuffer AclDisconnectionReq(l2cap::CommandId id, hci::ConnectionHandle link_handle,
l2cap::ChannelId src_id, l2cap::ChannelId dst_id);
DynamicByteBuffer AclConnectionParameterUpdateReq(l2cap::CommandId id,
hci::ConnectionHandle link_handle,
uint16_t interval_min, uint16_t interval_max,
uint16_t slave_latency,
uint16_t timeout_multiplier);
DynamicByteBuffer AclConnectionParameterUpdateRsp(l2cap::CommandId id,
hci::ConnectionHandle link_handle,
ConnectionParameterUpdateResult result);
// S-Frame Packets
DynamicByteBuffer AclSFrameReceiverReady(hci::ConnectionHandle link_handle,
l2cap::ChannelId channel_id, uint8_t receive_seq_num,
bool is_poll_request, bool is_poll_response);
// I-Frame Packets
DynamicByteBuffer AclIFrame(hci::ConnectionHandle link_handle, l2cap::ChannelId channel_id,
uint8_t receive_seq_num, uint8_t tx_seq, bool is_poll_response,
const ByteBuffer& payload);
} // namespace bt::l2cap::testing
#endif // SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_L2CAP_TEST_PACKETS_H_