Skip to content

Commit cb5c90f

Browse files
committed
Working on tests etc.
1 parent 3c72fa2 commit cb5c90f

File tree

5 files changed

+59
-11
lines changed

5 files changed

+59
-11
lines changed

README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,53 @@
33
#The uart application#
44

55

6-
##Modules##
6+
7+
### Interface description ###
78

89

910
<table width="100%" border="0" summary="list of modules">
1011
<tr><td><a href="http://github.com/tonyrog/uart/blob/master/doc/uart.md" class="module">uart</a></td></tr></table>
1112

13+
### Dependencies ###
14+
15+
To build uart you will need a working installation of Erlang R15B (or
16+
later).<br/>
17+
Information on building and installing [Erlang/OTP](http://www.erlang.org)
18+
can be found [here](https://github.com/erlang/otp/wiki/Installation)
19+
([more info](https://github.com/erlang/otp/blob/master/INSTALL.md)).
20+
21+
uart is built using rebar that can be found [here](https://github.com/basho/rebar), with building instructions [here](https://github.com/basho/rebar/wiki/Building-rebar).
22+
23+
uart also requires the following applications to be installed:
24+
<ul>
25+
<li>dtread - https://github.com/tonyrog/dtread</li>
26+
</ul>
27+
28+
### Downloading
29+
30+
Clone the repository in a suitable location:
31+
32+
```sh
33+
$ git clone git://github.com/tonyrog/uart.git
34+
```
35+
### Configurating
36+
#### Concepts
37+
38+
...
39+
40+
#### Files
41+
42+
...
43+
44+
### Building
45+
46+
Compile:
47+
48+
```sh
49+
$ cd uart
50+
$ rebar compile
51+
...
52+
==> uart (compile)
53+
```
54+
55+

rebar.config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@
3838
{"./README.md",
3939
"http://github.com/tonyrog/uart"}}]}.
4040

41+
{ct_extra_params, " -ct_config test/uart.cfg"}.
42+

src/uart.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ recv_(Uart, Length, Timeout) when
469469
{'EXIT', Uart, _Reason} ->
470470
{error, closed}
471471
end;
472-
Error -> Error
472+
Error ->
473+
Error
473474
end.
474475

475476
%%--------------------------------------------------------------------

test/uart_test.cfg renamed to test/uart.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
%% Configuration file for testing of uart
33
%%
44

5-
%% Drivers
6-
{driver, [{darwin, [{a, "/dev/tty.usbserial-FTF5DP2J"},
5+
%% Devices
6+
%% Must be adapted !!! Find devicename in System Profile
7+
{device, [{darwin, [{a, "/dev/tty.usbserial-FTF5DP2J"},
78
{b, "/dev/tty.usbserial-FTFBXORB"}]},
89
{linux, [{a, "/dev/ttyUSB0"},
910
{b, "/dev/ttyUSB1"}]},

test/uart_SUITE.erl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
%%--------------------------------------------------------------------
4444
suite() ->
4545
[{timetrap,{minutes,10}},
46-
{require, driver}].
46+
{require, device}].
4747

4848

4949
%%--------------------------------------------------------------------
@@ -301,25 +301,25 @@ tty(a) ->
301301
case os:type() of
302302
{unix,darwin} ->
303303
%% "/dev/tty.usbserial-FTF5DP2J";
304-
ct:get_config({driver, darwin, a});
304+
ct:get_config({device, darwin, a});
305305
{unix,linux} ->
306306
%% "/dev/ttyUSB0";
307-
ct:get_config({driver, linux, a});
307+
ct:get_config({device, linux, a});
308308
{win32,_} ->
309309
%% "COM10"
310-
ct:get_config({driver, win32, a})
310+
ct:get_config({device, win32, a})
311311
end;
312312
tty(b) ->
313313
case os:type() of
314314
{unix,darwin} ->
315315
%% "/dev/tty.usbserial-FTFBXORB";
316-
ct:get_config({driver, darwin, b});
316+
ct:get_config({device, darwin, b});
317317
{unix,linux} ->
318318
%% "/dev/ttyUSB1";
319-
ct:get_config({driver, linux, b});
319+
ct:get_config({device, linux, b});
320320
{win32,_} ->
321321
%% "COM11"
322-
ct:get_config({driver, win32, b})
322+
ct:get_config({device, win32, b})
323323
end;
324324
tty(pty) ->
325325
"pty";

0 commit comments

Comments
 (0)