/// <summary> /// Terminates a connection to the cash drawer. /// </summary> public void Close() { if (this.oposCashDrawer != null) { this.oposCashDrawer.ReleaseDevice(); this.oposCashDrawer.Close(); this.oposCashDrawer = null; } }
/// <summary> /// Establishes a connection to the specified cash drawer. /// </summary> /// <param name="peripheralName">Name of cash drawer device to open.</param> /// <param name="peripheralConfig">Configuration parameters of the peripheral.</param> public void Open(string peripheralName, PeripheralConfiguration peripheralConfig) { this.oposCashDrawer = new OPOSCashDrawer(); // Open this.oposCashDrawer.Open(peripheralName); OposHelper.CheckResultCode(this, this.oposCashDrawer.ResultCode); // Claim this.oposCashDrawer.ClaimDevice(OposHelper.ClaimTimeOut); OposHelper.CheckResultCode(this, this.oposCashDrawer.ResultCode); // Enable this.oposCashDrawer.DeviceEnabled = true; OposHelper.CheckResultCode(this, this.oposCashDrawer.ResultCode); }