公司单个绑定

作者在 2016-06-08 14:21:57 发布以下内容
#-*- coding:utf-8 -*-
'''
Created on 2016-6-8

@author: Administrator
'''
import sys, unittest, xmlrpclib, time, socket, select, multiprocessing , random,os
import database, esl_init
from main import create_task_data
from SimpleXMLRPCServer import SimpleXMLRPCServer
from SimpleXMLRPCServer import SimpleXMLRPCRequestHandler
# from PublicFuntion import PublicFuntion
# s = PublicFuntion.ReadXml()

esl = esl_init.ESL()

server = xmlrpclib.ServerProxy('http://127.0.0.1:9000')
db = database.DB()

def CleanUpLog():
    with open("./log.txt","w") as f:
        pass
     
        
def bind():
    ret, val = server.send_cmd("ESL_ADD",[{"eslid":"5C-84-32-99","nw1":"5E-03-03-66","nw2":"52-56-78-53","nw3":"80", "nw4":"DOT20", "op1":"30", "op2":"50", "op3":"HS_EL_5104", "op4":"normal_296128290-black-white-red","op5":"{'max_package': 900, 'resolution_y': 128, 'resolution_x': 296, 'resolution_direction': 0, 'color': '290-black-white-red', 'flash_size': 64, 'version': 1, 'screen_type': 'HS_EL_5104'}","op6":"{'color': 'red', 'resolution_y': 128, 'resolution_x': 296}","op7":"0","op8":"12","op9":"0"}])
    ret, val = server.send_cmd("AP_ADD", [{"apid":"165","apip":"192.168.2.165"}])
    ret, val = server.send_cmd("SALES_QUERY_ACK", [{"salesno":"100199", "Price":"7.38", "bak":"00"}])
    ret, val = server.send_cmd("BIND", [{"eslid":"5C-84-32-99", "salesno":"100199", "apid":"165"}]) 
    CleanUpLog()
 
# def unbind():
#     ret, val = server.send_cmd("UNBIND", [{"eslid":"5C-84-32-99"}])
#     ret, val = server.send_cmd("ESL_DEL", [{"eslid":"5C-84-32-99"}])
#     ret, val = server.send_cmd("SALES_DEL", [{"salesno":"100199"}])
#     ret, val = server.send_cmd("AP_DEL", [{"apid":"165"}])


bind()
公司 | 阅读 12952 次
文章评论,共0条
游客请输入验证码
浏览2354409次