summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0323/sensordata.py
blob: 1343069d226db3afa467f325eaa8751df66ca7ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""
    SleekXMPP: The Sleek XMPP Library
    Implementation of xeps for Internet of Things
    http://wiki.xmpp.org/web/Tech_pages/IoT_systems
    Copyright (C) 2013 Joachim Lindborg, Joachim.lindborg@lsys.se
    This file is part of SleekXMPP.

    See the file LICENSE for copying permission.
"""

import logging

from sleekxmpp.xmlstream import JID
from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.matcher import StanzaPath
from sleekxmpp.plugins.base import BasePlugin
from sleekxmpp.plugins.xep_0323 import stanza


log = logging.getLogger(__name__)


class XEP_0323(BasePlugin):

    """
    XEP-0323 IoT Sensor Data 
    """

    name = 'xep_0323'
    description = 'XEP-0323 Internet of Things - Sensor Data'
    dependencies = set(['xep_0030']) # set(['xep_0030', 'xep_0004', 'xep_0082', 'xep_0131'])
    stanza = stanza

    def plugin_init(self):
        pass
        # self.node_event_map = {}

        # self.xmpp.register_handler(
        #        Callback('Sensordata Event: Get',
        #            StanzaPath('message/sensordata_event/get'),
        #            self._handle_event_get))

    def plugin_end(self):
        # self.xmpp.remove_handler('Sensordata Event: Get')
        pass
    
    def get_value(self, jid, msg):
        """
        Recieving a stanza for erading values
        # verify provisioning

        # verify requested values and categories

        # Send accepted
        # Thread of the readout

        # send started

        # send data messages

        # send done  
        """        
        pass