arjav1528 commented on code in PR #3512: URL: https://github.com/apache/nuttx-apps/pull/3512#discussion_r3331852326
########## system/microros/transport/microros_transport.c: ########## @@ -0,0 +1,60 @@ +/**************************************************************************** + * apps/system/microros/transport/microros_transport.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <errno.h> + +#include <rmw_microros/rmw_microros.h> + +#include "microros_transport.h" + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +int microros_transport_init(void) +{ +#if defined(CONFIG_MICROROS_TRANSPORT_UDP) + rmw_uros_set_custom_transport(false, + NULL, + (open_custom_func)microros_udp_open, + (close_custom_func)microros_udp_close, + (write_custom_func)microros_udp_write, + (read_custom_func)microros_udp_read); + return 0; +#elif defined(CONFIG_MICROROS_TRANSPORT_SERIAL) Review Comment: Not in this PR. rmw_uros_set_custom_transport() in the upstream Micro-XRCE-DDS Client / rmw_microxrcedds API registers a single global callback set per process. supporting concurrent UDP + serial backends needs an upstream API change to key callbacks per rcl_node_t (or per session). Out of scope for the initial transport landing we can revisit the when. multi-node use cases land in future PRs. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
