summaryrefslogtreecommitdiff
path: root/misc/tools/osmocon/serial.h
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-05-15 08:35:53 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-05-15 08:35:53 -0600
commite823e78623d957ee0b9d433c111f14add05a317e (patch)
tree1cb215de1f3b147832cc0de9cc08e2899ce378de /misc/tools/osmocon/serial.h
parent5f8d043efc6d56c7957bae00b886d4e57a71b56d (diff)
downloadnuttx-e823e78623d957ee0b9d433c111f14add05a317e.tar.gz
nuttx-e823e78623d957ee0b9d433c111f14add05a317e.tar.bz2
nuttx-e823e78623d957ee0b9d433c111f14add05a317e.zip
Add a copy of the Osmocom-BB osmocon tool
Diffstat (limited to 'misc/tools/osmocon/serial.h')
-rw-r--r--misc/tools/osmocon/serial.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/misc/tools/osmocon/serial.h b/misc/tools/osmocon/serial.h
new file mode 100644
index 000000000..889bd8a12
--- /dev/null
+++ b/misc/tools/osmocon/serial.h
@@ -0,0 +1,43 @@
+/*
+ * serial.h
+ *
+ * Copyright (C) 2011 Sylvain Munaut <tnt@246tNt.com>
+ *
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/*! \defgroup serial Utility functions to deal with serial ports
+ * @{
+ */
+
+/*! \file serial.h
+ * \file Osmocom serial port helpers
+ */
+
+#ifndef __OSMO_SERIAL_H__
+#define __OSMO_SERIAL_H__
+
+#include <termios.h>
+
+int osmo_serial_init(const char *dev, speed_t baudrate);
+int osmo_serial_set_baudrate(int fd, speed_t baudrate);
+int osmo_serial_set_custom_baudrate(int fd, int baudrate);
+int osmo_serial_clear_custom_baudrate(int fd);
+
+/*! @} */
+
+#endif /* __OSMO_SERIAL_H__ */