Giter Site home page Giter Site logo

rubygsm's Introduction

RubyGSM is a Ruby library which uses serialport to provide a nifty interface to send and receive SMS messages via a GSM modem.

This fork is useful if you want to send sms with Unicode Characters (UCS2)

However - it is not tested for receiving SMS in UCS2 mode. If you test it - please let me know… ;)

Sample Usage

#not tested yet in UCS2 mode
class ReverseApp
    def initialize(gsm)
        gsm.receive(method(:incoming))
        @gsm = gsm
    end

    def incoming(from, datetime, message)
        @gsm.send(from, message.reverse)
    end
end

gsm = Gsm::Modem.new("/dev/tty.usbserial")
ReverseApp.new(gsm)

If you just want to send sms

gsm = Gsm::Modem.new("/dev/tty.usbserial")
msg = Gsm::Outgoing.new(gsm, "+447777777777", "Oh hai")
msg.send!

If you want to send sms with (not more than 70) unicode chars

gsm = Gsm::Modem.new("/dev/tty.usbserial", ucs2: true)
gsm.send_sms(gsm, "+447777777777", "These are german umlauts: ÖÄÜ öäü!")

Installing

$ gem sources -a http://gems.github.com
$ sudo gem install serialport
$ sudo gem install mollat-rubygsm

Building gem

$ gem build rubygsm.gemspec

Known issues

There is a known issue when you try to send message to shortcode. Enble :debug to see problem.

Devices Tested

  • XS Stick W21

  • Multitech MTCBA

  • Wavecom M1306B

  • Huawei E1752

rubygsm's People

Contributors

adammck avatar borischernov avatar jakuboboza avatar mollat avatar wiiikiii avatar yamax2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.