main.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:iotdm-pyclient 作者: peterchauyw 项目源码 文件源码
def build(self):
        # Resource tree creation
        root = resource.CoAPResource()

        well_known = resource.CoAPResource()
        root.putChild('.well-known', well_known)
        core = CoreResource(root)
        well_known.putChild('core', core)

        counter = MOTDResource(self, 0)
        root.putChild('motd', counter)

        endpoint = resource.Endpoint(root)
        reactor.listenUDP(coap.COAP_PORT, coap.Coap(endpoint))

        # Kivy screen initialization
        self.label = Label(text="")
        self.display_counter(0)
        self.messagebox = TextInput(size_hint_y=.1, multiline=False)
        self.messagebox.text = "Message of the day"
        self.layout = BoxLayout(orientation='vertical', padding=10)
        self.layout.add_widget(self.label)
        self.layout.add_widget(self.messagebox)
        return self.layout
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号