aboutsummaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-11-29 23:58:10 +0700
committerlaforge <laforge@osmocom.org>2023-12-03 02:19:33 +0000
commit59afb8f14ce77b681f34cade2a58f16dd1a048d4 (patch)
tree24c2fb4d578738c90062db5046f1dc489a69433f /src/core
parent84611881c9285915724da4933edeb4b0dcd1bb1d (diff)
soft_uart: add osmo_soft_uart_{get,set}_name()
Diffstat (limited to 'src/core')
-rw-r--r--src/core/libosmocore.map2
-rw-r--r--src/core/soft_uart.c16
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map
index 3d6aa424..4ae51085 100644
--- a/src/core/libosmocore.map
+++ b/src/core/libosmocore.map
@@ -444,6 +444,8 @@ osmo_soft_uart_default_cfg;
osmo_soft_uart_alloc;
osmo_soft_uart_free;
osmo_soft_uart_configure;
+osmo_soft_uart_get_name;
+osmo_soft_uart_set_name;
osmo_soft_uart_set_rx;
osmo_soft_uart_set_tx;
osmo_soft_uart_rx_ubits;
diff --git a/src/core/soft_uart.c b/src/core/soft_uart.c
index 4fffaeee..5ddddb45 100644
--- a/src/core/soft_uart.c
+++ b/src/core/soft_uart.c
@@ -396,6 +396,22 @@ int osmo_soft_uart_configure(struct osmo_soft_uart *suart, const struct osmo_sof
return 0;
}
+/*! Get a name for the given soft-UART instance.
+ * \param[in] suart soft-UART instance to get the name from.
+ * \returns name of the given soft-UART instance. */
+const char *osmo_soft_uart_get_name(const struct osmo_soft_uart *suart)
+{
+ return suart->name;
+}
+
+/*! Set a new name for the given soft-UART instance.
+ * \param[in] suart soft-UART instance to set the name for.
+ * \param[in] name the new name. */
+void osmo_soft_uart_set_name(struct osmo_soft_uart *suart, const char *name)
+{
+ osmo_talloc_replace_string(suart, (char **)&suart->name, name);
+}
+
/*! Enable/disable receiver of the given soft-UART.
* \param[in] suart soft-UART instance to be re-configured.
* \param[in] enable enable/disable state of the receiver.