# icu-connect

> connect and run Innovative Technology ICU™ device

Latest version **1.0.5** (published 2022-07-09) · ISC license · 0 weekly downloads

## Install

```sh
npm install icu-connect
pnpm add icu-connect
yarn add icu-connect
bun add icu-connect
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2022-07-09 |
| First published | 2022-06-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 29.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | T Beswick |
| Maintainers | tim-beswick |
| Keywords | icu, itl, age-verification |

## Links

- npm: https://www.npmjs.com/package/icu-connect
- Repository: https://github.com/inn-tech/icu-connect
- Homepage: https://github.com/inn-tech/icu-connect#readme
- Issues: https://github.com/inn-tech/icu-connect/issues
- npm.io page: https://npm.io/package/icu-connect

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [sqlite3](https://npm.io/package/sqlite3.md) ^5.0.8

## Recent versions

- 1.0.5 (latest) — 2022-07-09
- 1.0.4 — 2022-07-07
- 1.0.3 — 2022-07-05
- 1.0.2 — 2022-06-30
- 1.0.1 — 2022-06-30
- 1.0.0 — 2022-06-30

## README

# ICU™ Connect

A npm module to allow a user to connect and use an Innovative Technology Ltd [ICU Lite™](https://www.intelligent-identification.com/icu-lite) or [ICU Pro™](https://www.intelligent-identification.com/icu-pro) Age/Face biometric verification device.


## Features

- Use Device 'local API' mode
- Easy connection
- Device events
- Cross platform

---

<br />

## Options

Options can be set at object run function or using the seperate `set_options` request.


| Option | Description | Default |
|:------|:-----------|:-------:|
|`ip`|the ip address of the ICU device|192.168.137.8|
|`ssl`|true for HTTPS connection to ICU Device|true|
|`port`|the localAPI port number of the ICU device|44345|
|`username`|the localAPI username set on the ICU device||
|`password`|the localAPI password set on the ICU device||
|`db_dir`|the location directory for the database file|cwd|
|`db_name`|the filename for the databasefile|icu.db|

---

<br />

## Usage

The module initialises, connects, controls and reads the ICU™ device.
The ICU™ device needs to be set up in Local API mode. The user can chose SSL (https) connection or http and enter a security username and password on the 'Running Mode' tab on the device Web Config page http://{ip address>}:3000


```javascript

const {run,icu,enroll,set_options} = require('icu-connect')

// start the ICU device with options
run({
    'ip':'192.168.137.8',
    'ssl':true,
    'port':44345,
    'username':<icu_username>,
    'password':<icu_password>
});



/* 
    connected event - an ICU device has been connected.
    data parameter is a JSON object giving device details
*/ 
icu.on('connected',function(data){
    console.log('device connection',data)
})


/* 
    connected event - an ICU device has been connected.
    data parameter is a JSON object giving device details
*/ 
icu.on('disconnected',function(){
    console.log('device disconnected')
})

/* 
    device_state event - data parmeter shows 'initialising' or 'ready'
*/ 
icu.on('device_state',function(data){
    console.log('state',data)
})


/* 
    A face has been detected by the ICU and a detection session has started
*/ 
icu.on('sessionstart',function(){
    console.log('start')
})

/* 
    The face is no longer detected by the ICU device
*/ 
icu.on('sessionend',function(){
    console.log('end')
})

/* 
    The detected face has not been identifed and estimated age is given
*/ 
icu.on('age',function(data){
    console.log('detected age (no id)',data.estimated_age)
})

/* 
    The detected face has been identifed as matching a stored ID
*/ 
icu.on('uid',function(data){
    console.log('detected age with id',data.estimated_age,data.uid)
})

/* 
    The face parameters have been saved in the system
*/ 
icu.on('face_saved',function(data){
    console.log('face_saved')
})



```
### output
```
    device connection {
    DeviceId: '045dea23a',
    DeviceName: 'ICU-Touch',
    DeviceType: 'ICU-U-1',
    HwLevel: '10002',
    SWBuildVersion: '1070',
    Cameras: [
        { Name: 'ICU-Touch-camera', Type: 'usb', Data: '', Enabled: true },
        { Name: 'camera-2', Type: 'none', Data: 'none', Enabled: false }
    ]
    }
    state { device_state: 'initialising' }
    state { device_state: 'ready' }
    start
    detected age (no id) 42
    detected age (no id) 40
    detected age (no id) 42
    end
```
---

<br />

## Example
A working example using node and this module can be found on github [icu-connect-example-node](https://github.com/inn-tech/icu-connect-example-node.git)

---
_Source: https://npm.io/package/icu-connect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
