Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: aymaster/aypy/devices/device_aver.py
- ===================================================================
- --- aymaster/aypy/devices/device_aver.py (revision 28871)
- +++ aymaster/aypy/devices/device_aver.py (working copy)
- @@ -199,7 +199,6 @@
- port = int(self.params["port"].value)
- user = str(self.params["user"].value)
- password = str(self.params["password"].value)
- -
- # r = protonemo((ip, int(port)), "CHECK_SERVER_VERSION")
- # r = protonemo((ip, int(port)), "GET_NCHANNEL")
- # r = protonemo((ip, int(port)), "GET_MAX_STREAM_NUM")
- @@ -212,8 +211,10 @@
- 'version': '',
- 'model': '',
- 'sn': sn})
- - r = protonemo((ip, int(port)), "GET_CONFIG")
- - if r:
- +
- + r = protonemo((ip, int(port)), "CONNECT %s %s" % (user, base64.b64encode(password)))
- + # OK -1 -1 -1 is returned if login is correct, OK 0 0 0 is the string if the login is not correct
- + if r.startswith('OK -1 -1 -1'):
- if self.__status != 'connected':
- self.__status = self.device_new_status(self.__objid, 'connected')
- else:
- @@ -222,6 +223,7 @@
- self._stop_proxy()
- self.handle_object_end()
- return
- + r = protonemo((ip, int(port)), "GET_CONFIG")
- # start proxy only if aver device is connected
- self._start_proxy()
- for i in range(0, 16):
- @@ -1062,34 +1064,15 @@
- k = AverDevicePlugin(info[0])
- #print k.check_slave("192.168.5.74", "8", "admin", "admin123")
- - #===========================================================================
- - # for (kk, v) in [("ip", "10.239.252.12"),
- - # ("port", 5550),
- - # ("user", "admin"),
- - # ("password", "4690"),
- - # ("db.id", "321"),
- - # ("speed", "low"),
- - # ("name", "avertest")]:
- - #===========================================================================
- - for (kk, v) in [("ip", "10.20.18.3"),
- - ("port", 5550),
- + for (kk, v) in [("ip", "192.168.5.79"),
- + ("port", 80),
- ("user", "admin"),
- - ("password", "9046"),
- + ("password", "admin123"),
- ("db.id", "33008"),
- ("speed", "low"),
- ("name", "avertest")]:
- - #===========================================================================
- - # for (kk, v) in [("ip", "192.168.5.79"),
- - # ("port", 5550),
- - # ("user", "admin"),
- - # ("password", "admin123"),
- - # ("db.id", "33008"),
- - # ("speed", "low"),
- - # ("name", "avertest")]:
- - #===========================================================================
- -
- k.params[kk] = PV(kk, v)
- k.start()
- @@ -1096,7 +1079,7 @@
- #inizio = "20170421085443110359"
- #fine = "20170421121843110359"
- #print k.search_status(1, inizio, fine, 3000, 0)
- - #k.poll()
- + k.poll()
- #time.sleep(100)
- # reactor.callLater(5, k.poll)
- # reactor.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement