]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/commitdiff
open reader manually
authorJiří Matěják <jiri.matejak@fel.cvut.cz>
Tue, 17 Apr 2018 13:31:36 +0000 (15:31 +0200)
committerJiří Matěják <jiri.matejak@fel.cvut.cz>
Tue, 17 Apr 2018 13:31:36 +0000 (15:31 +0200)
main.c

diff --git a/main.c b/main.c
index 68e1150633006a1a3827b30f29145d9e40153e39..c4e6cef515256e69142c34a6642331a5bc655f8b 100644 (file)
--- a/main.c
+++ b/main.c
 
 #include "uFCoder.h"
 
-/**
- * Calls ReaderOpenEx() and print status
- */
-UFR_STATUS reader_open_ex(uint32_t reader_type, c_string port_name, uint32_t port_interface)
-{
-       UFR_STATUS status;
-
-       status = ReaderOpenEx(reader_type, port_name, port_interface, 0);
-       printf("ReaderOpenEx(%d, '%s', %d, 0):> %s\n", reader_type, port_name,
-                       port_interface, UFR_Status2String(status));
-
-       return status;
-}
+#define READER_TYPE 1 //uFR type (1Mbps)
+#define PORT_NAME "/dev/ttyUSB0" //"NULL" for all
+#define PORT_INTERFACE 1 //Serial
 
 int main(void)
 {
@@ -37,7 +27,7 @@ int main(void)
        //--------------------------------------------------------------
 
        puts("Test opening Digital Logic shield uFR RS232 on RPi:");
-       status = ReaderOpen();
+       status = ReaderOpenEx(READER_TYPE, PORT_NAME, PORT_INTERFACE, 0);
        printf("ReaderOpen():> %s\n", UFR_Status2String(status));
 
        status = ReaderUISignal(3, 3);