Pigweed
 
Loading...
Searching...
No Matches
channel.h
1// Copyright 2024 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14#pragma once
15
16#include "pw_async2/dispatcher.h"
17#include "pw_async2/once_sender.h"
18#include "pw_bluetooth/internal/raii_ptr.h"
19#include "pw_channel/channel.h"
20#include "pw_result/result.h"
21
22namespace pw::bluetooth::low_energy {
23
27enum class Psm : uint16_t {};
28
34
37};
38
42 public:
43 virtual ~Channel() = default;
44
46 virtual uint16_t max_transmit_size() = 0;
47
49 virtual uint16_t max_receive_size() = 0;
50
51 private:
52 virtual void Release() = 0;
53
54 public:
55 using Ptr = internal::RaiiPtr<Channel, &Channel::Release>;
56};
57
64 public:
65 virtual ~ChannelListener() = default;
66
69
71 virtual Psm psm() = 0;
72
73 private:
79 virtual void Release() = 0;
80
81 public:
82 using Ptr = internal::RaiiPtr<ChannelListener, &ChannelListener::Release>;
83};
84
86 public:
95 };
96
97 virtual ~ChannelListenerRegistry() = default;
98
113 ListenParameters parameters) = 0;
114};
115
116} // namespace pw::bluetooth::low_energy
Definition: once_sender.h:41
Definition: poll.h:54
Definition: dispatcher_base.h:318
Definition: channel.h:41
virtual uint16_t max_transmit_size()=0
Maximum payload size (SDU) that the peer supports receiving.
virtual uint16_t max_receive_size()=0
Maximum payload size (SDU) that this channel supports receiving.
virtual async2::Poll< Channel::Ptr > PendChannel(async2::Waker &&waker)=0
Poll to receive incoming channels.
virtual Psm psm()=0
The protocol/service multiplexer for this listener.
virtual async2::OnceReceiver< pw::Result< ChannelListener::Ptr > > ListenL2cap(ListenParameters parameters)=0
Definition: channel.h:56
The parameters to use for incoming channels.
Definition: channel.h:88
uint16_t max_receive_size
Maximum supported payload size (SDU) for receiving.
Definition: channel.h:90
SecurityRequirements security_requirements
Definition: channel.h:94
The authentication an encryption requirements for a channel.
Definition: channel.h:30
bool authentication_required
Definition: channel.h:33
bool secure_connections_required
If true, the link must be encrypted with a Secure Connections key.
Definition: channel.h:36