Class: Utel::Device
- Inherits:
-
Object
- Object
- Utel::Device
- Defined in:
- lib/utel/device.rb
Instance Method Summary collapse
Instance Method Details
#pin(code = PIN_CODE) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/utel/device.rb', line 5 def pin(code=PIN_CODE) File.open(Utel::DEVICE, 'w+') do |f| f.write "AT+CPIN=\"code\"\r\n" while (s = f.gets) do break if s.slice(0,2) == "OK" end end end |
#send_at ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/utel/device.rb', line 14 def send_at File.open(Utel::DEVICE, 'w+') do |f| f.write("AT\r\n") while (s = f.gets) do break if s.slice(0,2) == "OK" end end end |