Skip to content

Commit

Permalink
add pressTrigger and releaseTrigger documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cody Brookshear committed Aug 12, 2019
1 parent b153f30 commit f6db76f
Showing 1 changed file with 48 additions and 5 deletions.
53 changes: 48 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@ cordova plugin add @datalogic/cordova-plugin-datalogic
ionic cordova plugin add @datalogic/cordova-plugin-datalogic
```

## Publish new version

Install and use the [np tool](https://github.com/sindresorhus/np):

``` bash
npm install --global np
np
```

## Sample apps

Several Ionic sample applications are provided to demonstrate using the plugin. You can find them here: https://github.com/datalogic/ionic-samples
Several Ionic sample applications are provided to demonstrate using the plugin. You can [find them here](https://github.com/datalogic/ionic-samples).

## API Reference

Expand All @@ -51,6 +60,8 @@ All functions are asynchronous. All functions will, at a minimum, include `succe
| Function | Description
|----------|------------
| [addReadListener](#addreadlistenersuccesscallback-errorcallback-object) | Register to recieve barcode data on each scan.
| [pressTrigger](#presstriggersuccesscallback-errorcallback-object) | Simulate a trigger button press.
| [releaseTrigger](#releasetriggersuccesscallback-errorcallback-object) | Simulate a trigger button release.

#### .addReadListener(`successCallback`, `errorCallback`): Object

Expand Down Expand Up @@ -82,6 +93,40 @@ barcodeManager.addReadListner(
);
```

#### .pressTrigger(`successCallback`, `errorCallback`): Object

Call this method to simulate a trigger button press. The method does not always immediately start a capture; instead it behaves like pressing a physical scan button.

##### Response

`string` with success message

##### Example

```js
barcodeManager.pressTrigger(
(data) => { alert(data); },
(err) => { alert(err);}
);
```

#### .releaseTrigger(`successCallback`, `errorCallback`): Object

Call this method to simulate a release of a trigger button. The method does not always immediately stop a capture; instead it behaves like releasing a physical scan button.

##### Response

`string` with success message

##### Example

```js
barcodeManager.releaseTrigger(
(data) => { alert(data); },
(err) => { alert(err);}
);
```

### autoScanTrigger

---
Expand All @@ -93,7 +138,6 @@ barcodeManager.addReadListner(
| [getCurrentRange](#getcurrentrangesuccesscallback-errorcallback-object) | Get the current range of the autoscan feature.
| [setCurrentRange](#setcurrentrangeid-successcallback-errorcallback-object) | Set the current range of the autoscan feature.


#### .isAvailable(`successCallback`, `errorCallback`): Object

Determine if the auto scan feature is available on this device.
Expand Down Expand Up @@ -328,7 +372,7 @@ Set one or more triggers on or off. You will likely call `getAllAvailableTrigger

```js
//an array os supported triggers
triggers:{id: number, name: string, enabled: boolean}[] = [];
triggers:{id: number, name: string, enabled: boolean}[] = [];
...
keyboardManager.getAllAvailableTriggers(
(data) => {
Expand Down Expand Up @@ -361,7 +405,6 @@ Set the various device LEDs. A list of enum values for LEDs can be found [here](

`string` with success message


##### Example

```js
Expand Down Expand Up @@ -462,4 +505,4 @@ Disable keyboard wedge feature

```js
scannerProperties.store({"keyboardWedge":{"enable":false}}, null, null);
```
```

0 comments on commit f6db76f

Please sign in to comment.