@@ -55,6 +55,14 @@ enum class ICDModeAdvertise : uint8_t
55
55
kLIT , // The ICD is currently operating as a LIT. ICD=1 in DNS-SD key/value pairs.
56
56
};
57
57
58
+ enum class TCPModeAdvertise : uint16_t
59
+ {
60
+ kNone = 0 , // The device does not support TCP.
61
+ kTCPClient = 1 << 1 , // The device supports the TCP client.
62
+ kTCPServer = 1 << 2 , // The device supports the TCP server.
63
+ kTCPClientServer = (kTCPClient | kTCPServer ), // The device supports both the TCP client and server.
64
+ };
65
+
58
66
template <class Derived >
59
67
class BaseAdvertisingParams
60
68
{
@@ -102,13 +110,12 @@ class BaseAdvertisingParams
102
110
}
103
111
const std::optional<ReliableMessageProtocolConfig> & GetLocalMRPConfig () const { return mLocalMRPConfig ; }
104
112
105
- // NOTE: The SetTcpSupported API is deprecated and not compliant with 1.3. T flag should not be set.
106
- Derived & SetTcpSupported (std::optional<bool > tcpSupported)
113
+ Derived & SetTCPSupportModes (TCPModeAdvertise tcpSupportModes)
107
114
{
108
- mTcpSupported = tcpSupported ;
115
+ mTcpSupportModes = tcpSupportModes ;
109
116
return *reinterpret_cast <Derived *>(this );
110
117
}
111
- std::optional< bool > GetTcpSupported () const { return mTcpSupported ; }
118
+ TCPModeAdvertise GetTCPSupportModes () const { return mTcpSupportModes ; }
112
119
113
120
Derived & SetICDModeToAdvertise (ICDModeAdvertise operatingMode)
114
121
{
@@ -124,7 +131,7 @@ class BaseAdvertisingParams
124
131
uint8_t mMacStorage [kMaxMacSize ] = {};
125
132
size_t mMacLength = 0 ;
126
133
std::optional<ReliableMessageProtocolConfig> mLocalMRPConfig ;
127
- std::optional< bool > mTcpSupported ;
134
+ TCPModeAdvertise mTcpSupportModes = TCPModeAdvertise:: kNone ;
128
135
ICDModeAdvertise mICDModeAdvertise = ICDModeAdvertise::kNone ;
129
136
};
130
137
0 commit comments