Beispiel #1
0
def case1():
    lagan.load(0)
    lagan.set_filter_level(lagan.LEVEL_DEBUG)
    dcompy.set_filter_level(lagan.LEVEL_DEBUG)

    load()
    req, error = dcompy.call(0, 0, 0x1234, 1, 10000, bytearray([1, 2, 3]))
    print('0x%x' % error)
    print_hex(req)
Beispiel #2
0
def case6():
    lagan.load(0)
    lagan.set_filter_level(lagan.LEVEL_DEBUG)
    dcompy.set_filter_level(lagan.LEVEL_DEBUG)

    load()
    arr = bytearray()
    for i in range(501):
        arr.append(i & 0xff)
    req, error = dcompy.call(1, 0, 0x1234, 1, 3000, arr)
    print('error:0x%x' % error)
    print_hex(req)
Beispiel #3
0
def main():
    config.init()

    lagan.load(0)
    lagan.set_filter_level(lagan.LEVEL_INFO)
    lagan.enable_color(True)
    dcom.set_filter_level(lagan.LEVEL_WARN)

    tziot.bind_pipe_net(config.LOCAL_IA, config.local_pwd, config.LOCAL_IP,
                        config.LOCAL_PORT)
    tziot.register(RID_GET_TIME1, ntp_service1)
    tziot.register(RID_GET_TIME2, ntp_service2)
Beispiel #4
0
def case1():
    lagan.load()
    lagan.set_filter_level(lagan.LEVEL_DEBUG)
    lagan.enable_color(False)
    lagan.println('case1', lagan.LEVEL_OFF, 'TestPrintOut1:%d', 100)
    lagan.println('case1', lagan.LEVEL_DEBUG, 'TestPrintOut1:%d', 100)
    lagan.println('case1', lagan.LEVEL_INFO, 'TestPrintOut1:%d', 100)
    lagan.println('case1', lagan.LEVEL_WARN, 'TestPrintOut1:%d', 100)
    lagan.println('case1', lagan.LEVEL_ERROR, 'TestPrintOut1:%d', 100)

    s = bytearray()
    for i in range(100):
        s.append(i)
    lagan.print_hex('case1', lagan.LEVEL_INFO, s)
Beispiel #5
0
def main():
    global pipe

    lagan.set_filter_level(lagan.LEVEL_OFF)
    dcompy.set_filter_level(lagan.LEVEL_OFF)

    # 初始化设备
    init_device()
    # 初始化OLED屏
    init_oled()
    # 连接wifi
    connect_wifi()

    pipe = tziot.bind_pipe_net(IA, PWD, '0.0.0.0', 12025)
    # 注册按键服务
    tziot.register(RID_KEY, service_key)
    tziot.run(app)
Beispiel #6
0
def main():
    lagan.load()
    lagan.set_filter_level(lagan.LEVEL_DEBUG)
    lagan.enable_color(True)
    case1()