Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zgbjgg/gnuart
The UART erlang application
https://github.com/zgbjgg/gnuart
erlang uart
Last synced: about 2 months ago
JSON representation
The UART erlang application
- Host: GitHub
- URL: https://github.com/zgbjgg/gnuart
- Owner: zgbjgg
- Created: 2014-02-13T19:51:45.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-18T17:43:28.000Z (almost 11 years ago)
- Last Synced: 2023-08-05T18:47:01.077Z (over 1 year ago)
- Topics: erlang, uart
- Language: C
- Homepage: https://github.com/zgbjgg/gnuart
- Size: 176 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
gnuart - the UART erlang application
======Compile the application and build the shared object
$ make all
Before start application, you must configure priv/gnuart.uart file. This file is the configuration where
the devname must be set. The order of the specs is:devname minimun_time maximum_time timeout
The specs can be changed at the runtime and could be reloaded when write data to devname.
Start the application with the code loaded
$ erl -pa ebin/
1> application:start(gnuart).
ok
From a valid process, subscribe it to gnuart2> gnuart:subscribe().
{ok,#Ref<0.0.0.39>}
Open the device before send some command3> gnuart:open().
ok
4> flush().
Shell got {got,#Ref<0.0.0.39>,<<"device_open">>}
okSend bytes
5> gnuart:flush("AA0065").
{ok,flush}
The response is delivered to the calling process (subscribed)6> flush().
Shell got {got,#Ref<0.0.0.39>,<<"FF0000">>}
ok
The device can be closed using7> gnuart:close().
Shell got {got,#Ref<0.0.0.37>,<<"device_close">>}
ok
However you can unsubscribe a process8> gnuart:unsubscribe(Ref).
{ok,unsubscribe}
License
===
See LICENSE.txt for more information