Beispiel #1
0
    def __init__(self,**kwargs):

        params  =  {
               'serviceID'     : 0x02,
               'userID'        : 0x00,
               'encodingType'  : 0x00,
               'length'        : 0x00,
               "userAccessLevel"  : 0x00,
               "userID"         : 0x00,
               "userNameLength" : 0x00,
               "userName"       : "",
               "systemStatus"        : 0x00,
               "systemStatusExtended": 0x00,
               "numberOfCounters"     :0x00,
               "counters"            : {}, # {'key' = counterID , counter'}
               "currentNetMaster"    : 0x00,
               'passcode'            : "000000",
            };

        for key in kwargs:
            if(key in params) != True:
                raise ValueError("@LogonContent : invalid parameter {0} ".format(key));
            else:
                params[key]  = kwargs[key];

        if(isinstance(params['passcode'], basestring)) != True:
           raise ValueError("@LogonContent: expecting passcode to be a string object.");
        Content.__init__(self,**params); 
    def __init__(self, **kwargs):

          attributes  =  {
               'panelNumber'           : 0x00, 
               'channel'               : ChannelType.MX_LOOP_TYPE,
               'loopNumber'            : 0xFF,  
               'pointCategory'         : PointCategoryType.padr_PCAT_REAL,
               'pointNumber'           : 0xFF, 
               'logicalPointNumber'    : 0xFD, 
               'logicalPointZone'      : 0xFE,
               'deviceCategory'        : DeviceCategoryType.ALL_DEVICE_TYPE,
               'group'                 : ByteCombinator().combineBytes(0x00, 0x01), #Two Bytes
               'outputPointStoreState' : 0x03,
               'reserved1'             : 0x00, 
               'reserved2'             : 0x00, 
               'multiAreaType'         : MultiAreaType.ALL,
               'areas'                 : Content.createSizeArray(29, 0xFF),
               'area'                  : 0xFF,
               'reserved'              : 0x01,
               'deviceType'            : devices.pdev_DEVICE_ID_ALL,
               'requestType'           : 0x01,
               'searchType'            : PointSearchType.ACTIVE_INPUTS
              };

          for key in kwargs:
              if ((key in attributes) != True):
                raise ValueError(key);
              attributes[key]=  kwargs[key];
          Content.__init__(self, **attributes);
    def __init__(self, **kwargs):

        attributes = {
            'clientID': 0x0000,  #Double bytes
        }

        for key in kwargs:
            if ((key in attributes) != True):
                raise ValueError(key)
            attributes[key] = kwargs[key]
        Content.__init__(self, **attributes)
Beispiel #4
0
    def __init__(self, **kwargs):
        params = {
            "resynchronisationData": 0x00,
            "avaliable": 0x00,
            "resynchronisationSent": 0x00
        }

        for key in kwargs:
            if key in params:
                params[key] = kwargs[key]

        Content.__init__(self, **params)
Beispiel #5
0
    def __init__(self, **kwargs):

        params = {
            "type": 0x00,
            "channel": 0x00,
            "channelAddress": 0x00,
            "pointCategory": 0x00,
            "pointNumber": 0x00,
            "logicalPointAddress": 0x00,
            "logicalPointZone": 0x00,
            "zoneNumber": 0x00,
            "panelNumber": 0x00,  # 0 - 99
            "informationTextID": 0x00  # 1 -100
        }

        for key in kwargs:
            if (key in params) != True:
                raise ValueError("".format(
                    "@TestStringContent: invalid parameter given {0}", key))
            params[key] = kwargs[key]
        Content.__init__(self, **params)

        def getByteArray(self):
            requestType = self.toBitArray(self.getParameter("type"), True)
            #Bit0=Point Text Requested
            #Bit1=Zone Text Requested
            #Bit3=Reserved for future use
            #Bit4=Info Text Requested
            #Bit7=Strings are requested in Secondary Language

            if (requestType[0] == True):
                #create the packet bytes needed.
                pass

            if (requestType[1] == True):
                #create the packet bytes needed.
                pass

            if (requestType[2] == True):
                #create the packet bytes needed.
                pass

            if (requestType[4] == True):
                #create the packet bytes needed.
                pass

            if (requestType[4] == True):
                #create the packet bytes needed.
                pass

            return data
Beispiel #6
0
    def __init__(self, **kwargs):
        if (len(kwargs) > PACKET_LEN):
            raise TypeError("@Packet parameter content was exceeded.")
        params = {
            "controlID": 0x00,  #0-2
            "loopID": 0x01,  #1-32
        }

        for key in kwargs:
            if key in params:
                params[key] = kwargs[key]
            else:
                raise ValueError(
                    "@LoopContentRequest: Invalid parameter {0}  found".format(
                        key))

        Content.__init__(self, **params)

        def getByteArray(self):
            data = self.createSizeArray(PACKET_LEN, 0x00)
            data[0] = self.getParameter("controlID")
            data[1] = self.getParameter("loopID")
            return data
Beispiel #7
0
 def __init__(self, **kwargs):
     Content.__init__(self, **kwargs)
Beispiel #8
0
 def __init__(self, **kwargs):
     if(len(kwargs) > 1):
         raise TypeError("@Restart Content require only 1 parameter");
     if("restartOption" in kwargs) != True:
         kwargs['restartOption'] = 0;
     Content.__init__(self,  **kwargs);
 def __init__(self, **kwargs):
     if(len(kwargs) != EXPECTED_CONTENT_SIZE):
         raise TypeError("@PointInfoReplyContent: Insufficient number of paramaters provided");
     else:
         Content.__init__(self, **kwargs);
Beispiel #10
0
 def __init__(self):
     Content.__init__(self)
Beispiel #11
0
 def __init__(self, request, **kwargs):
     Content.__init__(self, request, **kwargs)
     self._collection_name = "content"