Class: Sim800c::Commands::ListMessages

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/sim800c/commands/list_messages.rb

Instance Method Summary collapse

Methods included from Helpers

#at_cmd, #parse_cmgl_response, #read_response, #return_or_raise_error!

Constructor Details

#initialize(serial) ⇒ ListMessages

Returns a new instance of ListMessages.



8
9
10
# File 'lib/sim800c/commands/list_messages.rb', line 8

def initialize(serial)
  @serial = serial
end

Instance Method Details

#allObject



12
13
14
# File 'lib/sim800c/commands/list_messages.rb', line 12

def all
  perform_message_query('AT+CMGL="ALL"')
end

#readObject



20
21
22
# File 'lib/sim800c/commands/list_messages.rb', line 20

def read
  perform_message_query('AT+CMGL="REC READ"')
end

#sentObject



28
29
30
# File 'lib/sim800c/commands/list_messages.rb', line 28

def sent
  perform_message_query('AT+CMGL="STO SENT"')
end

#unreadObject



16
17
18
# File 'lib/sim800c/commands/list_messages.rb', line 16

def unread
  perform_message_query('AT+CMGL="REC UNREAD"')
end

#unsentObject



24
25
26
# File 'lib/sim800c/commands/list_messages.rb', line 24

def unsent
  perform_message_query('AT+CMGL="STO UNSENT"')
end