Guest User

Untitled

a guest
Sep 12th, 2020
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.47 KB | None | 0 0
  1. Dim:
  2. def config_write(lines):
  3.  
  4.     SER.send ('\r\nPress number to edit item or press esc to stop edit:')
  5.  
  6.     a = SER.receive(10)
  7.     while (a!=chr(0x1b)):
  8.         a = SER.receive(10)
  9.        
  10.         if (a==chr(48)):
  11.             SER.send ('\r\nEnter new APN:')
  12.             lines_num=0
  13.             config_write_lines(lines,lines_num)
  14.  
  15.  
  16.         if (a==chr(49)):
  17.             SER.send ('\r\nEnter new CAID_1:')
  18.             lines_num=1
  19.             config_write_lines(lines,lines_num)
  20.  
  21.  
  22.         if (a==chr(50)):
  23.             SER.send ('\r\nEnter new CAID_2:')
  24.             lines_num=2
  25.             config_write_lines(lines,lines_num)
  26.  
  27.  
  28.         if (a==chr(51)):
  29.             SER.send ('\r\nEnter new CAID_3:')
  30.             lines_num=3
  31.             config_write_lines(lines,lines_num)
  32.  
  33.  
  34.         if (a==chr(52)):
  35.             SER.send ('\r\nEnter new IP:')
  36.             lines_num=4
  37.             config_write_lines(lines,lines_num)
  38.  
  39.  
  40.         if (a==chr(53)):
  41.             SER.send ('\r\nEnter new PORT:')
  42.             lines_num=5
  43.             config_write_lines(lines,lines_num)
  44.            
  45.  
  46.         if (a==chr(54)):
  47.             SER.send ('\r\nEnter new LOGIN:')
  48.             lines_num=6
  49.             config_write_lines(lines,lines_num)
  50.  
  51.  
  52.  
  53.         if (a==chr(55)):
  54.             SER.send ('\r\nEnter new PASSWORD:')
  55.             lines_num=7
  56.             config_write_lines(lines,lines_num)
  57.  
  58.            
  59.  
  60.     SER.send ('\r\n\r\n')
  61.     SER.send ('BYE!\r\n')
  62.  
  63.     return ()
Advertisement
Add Comment
Please, Sign In to add comment