Version 9 of gsm

Updated 2006-07-31 23:19:10

Anton Kovalenko: GSM library for tcl


A library [L1 ] to communicate with GSM mobile phone and to send/receive SMS.

Usage samples:

    set phone [open COM1 r+]
    foreach {manuf model revision} [gsm::phone::acquire $phone] {break}
    puts "Phone model: $manuf $model ($revision)"
    gsm::io::atcmd $phone Z
    # set default timeout
    gsm::io::timeout $phone 4000
    set gdconts [gsm::io::atcmd $phone +CGDCONT]
    ...
    gsm::phone::sendsms $phone +79163453402 \
                 "Hello Anton, I'm testing your library"
    gsm::phone::sendsms $phone +79163453402 "Unicode test: \u0412 "

    foreach sm [gsm::pdu::assemble [gsm::phone::readsms $tty ME 4]] {
      array set sm1 $sm
      puts "Storage id $sm1(id), assembled from $sm1(parts)"
      puts "From/to $sm1(peer): $sm1(text)"
    }

It is possible to use it with my infrared mini-extension. Just pass to gsm::phone::acquire a socket connected to IrDA:IrCOMM service.


This library is used in SMS Reception Center [L2 ]


As an alternative to the character conversion implemented in the gsm library, the encoding command can be extended with a gsm0338 encoding: GSM 03.38 encoding


dzach 2006-8-1: I was trying the library, and sent a message in greek, even in lowcase! That's very nice! Is there any way to receive a message or a RING as it comes in like with the +CNMI=1,2,0,0,0 command? When I enter +CNMI=1,2,0,0,0 the library pops an error and stops responding to commands:

 invalid command name "RING"
    while executing 
 "RING"
    (in namespace eval "::" script line 1)
    invoked from within
 "namespace eval :: $state(handler,$fd) [list $str]"
    (procedure "_unsolicited" line 3)
    invoked from within
 "_unsolicited $fd $str"
    (procedure "::gsm::io::_reader" line 52)
    invoked from within
 "::gsm::io::_reader file4"

What could be the cause of this?


Category Package Category Internet