diff serial/main.c @ 41:5ee00413b8af

serial: beginning of fcsim-serial-be
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 20 Mar 2021 20:53:51 +0000
parents serial/atrmain.c@8f505d413815
children 6cc3eea720cb
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/serial/main.c	Sat Mar 20 20:53:51 2021 +0000
@@ -0,0 +1,31 @@
+/*
+ * This module implements the main() function for fcsim-serial-be.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+extern unsigned baud_base;
+
+main(argc, argv)
+	char **argv;
+{
+	int rc;
+
+	if (argc != 3) {
+		fprintf(stderr, "usage: %s ttyport baud\n", argv[0]);
+		exit(1);
+	}
+	open_serial_port(argv[1]);
+	parse_baud_spenh_arg(argv[2]);
+	set_serial_params(baud_base);
+	set_serial_nonblock(0);
+	serial_card_reset();
+	rc = collect_atr();
+	if (rc < 0)
+		exit(1);
+	print_atr("A");
+
+	/* remaining logic to be implemented */
+	exit(0);
+}