# btPrinterDisconnect

## Description

Disconnects a bluetooth printer from the device.

## Input / Parameter

| Name    | Description                                                         | Input Type  | Default | Options | Required |
| ------- | ------------------------------------------------------------------- | ----------- | ------- | ------- | -------- |
| timeout | The duration the printer can be idle for before it is disconnected. | String/Text | -       | -       | Yes      |

## Output

N/A

## Callback

### callback

The function to be executed if the printer is disconnected successfully.

### errCallback

The function to be executed if the printer is not disconnected successfully.

## Video

Coming Soon.

## Example

The user wants to disconnect a printer from their device.

### Steps

1. Call the function `btPrinterDisconnect` in a button component.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-b7dc8914555bcba68b86383c205fd67a3ea8a1b0%2FbtPrinterDisconnect-step-1.png?alt=media)
2. Call the function `infoDialog` in the callbacks of the `btPrinterDisconnect` function.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-6e45c2c91d5010a1fc5352e182f9ac68ecd4b572%2FbtPrinterDisconnect-step-2.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-0a65d3dec5fecd0bc65830ad61ca7d438526582d%2FbtPrinterDisconnect-step-3.png?alt=media)

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-913544a3c39cda156f685ee6775cff302dbd90e6%2FbtPrinterDisconnect-step-4.png?alt=media)

### Result

If the printer is idle longer than the timeout duration passed, the printer will be disconnected and the success infoDialog will appear. If the printer is not disconnected successfully, the error infoDialog will appear.

1. Select the printer to disconnect from the combobox.

   ![](https://github.com/OrangeKloud/emobiq-documentation/blob/master/document/client/006-actions-and-visual-logic/action-reference/cordova/Printer/btPrinterDisconnect/btPrinterDisconnect-result-1.jpg)
2. Press the Disconnect button. If the printer is disconnected successfully, the success infoDialog will appear. If the printer is not disconnected successfully, the error dialog will appear.

## Links
