mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-21 04:33:10 +08:00
zenoh: Default to 127.0.0.1 when using sitl/posix
Also improve error message when connection failed
This commit is contained in:
committed by
Beat Küng
parent
a24b3a121c
commit
923257779a
@@ -16,6 +16,11 @@ if MODULES_ZENOH
|
||||
2: INFO + ERROR
|
||||
3: DEBUG + INFO + ERROR
|
||||
|
||||
config ZENOH_DEFAULT_LOCATOR
|
||||
string "Zenoh default mode"
|
||||
default "tcp/127.0.0.1:7447" if PLATFORM_POSIX
|
||||
default "" if !PLATFORM_POSIX
|
||||
|
||||
# Choose exactly one item
|
||||
choice ZENOH_PUBSUB_SELECTION
|
||||
prompt "Publishers/Subscribers selection"
|
||||
|
||||
@@ -126,7 +126,10 @@ void ZENOH::run()
|
||||
ret = z_open(&s, z_move(config), NULL);
|
||||
|
||||
if (ret < 0) {
|
||||
if (ret == _Z_ERR_SCOUT_NO_RESULTS) {
|
||||
if (ret == _Z_ERR_TRANSPORT_OPEN_FAILED) {
|
||||
PX4_ERR("Unable to open session, make sure zenohd is running on %s", locator);
|
||||
|
||||
} else if (ret == _Z_ERR_SCOUT_NO_RESULTS) {
|
||||
PX4_ERR("Unable to open session, scout no results");
|
||||
|
||||
} else {
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <uORB/topics/uORBTopics.hpp>
|
||||
|
||||
|
||||
const char *default_net_config = Z_CONFIG_MODE_DEFAULT;
|
||||
const char *default_net_config = Z_CONFIG_MODE_DEFAULT ";" CONFIG_ZENOH_DEFAULT_LOCATOR;
|
||||
const char *default_pub_config = "";
|
||||
const char *default_sub_config = ""; //TODO maybe use YAML
|
||||
|
||||
|
||||
Reference in New Issue
Block a user