Class: Sms::Method::GSM
- Inherits:
-
Object
- Object
- Sms::Method::GSM
- Defined in:
- lib/sms/method/gsm.rb
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options = {}) ⇒ GSM
constructor
A new instance of GSM.
Constructor Details
#initialize(options = {}) ⇒ GSM
Returns a new instance of GSM.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sms/method/gsm.rb', line 8 def initialize( = {}) raise ArgumentError.new('No :smsc was provided') unless [:smsc] @port = SerialPort.new([:port] || 3, [:baud] || 38400, [:bits] || 8, [:stop] || 1, SerialPort::NONE) @debug = [:debug] cmd("AT") # Set to text mode cmd("AT+CMGF=1") # Set SMSC number cmd(%Q{AT+CSCA="#{[:smsc]}"}) end |
Instance Method Details
#close ⇒ Object
19 20 21 |
# File 'lib/sms/method/gsm.rb', line 19 def close @port.close end |