Previous Topic

Next Topic

Book Contents

Book Index

Customizing Device Properties

The ZigBee HDM adapter uses the ZigBee HomeDevice Customizer to change the values of device properties or add new ones.

The ZigBee HomeDevice Customizer

The customizer com.prosyst.mbs.services.zigbee.hdm.adapter.ZigBeeHomeDeviceCustomizer can be registered with matching filter specifying which ZigBee devices are subject of customization. If the service is registered without filter all ZigBee devices will pass through customizer. For security reasons ZigBee controllers are excluded by default.

The ZigBeeHomeDeviceCustomizer service defines the following matching criteria:

The ZigBeeHomeDeviceCustomizer has the following properties:

ZigBeeHomeDeviceCustomizer Methods

Examples

The following code snippet is an example registration of a customizer with a filter matching all devices with ZigBee profile ID: 0x1001. CUSTOMIZE_ALL_ENDPOINTS requires that all active endpoints of a device have ZigBee profile ID: 0x1001. In this case the customizer is applied to the root device and all endpoint devices (including their children). If some of the endpoints of a device do not have profile ID: 0x1001 the customizer is not applied to this device.

Properties matching = new Properties();
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_ENDPOINTS_POLICY, ZigBeeHomeDeviceCustomizer.CUSTOMIZE_ALL_ENDPOINTS);
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_ENDPOINTS_PROFILE_ID,  new Integer(0x1001));
customizerReg = context.registerService(ZigBeeHomeDeviceCustomizer.class.getName(), customizer, matching);

The following code snippet is an example registration of a customizer with a filter matching all endpoints with ZigBee profile ID: 0x1001 and device ID: 0x0001. The customizer is applied to all endpoint devices matching the above criteria, as well as to their root devices. If some of the endpoints do not have the specified profile ID or device ID the customizer is not applied to them.

Properties matching = new Properties();
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_ENDPOINTS_POLICY, ZigBeeHomeDeviceCustomizer.CUSTOMIZE_MATCHED_ENDPOINTS);
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_ENDPOINTS_PROFILE_ID,  new Integer(0x1001));
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_ENDPOINTS_DEVICE_ID,  new Integer(0x0001));
customizerReg = context.registerService(ZigBeeHomeDeviceCustomizer.class.getName(), customizer, matching);

The following code snippet is an example registration of a customizer with a filter matching all devices with manufacturer code: 0x1234. Note that the manufacturer code is obtained from the ZigBee node descriptor, which represents the whole ZigBee device structure, and there is no need to specify which endpoints have to be checked. The customizer is applied to the root device and its children and downwards through the whole device structure.

Properties matching = new Properties();
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_MANUFACTURER_CODE,  new Integer(0x1234));
customizerReg = context.registerService(ZigBeeHomeDeviceCustomizer.class.getName(), customizer, matching);

The following code snippet is an example registration of a customizer with a filter matching all devices with manufacturer code: 0x1234, profile ID: 0x1001 and device ID: 0x0001. If MATCH_ENDPOINTS_POLICY has the value CUSTOMIZE_ALL_ENDPOINTS the customizer will be applied to all devices with manufacturer code: 0x1234 whose endpoints all have profile ID: 0x1001 and device ID: 0x0001.

Properties matching = new Properties();
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_MANUFACTURER_CODE,  new Integer(0x1234));
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_ENDPOINTS_POLICY, ZigBeeHomeDeviceCustomizer.CUSTOMIZE_MATCHED_ENDPOINTS);
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_ENDPOINTS_PROFILE_ID,  new Integer(0x1001));
matching.put(ZigBeeHomeDeviceCustomizer.MATCH_ENDPOINTS_DEVICE_ID,  new Integer(0x0001));
customizerReg = context.registerService(ZigBeeHomeDeviceCustomizer.class.getName(), customizer, matching);