-- README-PCSC                                     --
-- Notes, bugs and a todo list for the pcsc driver --

* Features *

This driver supports SIM and USIM cards inserted in smart card readers
compatible with libpcsclite.

By default this driver is compiled in libgnokii if libpcsclite is
installed and pcsc include files are found. You can avoid this by passing
--enable-libpcsclite=no to autogen.sh or to configure.

You can download pcsc-lite from http://pcsclite.alioth.debian.org/ and
a driver suitable to you reader could be available from
http://www.musclecard.com/

A typical gnokiirc configuration to use this driver is:
  port = 0
  model = pcsc
  connection = pcsc
If you have more than one reader, you might find it useful to specify
the name of you reader in the port parameter (look at the debug output
from pcscd or gnokii if you don't know the exact string to use).

Implemented commands for gnokii are:
--identify
--getphonebook
--getfile
This means that writing to the phonebook is not supported and reading
or writing short messages isn't supported either.

The --getphonebook command can read from SM, EN, FD, ON, SD, BD and LD.
Use memory SD to read Service Dialing Numbers and BD to read Barred
Dialing Numbers.
Note that:
- some SIM cards only have numbers in SM, so reading from the
  other memories will fail
- some phones do not write to the LD memory

The --getfile command can read the MF, a DF or an EF, if the SIM allows it.
A path name must start with 'B:' and the slash '/' or the backslash '\\'
can be used as separators (in some shells the backslash must be doubled).
All names are 4 digits hex numbers (case insensitive).
Interesting files are the phonebook in raw format:
  gnokii --getfile b:/7f10/6f3a
and the SMSs in raw format:
  gnokii --getfile b:/7f10/6f3c
Do not try random numbers, read the GSM standard instead.


* Bugs *

- GN_OP_GetMemoryStatus returns total space instead of used space.

- Memory EN isn't actually supported.

- The --identify command returns the following fixed information:
IMEI         : Unknown
Manufacturer : Unknown
Model        : SIM/USIM
Product name : pcsc
Revision     : Unknown


* Troubleshooting *

1) check that the pcsc-lite package is properly installed and configured
Run pcscd in debug mode:
 pcscd -f -d
And see what it prints when you insert the card in the reader.

2) check that libgnokii is compiled with libpcsclite support

2a) if you are compiling libgnokiii from source, you need the binary for
libpcsclite and its include files; if the ./configure script can find
them its output will look like this:
[..]
checking for libpcsclite >= 1.4.2... yes
checking LIBPCSCLITE_CFLAGS... -pthread -I/usr/include/PCSC
checking LIBPCSCLITE_LIBS... -lpcsclite
checking if libpcsclite includes are installed... yes
[..]

2b) if you are using a precompiled libgnokii binary check that it is
linked with libpcsclite, eg.:
$ ldd /usr/lib/libgnokii.so | grep libpcsclite
        libpcsclite.so.1 => /usr/lib/libpcsclite.so.1 (0xb7ee6000)


* ToDo *

In random order:
- Handle SMS
- Give more information to the --identify command
- Handle PIN
- Implement --getnetworkstatus
- Support writing

