// a scanner has connected to the host public void OnDeviceArrival(long result, ScanApiHelper.DeviceInfo newDevice) { if (SktScanErrors.SKTSUCCESS(result)) { UpdateStatusText("New Scanner: " + newDevice.Name); connectedDevice = newDevice; } else { string strMsg = String.Format("Unable to open scanner, error = %d.", result); MessageBox.Show(strMsg, "SingleEntry", MessageBoxButtons.OK, MessageBoxIcon.Asterisk,MessageBoxDefaultButton.Button1); } }
// a scanner has connected to the host public void OnDeviceArrival(long result, ScanApiHelper.DeviceInfo newDevice) { if (SktScanErrors.SKTSUCCESS(result)) { UpdateStatusText("New Scanner: " + newDevice.Name); _device = newDevice; _scanApiHelper.PostGetBtAddress(newDevice, OnGetBdAddress); } else { string strMsg = String.Format("Unable to open scanner, error = {0}.", result); MessageBox.Show(strMsg, StrOkBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
// a scanner has disconnected from the host public void OnDeviceRemoval(ScanApiHelper.DeviceInfo deviceRemoved) { connectedDevice = null; UpdateStatusText("Scanner Removed: " + deviceRemoved.Name); }