mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
node-webrtc: style fixes + authorship notes
Signed-off-by: Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
This commit is contained in:
parent
ca85117674
commit
d94d668d34
8 changed files with 28 additions and 14 deletions
|
@ -2,7 +2,9 @@
|
|||
*
|
||||
* @file
|
||||
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
||||
* @author Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
|
||||
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @copyright 2023, OPAL-RT Germany GmbH
|
||||
* @license Apache 2.0
|
||||
*********************************************************************************/
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
*
|
||||
* @file
|
||||
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
||||
* @author Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
|
||||
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @copyright 2023, OPAL-RT Germany GmbH
|
||||
* @license Apache 2.0
|
||||
*********************************************************************************/
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
*
|
||||
* @file
|
||||
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
||||
* @author Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
|
||||
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @copyright 2023, OPAL-RT Germany GmbH
|
||||
* @license Apache 2.0
|
||||
*********************************************************************************/
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
*
|
||||
* @file
|
||||
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
||||
* @author Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
|
||||
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @copyright 2023, OPAL-RT Germany GmbH
|
||||
* @license Apache 2.0
|
||||
*********************************************************************************/
|
||||
|
||||
|
@ -52,7 +54,6 @@ struct SignalingMessage {
|
|||
std::string toString() const;
|
||||
};
|
||||
|
||||
|
||||
} /* namespace webrtc */
|
||||
} /* namespace node */
|
||||
} /* namespace villas */
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/** Node-type: webrtc
|
||||
*
|
||||
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
||||
* @author Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
|
||||
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @copyright 2023, OPAL-RT Germany GmbH
|
||||
* @license Apache 2.0
|
||||
*********************************************************************************/
|
||||
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
*
|
||||
* @file
|
||||
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
||||
* @author Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
|
||||
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @copyright 2023, OPAL-RT Germany GmbH
|
||||
* @license Apache 2.0
|
||||
*********************************************************************************/
|
||||
|
||||
|
@ -137,7 +139,7 @@ void PeerConnection::setupDataChannel(std::shared_ptr<rtc::DataChannel> dc)
|
|||
chan->onClosed([this](){ this->onDataChannelClosed(); });
|
||||
chan->onError([this](auto err){ this->onDataChannelError(std::move(err)); });
|
||||
|
||||
// if this node has it's data channel set up, don't accept any new ones
|
||||
// If this node has it's data channel set up, don't accept any new ones
|
||||
conn->onDataChannel(nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/** WebRTC signaling client
|
||||
*
|
||||
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
||||
* @author Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
|
||||
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @copyright 2023, OPAL-RT Germany GmbH
|
||||
* @license Apache 2.0
|
||||
*********************************************************************************/
|
||||
|
||||
|
@ -73,9 +75,9 @@ void SignalingClient::connect()
|
|||
void SignalingClient::disconnect()
|
||||
{
|
||||
running = false;
|
||||
// TODO
|
||||
// wait for connectStatic to exit
|
||||
// close LWS connection
|
||||
// TODO:
|
||||
// - wait for connectStatic to exit
|
||||
// - close LWS connection
|
||||
if (wsi)
|
||||
lws_callback_on_writable(wsi);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
/** WebRTC signaling messages.
|
||||
*
|
||||
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
||||
* @author Philipp Jungkamp <Philipp.Jungkamp@opal-rt.com>
|
||||
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
||||
* @copyright 2023, OPAL-RT Germany GmbH
|
||||
* @license Apache 2.0
|
||||
*********************************************************************************/
|
||||
|
||||
|
@ -15,14 +17,13 @@ using namespace villas;
|
|||
using namespace villas::node;
|
||||
using namespace villas::node::webrtc;
|
||||
|
||||
|
||||
json_t * Connection::toJSON() const
|
||||
{
|
||||
return json_pack("{ s:i, s:s, s:s, s:s }",
|
||||
"id", id,
|
||||
"remote", remote.c_str(),
|
||||
"user_agent", userAgent.c_str(),
|
||||
"created", "" // TODO
|
||||
"created", "" // TODO: create json timestamp
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -74,8 +75,8 @@ RelayMessage::RelayMessage(json_t *json)
|
|||
server.username = user;
|
||||
server.password = pass;
|
||||
|
||||
// TODO warn about unsupported realm
|
||||
// TODO log info expires time
|
||||
// TODO: warn about unsupported realm
|
||||
// TODO: log info about expires time
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,14 +168,14 @@ SignalingMessage SignalingMessage::fromJSON(json_t *json)
|
|||
{
|
||||
auto self = SignalingMessage { std::monostate() };
|
||||
|
||||
// relay message
|
||||
// Relay message
|
||||
json_t *rlys = nullptr;
|
||||
// control message
|
||||
// Control message
|
||||
json_t *ctrl = nullptr;
|
||||
// candidate message
|
||||
// Candidate message
|
||||
const char *cand = nullptr;
|
||||
const char *mid = nullptr;
|
||||
// description message
|
||||
// Description message
|
||||
const char *desc = nullptr;
|
||||
const char *typ = nullptr;
|
||||
|
||||
|
@ -189,7 +190,7 @@ SignalingMessage SignalingMessage::fromJSON(json_t *json)
|
|||
"type", &typ
|
||||
);
|
||||
|
||||
// exactly 1 field may be specified
|
||||
// Exactly 1 field may be specified
|
||||
const void *fields[] = { ctrl, cand, desc };
|
||||
if (ret || std::count(std::begin(fields), std::end(fields), nullptr) < std::make_signed_t<size_t>(std::size(fields)) - 1)
|
||||
throw RuntimeError("Failed to decode signaling message");
|
||||
|
|
Loading…
Add table
Reference in a new issue