added send command

master
Tomtom 2012-06-20 23:08:43 +02:00
parent c72bdaa942
commit 154646323b
1 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,17 @@ module Biju
cmd("AT+CMGD=#{id}")
end
def send(sms, options = {})
# initiate the sms, and wait for either
# the text prompt or an error message
cmd("AT+CMGS=\"#{sms.phone_number}\"")
# send the sms, and wait until
# it is accepted or rejected
cmd("#{sms.message}#{26.chr}")
# ... check reception
end
private
def connection(options)
port = options.delete(:port)