From a4efc6297e72901b61b61ea410ec09b16df15d10 Mon Sep 17 00:00:00 2001 From: axi92 Date: Tue, 27 Aug 2024 11:32:56 +0200 Subject: [PATCH] docs: format readme and add shields.io (#41) Co-authored-by: mhochsto <116495532+mhochsto@users.noreply.github.com> --- README.md | 57 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 637e724..15c01de 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,19 @@

EVVA React-Native Module

+

+ + NPM Version + + NPM Downloads + GitHub package.json dynamic + NPM Unpacked Size (with version) + GitHub last commit + GitHub branch check runs + EVVA License + +

+ 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) @@ -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 ``` @@ -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 + ); } ``` @@ -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, ); ```