C/C++ API Reference
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
25
29enum class Psm : uint16_t {};
30
36
39};
40
44 public:
45 virtual ~Channel() = default;
46
48 virtual uint16_t max_transmit_size() = 0;
49
51 virtual uint16_t max_receive_size() = 0;
52
53 private:
54 virtual void Release() = 0;
55
56 public:
57 using Ptr = internal::RaiiPtr<Channel, &Channel::Release>;
58};
59
66 public:
67 virtual ~ChannelListener() = default;
68
71
73 virtual Psm psm() = 0;
74
75 private:
81 virtual void Release() = 0;
82
83 public:
84 using Ptr = internal::RaiiPtr<ChannelListener, &ChannelListener::Release>;
85};
86
88 public:
97 };
98
99 virtual ~ChannelListenerRegistry() = default;
100
115 ListenParameters parameters) = 0;
116};
117
118} // namespace pw::bluetooth::low_energy
Definition: once_sender.h:43
Definition: poll.h:60
Definition: waker.h:160
Definition: channel.h:43
Definition: channel.h:55
bool authentication_required
Definition: channel.h:35
uint16_t max_receive_size
Maximum supported payload size (SDU) for receiving.
Definition: channel.h:92
virtual uint16_t max_transmit_size()=0
Maximum payload size (SDU) that the peer supports receiving.
bool secure_connections_required
If true, the link must be encrypted with a Secure Connections key.
Definition: channel.h:38
SecurityRequirements security_requirements
Definition: channel.h:96
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.
Psm
Definition: channel.h:29
virtual async2::OnceReceiver< pw::Result< ChannelListener::Ptr > > ListenL2cap(ListenParameters parameters)=0
virtual Psm psm()=0
The protocol/service multiplexer for this listener.
The parameters to use for incoming channels.
Definition: channel.h:90
The authentication an encryption requirements for a channel.
Definition: channel.h:32