Add method delete to Modem class

master
Rodrigo Pinto 2012-05-29 16:15:12 -03:00
parent 997b4993e5
commit c5750f264a
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,12 @@ module Biju
msgs.collect!{ |msg| Biju::Sms.new(:id => msg[0], :phone_number => msg[1], :datetime => msg[2], :message => msg[3].chomp) }
end
# Delete a sms message by id.
# @param [Fixnum] Id of sms message on modem.
def delete(id)
cmd("AT+CMGD=#{id}")
end
private
def connection(options)
port = options.delete(:port)