-
Notifications
You must be signed in to change notification settings - Fork 13
updated to ZenohUTranspoart, updated signature, fixed dependencies and added clang-format.sh #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| #!/bin/bash | ||
|
|
||
| PROJECT_ROOT="$(realpath "$(dirname "$0")/../")" | ||
|
|
||
| if [ -n "$(which clang-format-13)" ]; then | ||
| # NOTE: Using clang-format-13 in CI system, too | ||
| FORMATTER=clang-format-13 | ||
| elif [ -n "$(which clang-format)" ]; then | ||
| echo "Did not find clang-format-13. Trying clang-format. Results may not" | ||
| echo "match formatting in GitHub CI process." | ||
| FORMATTER=clang-format | ||
| else | ||
| echo "Could not find clang-format. Please make sure it is installed" 1>&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| echo "Running $FORMATTER on all files in '$PROJECT_ROOT'" | ||
| shopt -s globstar | ||
|
|
||
| pushd "$PROJECT_ROOT" > /dev/null | ||
| for f in **/*.h **/*.cpp; do | ||
| if [[ ! ("$f" =~ "build/") ]]; then | ||
| echo | ||
| echo "Checking file '$f'" | ||
| $FORMATTER -i "$f" | ||
| fi | ||
| done | ||
| popd > /dev/null | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,7 @@ class UTransportDomainSockets : public transport::UTransport { | |
|
|
||
| void notifyListener(const v1::UMessage& message); | ||
| void listenThread(); // listen for incoming messages (thread) | ||
| void cleanupListener(CallableConn listener) override {} | ||
| void cleanupListener(const CallableConn& listener) override {} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this file needed anymore, now that we're using the Zenoh transport? 🤔 I'm in favor of mercilessly cutting out code to make a more maintainable codebase.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MaximilianToe and I chatted. Plan is:
Lemme know if I got anything mixed Max!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good! |
||
| }; // class UTransportDomainSockets | ||
|
|
||
| #endif // UTRANSPORT_DOMAIN_SOCKETS_H | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // SPDX-FileCopyrightText: 2025 Contributors to the Eclipse Foundation | ||
| // | ||
| // See the NOTICE file(s) distributed with this work for additional | ||
| // information regarding copyright ownership. | ||
| // | ||
| // This program and the accompanying materials are made available under the | ||
| // terms of the Apache License Version 2.0 which is available at | ||
| // https://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| /// This file attempts to list and document available configuration elements. | ||
| /// For a more complete view of the configuration's structure, check out `zenoh/src/config.rs`'s `Config` structure. | ||
| /// Note that the values here are correctly typed, but may not be sensible, so copying this file to change only the parts that matter to you is not good practice. | ||
| { | ||
| /// The identifier (as unsigned 128bit integer in hexadecimal lowercase - leading zeros are not accepted) | ||
| /// that zenoh runtime will use. | ||
| /// If not set, a random unsigned 128bit integer will be used. | ||
| /// WARNING: this id must be unique in your zenoh network. | ||
| // id: "1234567890abcdef", | ||
|
|
||
| /// The node's mode (router, peer or client) | ||
| mode: "peer", | ||
|
|
||
| connect: { | ||
| timeout_ms: { router: -1, peer: -1, client: -1 }, | ||
| endpoints: [ | ||
| // "<proto>/<address>" | ||
| ], | ||
| }, | ||
| queries_default_timeout: 10000 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,17 +24,18 @@ | |
| #include <spdlog/spdlog.h> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see a client and server for rpc. Am I missing where the source is for the publisher and subscriber in |
||
| #include <unistd.h> | ||
| #include <up-cpp/communication/RpcClient.h> | ||
| #include <up-transport-zenoh-cpp/ZenohUTransport.h> | ||
|
|
||
| #include <chrono> | ||
| #include <csignal> | ||
| #include <iostream> | ||
|
|
||
| #include "SocketUTransport.h" | ||
| #include "common.h" | ||
|
|
||
| using namespace uprotocol::v1; | ||
| using namespace uprotocol::communication; | ||
| using namespace uprotocol::datamodel::builder; | ||
| using ZenohUTransport = uprotocol::transport::ZenohUTransport; | ||
|
|
||
| bool gTerminate = false; | ||
|
|
||
|
|
@@ -83,11 +84,17 @@ int main(int argc, char** argv) { | |
| (void)argc; | ||
| (void)argv; | ||
|
|
||
| if (argc < 2) { | ||
| std::cout << "No Zenoh config has been provided" << std::endl; | ||
| std::cout << "Usage: rpc_client <config_file>" << std::endl; | ||
| return 1; | ||
| } | ||
|
|
||
| signal(SIGINT, signalHandler); | ||
|
|
||
| UUri source = getRpcUUri(0); | ||
| UUri method = getRpcUUri(12); | ||
| auto transport = std::make_shared<SocketUTransport>(source); | ||
| auto transport = std::make_shared<ZenohUTransport>(source, argv[1]); | ||
| auto client = | ||
| RpcClient(transport, std::move(method), UPriority::UPRIORITY_CS4, | ||
| std::chrono::milliseconds(500)); | ||
|
|
@@ -100,4 +107,3 @@ int main(int argc, char** argv) { | |
|
|
||
| return 0; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.