示例#1
0
def main():
    # 初始化温度传感器
    init_temp_sensor()
    # 连接wifi
    connect_wifi()

    tziot.bind_pipe_net(IA, PWD, '0.0.0.0', 12025)
    tziot.register(RID_GET_TEMP, get_temp_service)
    tziot.run(app)
示例#2
0
文件: main.py 项目: jdhxyy/ntp-python
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)
示例#3
0
def case1():
    pipe = tziot.bind_pipe_net(0x2141000000000401, 'abc123', '192.168.1.119',
                               12025)
    while not tziot.is_conn():
        time.sleep(0.1)
    resp, err = tziot.call(pipe, 0x2141000000000004, 1, 1000, bytearray())
    print("err:", err, "time:", resp)
def main():
    global pipe

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

    pipe = tziot.bind_pipe_net(IA, PWD, '0.0.0.0', 12025)
    tziot.run(app)
示例#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)
示例#6
0
def case2():
    tziot.bind_pipe_net(0x2141000000000403, 'abc123', '192.168.1.119', 12025)
    while not tziot.is_conn():
        time.sleep(0.1)
    tziot.register(1, service1)