Skip to content

reelyactive/dynamb-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

dynamb-filter

A dynamb-filter facilitates the filtering of dynamic ambient (dynamb) IoT data data based on a standardised set of parameters.

dynamb-filter is a lightweight Node.js package that is typically used with a barnacles instance and the barnacles-x family of modules which relay dynamb data to specific endpoints. Together these packages are core components of reelyActive's Pareto Anywhere open source IoT middleware.

See also the dynamb-filter's sister modules, raddec-filter and spatem-filter.

Hello dynamb-filter!

const DynambFilter = require('dynamb-filter');

let parameters = {
    acceptedDeviceSignatures: [ 'aabbccddeeff/2', '112233445566/2' ],
    acceptedDeviceIds: [ 'aabbccddeeff', '112233445566' ],
    acceptedDeviceIdTypes: [ 2 ],
    acceptedProperties: [ 'isButtonPressed', 'temperature' ]
}

let filter = new DynambFilter(parameters);

let dynamb = { /* Dynamb properties */ };

let accepted = filter.isPassing(dynamb);

console.log(accepted); // true or false

See the reelyActive Developer's Cheatsheet for a detailed description of the dynamb and its properties.

Filter parameters

The following parameters are supported:

acceptedDeviceSignatures

Array of device signatures to accept. A filtered dynamb must have its device signature (deviceId and deviceIdType) included in the list to pass. For example, to only allow dynambs from a device with EUI-48 identifier aa:bb:cc:dd:ee:ff to pass:

let acceptedDeviceSignatures = [ 'aabbccddeeff/2' ];

acceptedDeviceIds

Array of deviceIds to accept. A filtered dynamb must have a deviceId included in the list to pass. For example, to only allow dynambs from devices with the identifier aa:bb:cc:dd:ee:ff to pass:

let acceptedDeviceIds = [ 'aabbccddeeff' ];

acceptedDeviceIdTypes

Array of deviceIdTypes to accept. See the list of identifier types for details. A filtered dynamb must have a deviceIdType included in the list to pass. For example, to only allow dynambs from devices with EUI-48 and random 48-bit identifiers to pass:

let acceptedDeviceIdTypes = [ 2, 3 ];

Filter logic

The dynamb-filter will iterate sequentially through each included filter parameter, and return false if any should fail. If all included filter parameters are passing, the dynamb-filter will return true.

Contributing

Discover how to contribute to this open source project which upholds a standard code of conduct.

Security

Consult our security policy for best practices using this open source software and to report vulnerabilities.

License

MIT License

Copyright (c) 2025 reelyActive

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Filter for dynambs based on a standardised set of parameters. We believe in an open Internet of Things.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published