<commit_before>advlib
======

Library for wireless advertising packet decoding.  __advlib__ is protocol-agnostic and currently supports the following processor modules:
- [advlib-ble](https://github.com/reelyactive/advlib-ble) for Bluetooth Low Energy


Installation
------------

    npm install advlib


Hello advlib
------------

For example, process several raw packets received from a beacon by selecting Bluetooth Low Energy as the processor ([advlib-ble](https://github.com/reelyactive/advlib-ble)) and including any relevant processing libraries.

```javascript
const advlib = require('advlib');

const PROCESSORS = [
    { processor: require('advlib-ble'),
      libraries: [ require('advlib-ble-services'),
                   require('advlib-ble-manufacturers') ] }
];

let packets = [
    'c21d04acbe55daba16096164766c6962206279207265656c79416374697665',
    'c21904acbe55daba1216aafe10fc017265656c7961637469766507',
    'c21804acbe55daba1116aafe20000c4815200000004500000258'
];
let processedPackets = advlib.process(packets, PROCESSORS);
console.log(processedPackets);
```

Packets will be combined, in order of precedence, into a single JSON:

```javascript
{ rxAdd: "random",
  txAdd: "random",
  type: "ADV_NONCONN_IND",
  length: 29,
  advA: "bada55beac04",
  name: "advlib by reelyActive",
  txPower: -4,
  uri: "https://www.reelyactive.com",
  batteryVoltage: 3.144,<commit_msg>Added purpose, objective and Pareto Anywhere<commit_after>advlib
======

Library for wireless advertising packet decoding.  __advlib__ is protocol-agnostic and currently supports the following processor modules:
- [advlib-ble](https://github.com/reelyactive/advlib-ble) for Bluetooth Low Energy

The _purpose_ of __advlib__ is to extract all potentially relevant information from ambient data packets and to organise this information in a consistent manner, regardless of the radio protocol.

The _objective_ of __advlib__ v1.x is to support and to make accessible the broadest array of use cases by being highly modular and by facilitating contributions to its continuous development.

__advlib__ is a lightweight [Node.js package](https://www.npmjs.com/package/advlib) that can run on resource-constrained edge devices as well as on powerful cloud servers and anything in between. It is a key element in [Pareto Anywhere](https://getpareto.com/) open source software of the [reelyActive technology platform](https://www.reelyactive.com/technology/).


Installation
------------

    npm install advlib


Hello advlib
------------

For example, process several raw packets received from a beacon by selecting Bluetooth Low Energy as the processor ([advlib-ble](https://github.com/reelyactive/advlib-ble)) and including any relevant processing libraries (don't forget to first install these using npm).

```javascript
const advlib = require('advlib');

const PROCESSORS = [
    { processor: require('advlib-ble'),
      libraries: [ require('advlib-ble-services'),
                   require('advlib-ble-manufacturers') ] }
];

let packets = [
    'c21d04acbe55daba16096164766c6962206279207265656c79416374697665',
    'c21904acbe55daba1216aafe10fc017265656c7961637469766507',
    'c21804acbe55daba1116aafe20000c4815200000004500000258'
];
let processedPackets = advlib.process(packets, PROCESSORS);
console.log(processedPackets);
```

Packets will be combined, in order of precedence, into a single JSON:

```javascript
{ rxAdd: "random",
  txAdd: "random",
  type: "ADV_NONCONN_IND",
  length: 29,
  advA: "bada55beac04",
  name: "advlib by reelyActive",
  txPower: -4,
  uri: "https://www.reelyactive.com",
  batteryVoltage: 3.144,
{'fraction_non_alphanumeric': 0.10667034178610804, 'fraction_numerical': 0.07579933847850055, 'mean_word_length': 4.626356589147287, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 9, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '845360', 'n_tokens_mistral': 1285, 'n_tokens_neox': 1077, 'n_words': 325}