SCAM Perl Front End Documentation

Tim TimeWaster <tim@cuba.xs4all.nl>

GSM Library

This library contains some functions for GSM SIM cards.

Using the Library

use GSM;

Be sure that you first initialize the SCAM program with Scam::init before calling any of the functions in this library.

Variables

This library has no variables.

Functions

select_file fileid
selects a file. fileid is an integer representation of the two byte file ID. Will return the response to the SELECT_FILE command that is sent to the card.

get_response length
gets length bytes of the response data of the last command. Returns the response.

read_binary offset_high offset_low length
reads length bytes of the currently selected file starting at the byte pointed to by offset_high offset_low. Returns the response.

status length
returns length bytes of information on the SIM status, using the STATUS command.

Example

#!/usr/bin/perl

use GSM;

Scam::init();
Scam::reader("dumbmouse(wait_etu=100,conv=inverse,parity=odd)");

# Flush the serial port & the named pipe
Scam::send("dump");
Scam::recv();

Scam::reset();
($out, $err) = Scam::recv();
chomp $out; chomp $err;
print "ATR = $out\n";

# MORE TO COME

Bugs