Example #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)
Example #2
0
def case4():
    # 日志模块载入.全局载入一次,参数是分割文件大小,默认是10M
    lagan.load()

    # 默认输出界别是info,本行不会打印
    lagan.debug("case4", "debug test print")

    lagan.info("case4", "info test print")
    lagan.warn("case4", "warn test print")
    lagan.error("case4", "error test print")
Example #3
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)
Example #4
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)
Example #5
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)
Example #6
0
def main():
    lagan.load()
    lagan.set_filter_level(lagan.LEVEL_DEBUG)
    lagan.enable_color(True)
    case1()
Example #7
0
def case3():
    lagan.load()
    lagan.debug('case3', 'print:%d,a=%d', 101, 102)
    lagan.warn('case3', 'print:%d,b=%d', 101, 102)
Example #8
0
def case2():
    lagan.load()
    s = bytearray()
    for i in range(100):
        s.append(i)
    lagan.print_hex('case2', lagan.LEVEL_ERROR, s)