Biometric

Biometric

Interact with the Biometric fingerprint reader

Methods

(async) deleteAll() → {Promise}

Example
import Agent from '@meldcx/agent';

const agent = new Agent();

const init = async() => {
     // Wait for the agent to be ready
     await agent.onReadyAsync();

     // Connect to the Biometric fingerprint reader
     await agent.Biometric.init();

     // Delete all fingers.
     await agent.Biometric.deleteAll();

     console.log('All fingers deleted');
};

init();

(async) deleteFinger(slot) → {Promise}

Parameters:
Name Type Description
slot String

The slot (finger) to delete.

Example
import Agent from '@meldcx/agent';

const agent = new Agent();

const init = async() => {
     // Wait for the agent to be ready
     await agent.onReadyAsync();

     // Connect to the Biometric fingerprint reader
     await agent.Biometric.init();

     const slot = '00000001';

     // Delete a finger.
     const result = await agent.Biometric.deleteFinger(slot);

     console.log('Here is the result');
     console.log(result);
};

init();

(async) enroll() → {Promise}

Example
import Agent from '@meldcx/agent';

const agent = new Agent();

const init = async() => {
     // Wait for the agent to be ready
     await agent.onReadyAsync();

     agent.Biometric.onStatus((msg, progress) => {
         console.log(`Status: ${msg} ${progress.toString()}%`);
     });

     // Enroll a finger.
     const result = await agent.Peripherals.Biometric.enroll();

     console.log('Here is the result');
     console.log(result);
};

init();

(async) listFingers() → {Promise.<module:Biometric~Fingers>}

Example
import Agent from '@meldcx/agent';

const agent = new Agent();

const init = async() => {
     // Wait for the agent to be ready
     await agent.onReadyAsync();

     // List of the current utilised "slots"
     const fingers = await agent.Peripherals.Biometric.listFingers();

     console.log('Here are the currently enrolled fingers');
     console.log(JSON.stringify(fingers));
};

init();

(async) on(event, callback) → {Promise}

Parameters:
Name Type Description
event String

The event to listen for.

callback function

The function to call when the event is fired.

(async) verify() → {Promise}

Example
import Agent from '@meldcx/agent';

const agent = new Agent();

const init = async() => {
     // Wait for the agent to be ready
     await agent.onReadyAsync();

     // Connect to the Biometric fingerprint reader
     await agent.Biometric.init();

     // Verify a finger.
     const result = await agent.Biometric.enroll();

     console.log('Here is the result');
     console.log(result);
};

init();