using System.IO.SensorServices.Rfid.Client; using System.Text; namespace VendorExtensionApp { class VendorExtensionsClient { static void Main(string[] args) { //ToDo1: Create vendor-defined parameters. //ToDo2: Call the vendor-defined command. } } } This code lays out the general structure of the test application: a single namespace, one and the Main method. The only thing of note is the addition of the Rfid.Client namespace at the beginning, which enables you to make calls to the RFID service. 4. Build the input parameters for the call by replacing the ToDo1 line above with the following code: VendorSpecificInformation inputParameters = new VendorSpecificInformation(); inputParameters.Add("FictionalPort", "2"); inputParameters.Add("newValue", 1); inputParameters.Add("action", "TurnOnThing"); VendorDefinedParameters vendorParameters = new VendorDefinedParameters(); vendorParameters.InputParameters = inputParameters; This code creates a VendorSpecificInformation object that contains three parameters and their associated values. This object is stored inside a VendorDefinedParameter object, so that it can be passed to the provider through a call to a vendor-defined command. 5. Open a connection to the provider and call the vendor-defined command by replacing the ToDo2 line with the following code: using (DeviceConnection dc = new DeviceConnection("MyDevice"))
using System.IO.SensorServices.Rfid.Client; using System.Text; namespace VendorExtensionApp { class VendorExtensionsClient { static void Main(string[] args) { //ToDo1: Create vendor-defined parameters. //ToDo2: Call the vendor-defined command. } } } This code lays out the general structure of the test application: a single namespace, one and the Main method. The only thing of note is the addition of the Rfid.Client namespace at the beginning, which enables you to make calls to the RFID service. 4. Build the input parameters for the call by replacing the ToDo1 line above with the following code: VendorSpecificInformation inputParameters = new VendorSpecificInformation(); inputParameters.Add("FictionalPort", "2"); inputParameters.Add("newValue", 1); inputParameters.Add("action", "TurnOnThing"); VendorDefinedParameters vendorParameters = new VendorDefinedParameters(); vendorParameters.InputParameters = inputParameters; This code creates a VendorSpecificInformation object that contains three parameters and their associated values. This object is stored inside a VendorDefinedParameter object, so that it can be passed to the provider through a call to a vendor-defined command. 5. Open a connection to the provider and call the vendor-defined command by replacing the ToDo2 line with the following code: using (DeviceConnection dc = new DeviceConnection("MyDevice"))