added send command
parent
c72bdaa942
commit
154646323b
|
@ -35,6 +35,17 @@ module Biju
|
||||||
cmd("AT+CMGD=#{id}")
|
cmd("AT+CMGD=#{id}")
|
||||||
end
|
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
|
private
|
||||||
def connection(options)
|
def connection(options)
|
||||||
port = options.delete(:port)
|
port = options.delete(:port)
|
||||||
|
|
Loading…
Reference in New Issue