# 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.

   ![](/files/pt9QWDpcKwhceof3oUG3)
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.

   ![](/files/73tDFYWikPILS0r55tEs)

   ![](/files/Z0PZpAW4ieCpECKXo7W0)
3. Call the function `infoDialog` in the callbacks of the `btPrinterConnect` function.

   ![](/files/LtgfabTHlBewpQkHrhDD)

   ![](/files/3a8Se9MYYoSJ8lvF7mR7)

   ![](/files/5ePLVnvKMv16HquULs9k)

### Result

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

   ![](/files/KRcdBkzNq2gqzxGO2hfx)
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.

   ![](/files/NQhm5iGihJLfVsMl0Ljw)

## Links


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/printer/btprinterconnect.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
