]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/blob - main.c
bdd5316702f4e365e159df7d64882f58ca5c5b33
[coffee/mt-apps.git] / main.c
1 /*
2  ============================================================================
3  Name        : main.c
4  Author      : Digital Logic
5  Version     : 1.0
6  Copyright   :
7  Description : Very simple test of uFR library
8  ============================================================================
9  */
10
11 #include <stdio.h>
12 #include <stdlib.h>
13
14 #include "/usr/include/uFCoder.h"
15
16 /**
17  * Calls ReaderOpenEx() and print status
18  */
19 UFR_STATUS reader_open_ex(uint32_t reader_type, c_string port_name, uint32_t port_interface)
20 {
21         UFR_STATUS status;
22
23         status = ReaderOpenEx(reader_type, port_name, port_interface, 0);
24         printf("ReaderOpenEx(%d, '%s', %d, 0):> %s\n", reader_type, port_name,
25                         port_interface, UFR_Status2String(status));
26
27         return status;
28 }
29
30 int main(void)
31 {
32         UFR_STATUS status;
33
34         puts("Test ReaderOpen version 1.0\n");
35         //--------------------------------------------------------------
36         printf("* uFCoder library version: %s\n\n", GetDllVersionStr());
37         //--------------------------------------------------------------
38
39         puts("Test opening Digital Logic shield uFR RS232 on RPi:");
40         status = ReaderOpen();
41         printf("ReaderOpen():> %s\n", UFR_Status2String(status));
42
43         status = ReaderUISignal(3, 3);
44         printf("ReaderUISignal(3, 3):> %s\n", UFR_Status2String(status));
45
46         puts(GetReaderDescription());
47
48         status = ReaderClose();
49         printf("ReaderClose():> %s\n", UFR_Status2String(status));
50
51         puts(".");
52
53         return EXIT_SUCCESS;
54 }
55