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
评论列表
文章目录