Click to Rate and Give Feedback

  Switch on low bandwidth view
How to Group Devices

You can add and manage more than one device in BizTalk RFID. Some devices are similar in nature and might require similar data processing. You can group such similar devices by creating a device group and adding similar devices to the device group. You can simplify the process of administering the devices by grouping similar devices to form a logical device group entity .You can add and delete device groups and move devices from one group to another.

Use the following methods to manage device groups in BizTalk RFID.

  • To create a device group, use the CreateDeviceGroup method that the DeviceManagerProxy class provides.

  • To delete a device group, use the DeleteDeviceGroup method. You can delete a device group only when the device group contains no devices, and if the device group is not bound to an RFID process.

  • To change the device association with its device group by moving a device from one device group to another, use the MoveEntityToDeviceGroup method.

The following sample code shows how to create a device group and add a device to the device group.

DeviceManagerProxy dmp = new DeviceManagerProxy("localhost");
//create a device group with name TestDeviceGroup
DeviceGroupDefinition dgd = new DeviceGroupDefinition("TestDeviceGroup", "This is a device group creating for testing device group related APIs");
dmp.CreateDeviceGroup(dgd, DeviceGroupDefinition.RootDeviceGroupName);

// add a device TestDevice, and add the device to the TestDeviceGroup in one call
TcpTransportSettings tts = new TcpTransportSettings("127.0.0.1", 7777);
ConnectionInformation ci = new ConnectionInformation("Contoso", tts);
UserDeviceInformation udi = new UserDeviceInformation(ci, null);
DeviceDefinition dd = new DeviceDefinition(udi, "TestDevice", null);
//add the device TestDevice with definition dd to the group named dbg.name, and keep it offline. 
dmp.AddDevice(dd, dgd.Name, true);

//add a device TestDevice2 to the RootDeviceGroup, and then move the device to the TestDeviceGroup
TcpTransportSettings tts2 = new TcpTransportSettings("127.0.0.1", 8888);
ConnectionInformation ci2 = new ConnectionInformation("Contoso", tts2);
UserDeviceInformation udi2 = new UserDeviceInformation(ci2, null);
DeviceDefinition dd2 = new DeviceDefinition(udi2, "TestDevice2", null);
//add the device TestDevice2 with definition dd to the root device group, and keep it offline. 
dmp.AddDevice(dd2, DeviceGroupDefinition.RootDeviceGroupName, true);
//move the device to the TestDeviceGroup 
dmp.MoveEntityToDeviceGroup(dd2.Name, dgd.Name);
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker