pasori-ruby
Pasori-ruby offers Ruby bindings to
libpasori?. It is intended to provide an interface to the
Sony Felica? reader. The Felica system is used for example in the
Suica? and
Pasmo? IC cards. The methods provided are targeted towards the Suica/Pasmo cards.
The methods available are:
- connect/disconnect -- do what their names suggest
- value -- retrieves the current value of the card
- suicaId/suicaPm -- retrieve ID resp. PM of the card
- history -- retrieves the usage history of the card (last 20 transactions) in a hash map (see example program)
To install the module, go to the "module" subdirectory of the tarball, run ruby on "extconf.rb" and build and install the distribution with the generated makefile. You'll need to have libpasori (shared object file and headers) installed. As libpasori does not come with a makefile, you might want to use the makefile attached to this page.
Example application -- ViewSuica
The tarball contains an example application in the "ui" subdirectory. It reads and displays the current value and transaction history of Suica/Pasmo cards (see screenshot). The station codes are resolved to names using the
SF Card Fan DB? SOAP webservice. The WSDL file provided on the website contains errors though, that's why a modified version is included in the tarball.
The GUI was created with
QT Designer? and uses the QT4 Ruby bindings. The Ruby code for the GUI is generated from the .ui XML file with rbuic4. The included Rakefile's default task takes care of this.
Both library and application have not undergone a lot of testing so far, expect bugs everywhere.
I've given a presentation about felica, libpasori, and this program. You can get the slides at the
TalkPage.
CategoryCode
CategoryRuby
There are no comments on this page. [Add comment]