def __init__(self):
        resource.CoAPResource.__init__(self)
        self.addParam(resource.LinkParam('title', 'Temperature Resource'))

        # Additional metadata about a resource can be added using the addParam call.
        self.addParam(resource.LinkParam('units', 'degrees C'))

        # Allow discovery of this resource
        self.visible = True
Exemplo n.º 2
0
 def __init__(self):
     resource.CoAPResource.__init__(self)
     self.visible = True
     self.addParam(resource.LinkParam("title",
                                      "CoAP -> Xively gateway"))
     self.directory = {}
     self.eid = 0
Exemplo n.º 3
0
 def __init__(self):
     resource.CoAPResource.__init__(self)
     line = "Arch: armv6l"
     line += " CPUs: 1"
     line += " Speed: 700 MHz"
     self.mess = line
     self.visible = True
     self.addParam(resource.LinkParam("title", "CPU resource"))
Exemplo n.º 4
0
 def __init__(self, path):
     resource.CoAPResource.__init__(self)
     self.visible = True
     # dynamic URL part from --> coap://<host>:<port>/sensors/dht/<temperature/humidity>
     # passed by DynamicURLResource
     self.dynamicURL = path
     title = "DHT resource is responsible for adding new temperature/humidity data into the database"
     self.addParam(resource.LinkParam("title", title))
Exemplo n.º 5
0
    def __init__(self):
        """
		Initialize CoAP resource
		"""

        resource.CoAPResource.__init__(self)
        self.visible = True
        self.addParam(resource.LinkParam("title", "delta resource"))
        print("CoAP connected to localhost:5683\n")
Exemplo n.º 6
0
 def __init__(self):
     resource.CoAPResource.__init__(self)
     self.visible = True
     self.addParam(resource.LinkParam("title", "Large resource."))
Exemplo n.º 7
0
 def __init__(self, start=0):
     resource.CoAPResource.__init__(self)
     self.counter = start
     self.visible = True
     self.addParam(resource.LinkParam("title", "Counter resource"))
Exemplo n.º 8
0
 def __init__(self):
     resource.CoAPResource.__init__(self)
     line = "Linux raspbian 4.9.41+"
     self.mess = line
     self.visible = True
     self.addParam(resource.LinkParam("title", "OS resource"))
Exemplo n.º 9
0
 def __init__(self):
     resource.CoAPResource.__init__(self)
     line = "Mem: 434M Swap: 99M Dev: 7G"
     self.mess = line
     self.visible = True
     self.addParam(resource.LinkParam("title", "Disk resource"))
Exemplo n.º 10
0
 def __init__(self):
     resource.CoAPResource.__init__(self)
     self.temp = trigger.probe_temp()
     self.payl = str(self.temp) + "*C"
     self.visible = True
     self.addParam(resource.LinkParam("title", "Temp resource"))
Exemplo n.º 11
0
 def __init__(self, start=0):
     resource.CoAPResource.__init__(self)
     self.visible = True
     self.songName = name
     self.addParam(resource.LinkParam("title", "Song Resource"))
Exemplo n.º 12
0
 def __init__(self, ledCube):
     resource.CoAPResource.__init__(self)
     self.ledCube = ledCube
     self.visible = True
     self.addParam(resource.LinkParam("title", "LED Cube resource"))
Exemplo n.º 13
0
 def __init__(self, disc):
     resource.CoAPResource.__init__(self)
     self.visible = True
     self.addParam(resource.LinkParam("title", "Message resource"))
     self.disc = disc
Exemplo n.º 14
0
 def __init__(self):
     resource.CoAPResource.__init__(self)
     self.addParam(resource.LinkParam("title", "Temperature resource"))