Class: Utel::Operator

Inherits:
Object
  • Object
show all
Defined in:
lib/utel/operator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.nameObject



3
4
5
# File 'lib/utel/operator.rb', line 3

def self.name
  new.name
end

Instance Method Details

#nameObject



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/utel/operator.rb', line 7

def name
  File.open(Utel::DEVICE, "w+") do |f|
    f.write "AT+COPS?\r\n"
    out = ''
    while (s = f.gets) do
      if s.slice(0, 5) == "+COPS"
        out << s.strip.slice(12..-4)
        break
      end
    end
    out
  end
end