Skip to content

Commit

Permalink
docs: format readme and add shields.io (#41)
Browse files Browse the repository at this point in the history
Co-authored-by: mhochsto <[email protected]>
  • Loading branch information
axi92 and mhochsto authored Aug 27, 2024
1 parent e72bde1 commit a4efc62
Showing 1 changed file with 36 additions and 21 deletions.
57 changes: 36 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
<h1 align="center">EVVA React-Native Module</h1>
</p>

<p align="center">
<a href="https://www.npmjs.com/package/@evva-sfw/abrevva-react-native">
<img alt="NPM Version" src="https://img.shields.io/npm/v/%40evva-sfw%2Fabrevva-react-native"></a>
<a href="https://www.npmjs.com/package/@evva-sfw/abrevva-react-native">
<img alt="NPM Downloads" src="https://img.shields.io/npm/dy/%40evva-sfw%2Fabrevva-react-native"></a>
<img alt="GitHub package.json dynamic" src="https://img.shields.io/github/package-json/packageManager/evva-sfw/abrevva-react-native">
<img alt="NPM Unpacked Size (with version)" src="https://img.shields.io/npm/unpacked-size/%40evva-sfw%2Fabrevva-react-native/latest">
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/evva-sfw/abrevva-react-native">
<a href="https://github.com/evva-sfw/abrevva-react-native/actions"><img alt="GitHub branch check runs" src="https://img.shields.io/github/check-runs/evva-sfw/abrevva-react-native/main"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/license-EVVA_License-yellow.svg?color=fce500&logo=data:image/svg+xml;base64,PCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjY0MCIgaGVpZ2h0PSIxMDI0IiB2aWV3Qm94PSIwIDAgNjQwIDEwMjQiPgo8ZyBpZD0iaWNvbW9vbi1pZ25vcmUiPgo8L2c+CjxwYXRoIGZpbGw9IiNmY2U1MDAiIGQ9Ik02MjIuNDIzIDUxMS40NDhsLTMzMS43NDYtNDY0LjU1MmgtMjg4LjE1N2wzMjkuODI1IDQ2NC41NTItMzI5LjgyNSA0NjYuNjY0aDI3NS42MTJ6Ij48L3BhdGg+Cjwvc3ZnPgo=" alt="EVVA License"></a>

</p>

The EVVA React-Native Module is a collection of tools to work with electronical EVVA access components. It allows for scanning and connecting via BLE.

- [Features](#features)
Expand All @@ -19,13 +32,14 @@ The EVVA React-Native Module is a collection of tools to work with electronical
## Requirements

- react-native < 0.74.3
- Java 17+ (Android)
- Java 17+ (Android)
- Android SDK (Android)
- Android 10+ (API level 29) (Android)
- Xcode 15.4 (iOS)
- iOS 15.0+ (iOS)

## Installation

```
yarn add @evva-sfw/abrevva-react-native
```
Expand All @@ -48,20 +62,20 @@ To start off first import `AbrevvaBle` from this module
import { AbrevvaBle } from '@evva-sfw/abrevva-react-native';

async function scanForBleDevices(androidNeverForLocation: Boolean = true, timeout: Number) {
await AbrevvaBle.initialize(androidNeverForLocation);

AbrevvaBle.requestLEScan(
10_000,
(data: ScanResult) => {
console.log(`Found device: ${data.name}`);
},
(address: string) => {
console.log(`Connected to device: ${address}`);
},
(address: string) => {
console.log(`Disconnected to device: ${address}`);
}
);
await AbrevvaBle.initialize(androidNeverForLocation);

AbrevvaBle.requestLEScan(
(data: ScanResult) => {
console.log(`Found device: ${data.name}`);
},
(address: string) => {
console.log(`Connected to device: ${address}`);
},
(address: string) => {
console.log(`Disconnected to device: ${address}`);
},
10_000
);
}
```

Expand All @@ -72,17 +86,18 @@ With the signalize method you can localize EVVA components. On a successful sign
```typescript
const success = await AbrevvaBle.signalize('deviceId');
```

### Perform disengage on EVVA components

For the component disengage you have to provide access credentials to the EVVA component. Those are generally acquired in the form of access media metadata from the Xesar software.

```typescript
const status = await AbrevvaBle.disengage(
'deviceId',
'mobileId',
'mobileDeviceKey',
'mobileGroupId',
'mobileAccessData',
false,
'deviceId',
'mobileId',
'mobileDeviceKey',
'mobileGroupId',
'mobileAccessData',
false,
);
```

0 comments on commit a4efc62

Please sign in to comment.