public void PostSetSoundConfig(DeviceInfo device, Byte[] bArray, ICommandContextCallback callback) { ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID = ISktScanProperty.propId.kSktScanPropIdSoundConfigDevice; newScanObj.Property.Type = ISktScanProperty.types.kSktScanPropTypeArray; newScanObj.Property.Array.Value = bArray; CommandContext command = new CommandContext(false, newScanObj, device.SktScanDevice, null, callback); AddCommand(command); }
/** * PostSetLocalAcknowledgement * Set the scanner LocalAcknowledgement<p> * This is only required if the scanner Confirmation Mode is set to kSktScanDataConfirmationModeApp * or kSktScanDataConfirmationModeScanAPI */ public void PostSetLocalAcknowledgement(DeviceInfo deviceInfo, bool bLocalAcknowledgement, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID = ISktScanProperty.propId.kSktScanPropIdLocalAcknowledgmentDevice; newScanObj.Property.Type = ISktScanProperty.types.kSktScanPropTypeByte; newScanObj.Property.Byte = bLocalAcknowledgement ? ScanAPI.ISktScanProperty.values.deviceDataAcknowledgment.kSktScanDeviceDataAcknowledgmentOn : ScanAPI.ISktScanProperty.values.deviceDataAcknowledgment.kSktScanDeviceDataAcknowledgmentOff; CommandContext command = new CommandContext(false, newScanObj, device, deviceInfo, callback); AddCommand(command); }
/** * PostSetPostamble * * Configure the postamble of the device * @param device * @param suffix */ public void PostSetPostamble(DeviceInfo device, String suffix, ICommandContextCallback callback) { ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdPostambleDevice; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeString; newScanObj.Property.String.Value=suffix; CommandContext command = new CommandContext(false, newScanObj, device.SktScanDevice, null, callback); AddCommand(command); }
/** * PostSetDecodeAction * * Configure the local decode action of the device * * @param device * @param decodeVal */ public void PostSetDecodeAction(DeviceInfo device, int decodeVal, ICommandContextCallback callback) { ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdLocalDecodeActionDevice; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeByte; newScanObj.Property.Byte=(byte)(decodeVal & 0xffff); CommandContext command = new CommandContext(false, newScanObj, device.SktScanDevice, null, callback); AddCommand(command); }
/** * PostSetFriendlyName * Constructs a request object for setting the Friendly Name in the scanner * */ public void PostSetFriendlyName(DeviceInfo deviceInfo, String friendlyName, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdFriendlyNameDevice; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeString; newScanObj.Property.String.Value=friendlyName; CommandContext command = new CommandContext(false, newScanObj, device, null, callback); AddCommand(command); }
private void AddCommand(CommandContext newCommand) { lock(_commandContexts) { if(newCommand.ScanObject.Property.ID== ISktScanProperty.propId.kSktScanPropIdAbort){ Debug.MSG(Debug.kLevelTrace,"About to Add a ScanAPI Abort command so remove all previous commands"); _commandContexts.Clear(); } _commandContexts.Add(newCommand); Debug.MSG(Debug.kLevelTrace,"Add a new command to send"); } }
/** * PostSetDataConfirmation * acknowledge the decoded data<p> * This is only required if the scanner Confirmation Mode is set to kSktScanDataConfirmationModeApp */ public void PostSetDataConfirmation(DeviceInfo deviceInfo, bool bGoodScan, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdDataConfirmationDevice; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeUlong; newScanObj.Property.Ulong= bGoodScan ? SktScan.helper.SKTDATACONFIRMATION( 0, ISktScanProperty.values.dataConfirmation.kSktScanDataConfirmationRumbleNone, ISktScanProperty.values.dataConfirmation.kSktScanDataConfirmationBeepGood, ISktScanProperty.values.dataConfirmation.kSktScanDataConfirmationLedGreen) : SktScan.helper.SKTDATACONFIRMATION( 0, ISktScanProperty.values.dataConfirmation.kSktScanDataConfirmationRumbleNone, ISktScanProperty.values.dataConfirmation.kSktScanDataConfirmationBeepBad, ISktScanProperty.values.dataConfirmation.kSktScanDataConfirmationLedRed); CommandContext command = new CommandContext(false, newScanObj, device, null, callback); lock (_commandContexts) { if (_commandContexts.Count == 0) AddCommand(command); else { const int index = 0; CommandContext pendingCommand = _commandContexts.ElementAt(index); if (pendingCommand.Status == CommandContext.statusNotCompleted) _commandContexts.Insert(index + 1,command); } } // try to see if the confirmation can be sent right away SendNextCommand(); }
/** * PostGetSymbologyInfo * * Creates a TSktScanObject and initializes it to perform a request for the * Symbology Info in the scanner. * */ public void PostGetSymbologyInfo(DeviceInfo deviceInfo, int symbologyId, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; // create and initialize the property to send to the device ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdSymbologyDevice; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeSymbology; newScanObj.Property.Symbology.Flags=ISktScanSymbology.flags.kSktScanSymbologyFlagStatus; newScanObj.Property.Symbology.ID=symbologyId; // add the property and the device to the command context list // to send it as soon as it is possible CommandContext command = new CommandContext(true, newScanObj, device, deviceInfo, callback); AddCommand(command); }
/** * PostScanApiAbort * * Request ScanAPI to shutdown. If there is some devices connected * we will receive Remove event for each of them, and once all the * outstanding devices are closed, then ScanAPI will send a * Terminate event upon which we can close this application. * If the ScanAPI Abort command failed, then the callback will * close ScanAPI */ public void PostScanApiAbort(ICommandContextCallback callback) { // create and initialize the property to send to the device ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdAbort; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeNone; CommandContext command = new CommandContext(false, newScanObj, _scanApi, null, callback); AddCommand(command); }
/** * PostGetScanAPIVersion * retrieve the ScanAPI Version */ public void PostGetScanAPIVersion(ICommandContextCallback callback) { ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdVersion; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeNone; CommandContext command = new CommandContext(true, newScanObj, _scanApi, null, callback); AddCommand(command); }
/** * PostGetStandConfig * Creates a TSktScanObject and initializes it to perform a request for the * Stand configuration of the scanner. */ public void PostGetStandConfig(DeviceInfo deviceInfo, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; // create and initialize the property to send to the device ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID = ISktScanProperty.propId.kSktScanPropIdStandConfigDevice; newScanObj.Property.Type = ISktScanProperty.types.kSktScanPropTypeNone; // add the property and the device to the command context list // to send it as soon as it is possible CommandContext command = new CommandContext(true, newScanObj, device, deviceInfo, callback); AddCommand(command); }
/** * PostGetLocalAcknowledgement * Get the scanner LocalAcknowledgement<p> * This is only required if the scanner Confirmation Mode is set to kSktScanDataConfirmationModeApp * or kSktScanDataConfirmationModeScanAPI */ public void PostGetLocalAcknowledgement(DeviceInfo deviceInfo, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID = ISktScanProperty.propId.kSktScanPropIdLocalAcknowledgmentDevice; newScanObj.Property.Type = ISktScanProperty.types.kSktScanPropTypeNone; CommandContext command = new CommandContext(true, newScanObj, device, deviceInfo, callback); AddCommand(command); }
/** * PostGetDataStore * * Configure the timers of the device * @param device * @param suffix */ public void PostGetDataStore(DeviceInfo device, byte index, ICommandContextCallback callback) { byte[] bArray = {0, 0}; ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID = ISktScanProperty.propId.kSktScanPropIdDataStoreDevice; newScanObj.Property.Type = ISktScanProperty.types.kSktScanPropTypeArray; newScanObj.Property.Array.Value = bArray; newScanObj.Property.Array.Size = bArray.Length; CommandContext command = new CommandContext(true, newScanObj, device.SktScanDevice, device, callback); AddCommand(command); }
/** * DoGetCapabilitiesDevice * * Creates a TSktScanObject and initializes it to perform a request for the * Capabilities Device in the scanner. */ public void PostGetCapabilitiesDevice(DeviceInfo deviceInfo, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; // create and initialize the property to send to the device ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdCapabilitiesDevice; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeByte; newScanObj.Property.Byte=(byte)ISktScanProperty.values.capabilityGroup.kSktScanCapabilityLocalFunctions; // add the property and the device to the command context list // to send it as soon as it is possible CommandContext command = new CommandContext(true, newScanObj, device, deviceInfo, callback); AddCommand(command); }
/** * PostSetStandConfig * Constructs a request object for setting the Stand Config of the scanner * */ public void PostSetStandConfig(DeviceInfo deviceInfo, int standConfig, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID = ISktScanProperty.propId.kSktScanPropIdStandConfigDevice; newScanObj.Property.Type = ISktScanProperty.types.kSktScanPropTypeUlong; newScanObj.Property.Ulong = standConfig; CommandContext command = new CommandContext(false, newScanObj, device, null, callback); AddCommand(command); }
/** * PostSetConfirmationMode * Configures ScanAPI so that scanned data must be confirmed by this application before the * scanner can be triggered again. */ public void PostSetConfirmationMode(char mode, ICommandContextCallback callback) { ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdDataConfirmationMode; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeByte; newScanObj.Property.Byte=(byte)mode; CommandContext command = new CommandContext(false, newScanObj, _scanApi, null, callback); AddCommand(command); }
/** * PostSetSymbologyInfo * Constructs a request object for setting the Symbology Info in the scanner * */ public void PostSetSymbologyInfo(DeviceInfo deviceInfo, int Symbology, bool Status, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID=ISktScanProperty.propId.kSktScanPropIdSymbologyDevice; newScanObj.Property.Type=ISktScanProperty.types.kSktScanPropTypeSymbology; newScanObj.Property.Symbology.Flags=ISktScanSymbology.flags.kSktScanSymbologyFlagStatus; newScanObj.Property.Symbology.ID=Symbology; newScanObj.Property.Symbology.Status = Status ? ISktScanSymbology.status.kSktScanSymbologyStatusEnable : ISktScanSymbology.status.kSktScanSymbologyStatusDisable; CommandContext command = new CommandContext(false, newScanObj, device, null, callback) { SymbologyId = Symbology // keep the symbology ID because the Set Complete won't return it }; AddCommand(command); }
/** * DoStartDecode */ public void PostStartDecode(DeviceInfo deviceInfo, ICommandContextCallback callback) { ISktScanDevice device = deviceInfo.SktScanDevice; // create and initialize the property to send to the device ISktScanObject newScanObj = SktClassFactory.createScanObject(); newScanObj.Property.ID = ISktScanProperty.propId.kSktScanPropIdTriggerDevice; newScanObj.Property.Type = ISktScanProperty.types.kSktScanPropTypeByte; newScanObj.Property.Byte = (byte)ISktScanProperty.values.trigger.kSktScanTriggerStart; // add the property and the device to the command context list // to send it as soon as it is possible CommandContext command = new CommandContext(false, newScanObj, device, deviceInfo, callback); AddCommand(command); }