Add new C37.118 Synchrophasor node-type (reloaded) - #1023
Conversation
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
Signed-off-by: Philipp Jungkamp <philipp.jungkamp@rwth-aachen.de>
| } | ||
|
|
||
| template <typename T, std::size_t shift, std::size_t mask> | ||
| class bit_field_proxy { |
There was a problem hiding this comment.
Class defintion in header?
There was a problem hiding this comment.
I don't add classes to headers that don't have to be shared. The header only exists to allow the unit test to verify the protocol implementation.
|
|
||
| bool C37Node::recvAll(int sd, std::span<std::byte> buf) { | ||
| std::size_t offset = 0; | ||
| while (offset < buf.size()) { |
There was a problem hiding this comment.
Is there a maximal buffer size allowed in c37?
There was a problem hiding this comment.
Yes, 65535 bytes, why?
There was a problem hiding this comment.
Not sure if it needs to be checked ... But it is quite large, so probably not
There was a problem hiding this comment.
This function is essentially unrelated to C37. You give it a mutable span of bytes and recvAll fills that entire span with data. The C37 buffer size isn't part of this function's contract.
|
Nice impelementation, thanks :) |
| } | ||
|
|
||
| if (paths.empty()) { | ||
| *error = "include directive did not match any file"; |
There was a problem hiding this comment.
Maybe I did not see it, but is the error somewhere logged for the user?
There was a problem hiding this comment.
Yes. This function is a callback for a C library and thus is not allowed to throw any exceptions. The error here is later read from config_error_text if config_read failed.
|
Yes. Documentation is ready, I just didn't open a PR yet. I'm definitely missing an integration test though. I'll add one when I'm back. |
Description
nlohmann::json#1001New comprehensive node type implementing the C37.118.2-2011 protocol over TCP acting as both client and server. It features near zero-configuration for the client-side and a relatively simple configuration for the server-side.
{ "nodes": { "c37_118": { "type": "c37.118", "in": { "address": "localhost", "idcode": 48879 }, "out": { "address": "localhost", "idcode": 48879, "data_rate": 10, "pmus": [ { "name": "VILLASnode", "idcode": 48879, "frequency": "frequency_signal0", "rocof": "rocof_signal0", "phasor": [ { "signal": "phasor_signal0", "unit": "volt" }, { "signal": "phasor_signal1", "unit": "volt" }, { "signal": "phasor_signal2", "unit": "volt" } ] } ] } } } }Unimplemented
Mentions