Skip to content

Commit ba01eda

Browse files
committed
add doxyfile
1 parent bebbcc6 commit ba01eda

File tree

4 files changed

+2907
-4
lines changed

4 files changed

+2907
-4
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.vscode
22
build
3-
tests/build
3+
tests/build
4+
docs/html

AsioProtocols.hpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,20 @@ namespace ProtoComm
5353
AsioSerialProtocol(const AsioSerialProtocol&) = delete;
5454
AsioSerialProtocol& operator=(const AsioSerialProtocol&) = delete;
5555

56+
/**
57+
* @brief Gets the serial port of a specific channel.
58+
*
59+
* @param channelId The unique id of the channel.
60+
* @return The serial port.
61+
*/
5662
const asio::serial_port& Port(ICommProtocol::ChannelId channelId) const;
63+
64+
/**
65+
* @brief Gets the serial port of a specific channel.
66+
*
67+
* @param name The name of the port.
68+
* @return The serial port if found, `std::nullopt` otherwise.
69+
*/
5770
std::optional<std::reference_wrapper<const asio::serial_port>> Port(const std::string& name) const;
5871

5972
size_t ChannelCount() const override;
@@ -62,6 +75,17 @@ namespace ProtoComm
6275
bool IsRunning(ICommProtocol::ChannelId channelId) const override;
6376
void SetChannelEventCallback(ICommProtocol::ChannelEventCallback callback) override;
6477

78+
/**
79+
* @brief Opens a new serial port as a managable channel.
80+
*
81+
* @param portName The name of the port to open.
82+
* @param baudRate The baud rate.
83+
* @param dataBits The number of data bits.
84+
* @param stopBits The number of stop bits.
85+
* @param parity The parity checking mode.
86+
* @param flowControl The flow control mode.
87+
* @return The unique id of the created channel on success, `std::nullopt` on fail.
88+
*/
6589
std::optional<ICommProtocol::ChannelId> Start(
6690
const std::string& portName,
6791
asio::serial_port_base::baud_rate baudRate,
@@ -109,6 +133,11 @@ namespace ProtoComm
109133
AsioTcpClient(const AsioTcpClient&) = delete;
110134
AsioTcpClient& operator=(const AsioTcpClient&) = delete;
111135

136+
/**
137+
* @brief Gets the tcp socket.
138+
*
139+
* @return The tcp socket.
140+
*/
112141
const asio::ip::tcp::socket& Socket() const;
113142

114143
size_t ChannelCount() const override;
@@ -117,6 +146,13 @@ namespace ProtoComm
117146
bool IsRunning(ICommProtocol::ChannelId channelId) const override;
118147
void SetChannelEventCallback(ICommProtocol::ChannelEventCallback callback) override;
119148

149+
/**
150+
* @brief Connects to a remote server.
151+
*
152+
* @param host The hostname or IP address of the server.
153+
* @param port The port number.
154+
* @return The unique id of the channel on success, `std::nullopt` on fail.
155+
*/
120156
std::optional<ICommProtocol::ChannelId> Start(const std::string& host, const std::string& port);
121157

122158
void Stop() override;
@@ -178,6 +214,16 @@ namespace ProtoComm
178214
bool IsRunning(ICommProtocol::ChannelId channelId) const override;
179215
void SetChannelEventCallback(ICommProtocol::ChannelEventCallback callback) override;
180216

217+
/**
218+
* @brief Starts the server and begins listening.
219+
*
220+
* @note The channels represent clients in this protocol,
221+
* hence this method will always return `std::nullopt`.
222+
*
223+
* @param host The local IP address to bind to.
224+
* @param port The port number to listen on.
225+
* @return Always `std::nullopt`.
226+
*/
181227
std::optional<ICommProtocol::ChannelId> Start(const std::string& host, const std::string& port);
182228

183229
void Stop() override;

ProtoComm.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ namespace ProtoComm
250250

251251
#pragma endregion Frame Handlers
252252

253-
#pragma region Comm
253+
#pragma region Comm Protocol
254254

255255
/**
256256
* @brief Interface for communication protocols.
@@ -263,7 +263,7 @@ namespace ProtoComm
263263
*/
264264
enum class ChannelEventType
265265
{
266-
/** @biref Indicates that a new channel has been added. */
266+
/** @brief Indicates that a new channel has been added. */
267267
ChannelAdded,
268268
/** @brief Indicates that an existing channel has been removed. */
269269
ChannelRemoved
@@ -383,6 +383,10 @@ namespace ProtoComm
383383
{ t.Start(std::forward<Args>(args)...) } -> std::same_as<std::optional<ICommProtocol::ChannelId>>;
384384
};
385385

386+
#pragma endregion Comm Protocol
387+
388+
#pragma region Comm Stream
389+
386390
/**
387391
* @brief Manages message-based communication over a protocol.
388392
*
@@ -1191,7 +1195,7 @@ namespace ProtoComm
11911195
}
11921196
};
11931197

1194-
#pragma endregion Comm
1198+
#pragma endregion Comm Stream
11951199

11961200
}
11971201

0 commit comments

Comments
 (0)