> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/printer/btprinterconnect.md).

# btPrinterConnect

## Description

Connects a bluetooth printer to the device.

## Input / Parameter

| Name      | Description                                     | Input Type  | Default | Options | Required |
| --------- | ----------------------------------------------- | ----------- | ------- | ------- | -------- |
| printerID | The id of the printer to connent.               | String/Text | -       | -       | Yes      |
| extra     | Extra parameters stored and passed to callback. | Any         | -       | -       | No       |

## Output

N/A

## Callback

### callback

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

### errCallback

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

## Video

Coming Soon.

## Example

The user wants to connect a printer to their device.

### Steps

1. Drag a combobox and button component to a page in the mobile designer. Call the function `btPrinterConnect` in the button component.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-b8e94f9d09138b55b1314a0c33724c3bcc84cc6a%2FbtPrinterConnect-step-1.png?alt=media)
2. Call the function `componentValue` in the `printerId` parameter of the `btPrinterConnect` function. Select the combobox component in the `component` parameter of the `componentValue` function to view the printers connected.

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

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

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

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

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

### Result

1. Select the printer to connect to from the combobox.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-1e76374054278d516128e7d4ec6f1cf9fb6bf092%2FbtPrinterConnect-result-1.jpg?alt=media)
2. Press the Connect button. If the printer is connected to the device successfully, the success infoDialog will appear. If the printer is not connected successfully, the error dialog will appear.

   ![](https://399701567-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwmJ1RKjM2uNFaL6fO3Xu%2Fuploads%2Fgit-blob-61b8095a2f4aa1e1840cda15686bf1db212576e7%2FbtPrinterConnect-result-2.jpg?alt=media)

## Links
