コード例 #1
0
  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;
  }
コード例 #2
0
 public int getZoneStatus(IEndPointRequestContext context)
     throws ApplianceException, ServiceClusterException {
   if (context != null) {
     Integer objectResult = null;
     objectResult =
         ((Integer) getValidCachedAttributeObject(2, context.getMaxAgeForAttributeValues()));
     if (objectResult != null) {
       return objectResult.intValue();
     }
   }
   IZclFrame zclFrame = readAttribute(2, context);
   int v = ZclDataTypeBitmap16.zclParse(zclFrame);
   setCachedAttributeObject(2, new Integer(v));
   return v;
 }