aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-03-17 12:20:49 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2012-04-04 19:08:27 +0200
commit729a0917ac17e2c5a70ab24cc884ff68a7df52af (patch)
treeb6fab3d56abfcdf4af2ac7504271aef3940aefa8 /include
parent163707ba12dc7cee520eee88b4f1d4dad2c20049 (diff)
add rs232 support
This include an example to open /dev/ttyACM0 to receive data from u-blox GPS and one to configure it in TIMEPULSE2 mode.
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/netif/rs232.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/osmocom/netif/rs232.h b/include/osmocom/netif/rs232.h
new file mode 100644
index 0000000..30bc52b
--- /dev/null
+++ b/include/osmocom/netif/rs232.h
@@ -0,0 +1,21 @@
+#ifndef _OSMO_RS232_H_
+#define _OSMO_RS232_H_
+
+struct osmo_rs232;
+
+struct osmo_rs232 *osmo_rs232_create(void *ctx);
+
+void osmo_rs232_set_serial_port(struct osmo_rs232 *, const char *serial_port);
+void osmo_rs232_set_delay_us(struct osmo_rs232 *, int delay_us);
+void osmo_rs232_set_baudrate(struct osmo_rs232 *, int baudrate);
+void osmo_rs232_set_read_cb(struct osmo_rs232 *r, int (*read_cb)(struct osmo_rs232 *r));
+
+int osmo_rs232_open(struct osmo_rs232 *r);
+
+int osmo_rs232_read(struct osmo_rs232 *r, struct msgb *msg);
+int osmo_rs232_write(struct osmo_rs232 *r, struct msgb *msg);
+
+void osmo_rs232_close(struct osmo_rs232 *r);
+void osmo_rs232_destroy(struct osmo_rs232 *r);
+
+#endif /* _OSMO_RS232_H_ */