From c5750f264ab7821138ba31212c3b8b5a38005465 Mon Sep 17 00:00:00 2001 From: Rodrigo Pinto Date: Tue, 29 May 2012 16:15:12 -0300 Subject: [PATCH] Add method delete to Modem class --- lib/biju/modem.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/biju/modem.rb b/lib/biju/modem.rb index 763831a..03950fe 100644 --- a/lib/biju/modem.rb +++ b/lib/biju/modem.rb @@ -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)