Beispiel #1
0
  public static void zclSerialize(IZclFrame zclFrame, DBFTR r) throws ZclValidationException {

    ZclDataTypeUI8.zclSerialize(zclFrame, r.Acknowledge);
    if (r.Acknowledge == 0x5a) {
      ZclDataTypeUI8.zclSerialize(zclFrame, r.FrameHeader);
      ZclDataTypeUI8.zclSerialize(zclFrame, r.FrameType);
      ZclDataTypeOctets.zclSerialize(zclFrame, r.FramePayload);
    }
  }
Beispiel #2
0
 public static int zclSize(DBFTR r) throws ZclValidationException {
   int size = 0;
   size += ZclDataTypeUI8.zclSize(r.Acknowledge);
   if (r.Acknowledge == 0x5a) {
     size += ZclDataTypeUI8.zclSize(r.FrameHeader);
     size += ZclDataTypeUI8.zclSize(r.FrameType);
     size += ZclDataTypeOctets.zclSize(r.FramePayload);
   }
   return size;
 }
Beispiel #3
0
 public static DBFTR zclParse(IZclFrame zclFrame) throws ZclValidationException {
   DBFTR r = new DBFTR();
   r.Acknowledge = ZclDataTypeUI8.zclParse(zclFrame);
   if (r.Acknowledge == 0x5a) {
     r.FrameHeader = ZclDataTypeUI8.zclParse(zclFrame);
     r.FrameType = ZclDataTypeUI8.zclParse(zclFrame);
     r.FramePayload = ZclDataTypeOctets.zclParse(zclFrame);
   }
   return r;
 }
  protected IZclFrame parseZoneStatusChangeNotification(IASZoneClient o, IZclFrame zclFrame)
      throws ApplianceException, ServiceClusterException {
    int ZoneStatus = ZclDataTypeBitmap16.zclParse(zclFrame);
    short ExtendedStatus = ZclDataTypeBitmap8.zclParse(zclFrame);
    short ZoneID = 0xff;
    int Delay = 0;
    boolean gotZoneId = false;

    // Added the following code to mantain the compatibility with HA 1.1
    // devices
    try {
      ZoneID = ZclDataTypeUI8.zclParse(zclFrame);
      gotZoneId = true;
      Delay = ZclDataTypeUI16.zclParse(zclFrame);
    } catch (Exception e) {
      if (gotZoneId)
        throw new ZclValidationException("missing Delay in ZoneStatusChangeNotification");
    }

    if (o == null) {
      return null;
    }
    o.execZoneStatusChangeNotification(
        ZoneStatus, ExtendedStatus, ZoneID, Delay, endPoint.getDefaultRequestContext());
    return null;
  }
 public short getZoneID(IEndPointRequestContext context)
     throws ApplianceException, ServiceClusterException {
   if (context != null) {
     Short objectResult = null;
     objectResult =
         ((Short) getValidCachedAttributeObject(17, context.getMaxAgeForAttributeValues()));
     if (objectResult != null) {
       return objectResult.shortValue();
     }
   }
   IZclFrame zclFrame = readAttribute(17, context);
   short v = ZclDataTypeUI8.zclParse(zclFrame);
   setCachedAttributeObject(17, new Short(v));
   return v;
 }