New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bipso

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bipso

bipso ==================

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
82
increased by38.98%
Maintainers
1
Weekly downloads
 
Created
Source

bipso


Table of Contents

  1. Overview
  2. Installation
  3. Usage
  4. APIs
  5. Table of Characteristics
  6. License

1. Overview

bipso is a set of BLE characteristic definition following IPSO Smart Object Guideline(). Each IPSO Smart Object is defined as a BLE characteristic in this document, and characteristic value is an object contains resources of IPSO Smart Object.


2. Installation

$ npm install bipso --save


3. Usage

bipso provides you two getters, i.e. getUuid() and getParams(), to get Characteristic UUID and Characteristic value format.

Here is a quick exemple:

var ipsoChar = require('bipso'),
    charUuid,
    charParam;

// get characteristic UUID
charUuid = ipsoChar.getUuid('dIn');

// get characteristic parameters
charParam = ipsoChar.getParams(charUuid);

4. APIs


.getUuid(oid)

Get Characteristic UUID corresponding to IPSO Smart Object.

Arguments:

  • oid(String | Number): Smart Object ID. oid can be given with a string or a number. Notice that a numbered string will be recognized as a number, e.g. '128' is equal to 128.

Returns:

  • (String): Characteristic UUID or undefined

Example:

ipsoChar.getUuid('dIn');    // '0xcc00'
ipsoChar.getUuid('3200');    // '0xcc00'
ipsoChar.getUuid(3200);        // '0xcc00'

ipsoChar.getUuid('1234');      // undefined
ipsoChar.getUuid('xxxx');    // undefined

.getParams(uuid)

Get Characteristic parameters definition.

Arguments:

  • uuid(String | Number): Characteristic UUID defined in this document.

Returns:

  • (Array): Characteristic parameters object.

Example

var charParams = ipsoChar.getParams(0xcc00);
    // charParams equal to 
    // [
    //     {name: flags, type: uint8},
    //     {name: dInState, type: boolean},
    //     {name: counter, type: uint8},
    //     {name: dInPolarity, type: boolean},
    //     {name: debouncePeriod, type: uint16},
    //     {name: edgeSelection, type: uint8},
    //     {name: counterReset, type: buffer},
    //     {name: appType, type: string},
    //     {name: sensorType, type: string}
    // ]

5. Table of Characteristics

Following table are cross-references between the IPSO Smart Object and Characteristic UUID defined by this document.Here is the description of each column in the table:

  • IPSO Object
    • Object name and object ID defined by IPSO Alliance
  • Characteristic UUID
    • Characteristic UUID corresponding to IPSO Object
  • Fields
    • Characteristic value is an object formed from these fields
    • A Field of fieldName(fieldType) indicates that field name of characteristic value object and tells the data type.
    • Fields are divided into mandatory and optional, the mandatory field using bold typeface to represent, or it will be optional
      • flags is used to indicate which optional parameters to use, it is bit mask, each bit represent a optional
      • Let's take Digital Input Object as an example
        • if flags = 3, counter and dInPolarity will exist
        • if flags = 32, appType will exist
        • if flags = 65, counter and sensorType will exist
IPSO ObjectClassCharacteristic UUIDFields
Digital Input (3200)dIn0xcc00flags(uint8), dInState(boolean), counter(uint8), dInPolarity(boolean), debouncePeriod(uint16), edgeSelection(uint8), counterReset(buffer), appType(string), sensorType(string)
Digital Output (3201)dOut0xcc01flags(uint8), dOutState(boolean), dOutPolarity(boolean), appType(string)
Analogue Input (3202)aIn0xcc02flags(uint8), aInCurrValue(float), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), appType(string), sensorType(string)
Analogue Output (3203)aOut0xcc03flags(uint8), aOutCurrValue(float), minRangeValue(float), maxRangeValue(float), appType(string)
Generic Sensor (3300)generic0xcc04flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), appType(string), sensorType(string)
Illuminance Sensor (3301)illuminance0xcc05flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer)
Presence Sensor (3302)presence0xcc06flags(uint8), dInState(boolean), counter(uint8), counterReset(buffer), sensorType(string), busyToClearDelay(uint16), clearToBusyDelay(uint16)
Temperature Sensor (3303)temperature0xcc07flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer)
Humidity Sensor (3304)humidity0xcc08flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer)
Power Measurement (3305)pwrMea0xcc09flags(uint32), instActivePwr(float), minMeaActivePwr(float), maxMeaActivePwr(float), minRangeActivePwr(float), maxRangeActivePwr(float), cumulActivePwr(float), activePwrCal(float), instReactivePwr(float), minMeaReactivePwr(float), maxMeaReactivePwr(float), minRangeReactivePwr(float), maxRangeReactivePwr(float), resetMinMaxMeaValues(buffer), cumulReactivePwr(float), reactivePwrCal(float), pwrFactor(float), currCal(float), resetCumulEnergy(buffer)
Actuation (3306)actuation0xcc0aflags(uint8), onOff(boolean), dimmer(uint8), onTime(uint16), mStateOut(string), appType(string)
Set Point (3308)setPoint0xcc0bflags(uint8), setPointValue(float), colour(string), units(string), appType(string)
Load Control (3310)loadCtrl0xcc0cflags(uint8), eventId(string), startTime(uint32), durationInMin(uint16), criticalLevel(uint8), avgLoadAdjPct(uint8), dutyCycle(uint8)
Light Control (3311)lightCtrl0xcc0dflags(uint8), onOff(boolean), dimmer(uint8), colour(string), units(string), onTime(uint16), cumulActivePwr(float), pwrFactor(float)
Power Control (3312)pwrCtrl0xcc0eflags(uint8), onOff(boolean), dimmer(uint8), onTime(uint16), cumulActivePwr(float), pwrFactor(float)
Accelerometer (3313)accelerometer0xcc0fflags(uint8), xValue(float), yValue(float), zValue(float), units(string), minRangeValue(float), maxRangeValue(float)
Magnetometer (3314)magnetometer0xcc10flags(uint8), xValue(float), yValue(float), zValue(float), units(string), compassDir(float)
Barometer (3315)barometer0xcc11flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer)
Voltage (3316)voltage0xcc12flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Current (3317)current0xcc13flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Frequency (3318)frequency0xcc14flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Depth (3319)depth0xcc15flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Percentage (3320)percentage0xcc16flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Altitude (3321)altitude0xcc17flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Load (3322)load0xcc18flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Pressure (3323)pressure0xcc19flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Loudness (3324)loudness0xcc1aflags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Concentration (3325)concentration0xcc1bflags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Acidity (3326)acidity0xcc1cflags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Conductivity (3327)conductivity0xcc1dflags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Power (3328)power0xcc1eflags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Power Factor (3329)powerFactor0xcc1fflags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Distance (3330)distance0xcc20flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Energy (3331)energy0xcc21flags(uint8), sensorValue(float), units(string), resetCumulEnergy(buffer), appType(string)
Direction (3332)direction0xcc22flags(uint8), compassDir(float), minMeaValue(float), maxMeaValue(float), resetMinMaxMeaValues(buffer), appType(string)
Time (3333)time0xcc23flags(uint8), currentTime(uint32), fracTime(float), appType(string)
Gyrometer (3334)gyrometer0xcc24flags(uint8), xValue(float), yValue(float), zValue(float), units(string), minXValue(float), maxXValue(float), minYValue(float), maxYValue(float), minZValue(float), maxZValue(float), resetMinMaxMeaValues(buffer), minRangeValue(float), maxRangeValue(float), appType(string)
Color (3335)color0xcc25flags(uint8), colour(string), units(string), appType(string)
GPS Location (3336)gpsLocation0xcc26flags(uint8), latitude(string), longitude(string), altitude(string), uncertainty(string), compassDir(float), velocity(buffer), timestamp(uint32), appType(string)
Positioner (3337)positioner0xcc27flags(uint8), currentPos(float), transTime(float), remainTime(float), minMeaValue(float), maxMeaValue(float), resetMinMaxMeaValues(buffer), minLimit(float), maxLimit(float), appType(string)
Buzzer (3338)buzzer0xcc28flags(uint8), onOff(boolean), minOffTime(float), level(float), timeDuration(float), appType(string)
Audio Clip (3339)audioClip0xcc29flags(uint8), clip(buffer), trigger(buffer), level(float), soundDuration(float), appType(string)
Timer (3340)timer0xcc2aflags(uint8), timeDuration(float), remainTime(float), minOffTime(float), trigger(buffer), onOff(boolean), counter(uint8), cumulTime(float), digitalState(boolean), eventCounter(uint8), mode(uint8), appType(string)
Addressable Text Display (3341)addressableTextDisplay0xcc2bflags(uint8), text(string), xCoord(uint16), yCoord(uint16), maxXCoord(uint16), maxYCoord(uint16), clearDisplay(buffer), level(float), contrast(float), appType(string)
On/Off Switch (3342)onOffSwitch0xcc2cflags(uint8), dInState(boolean), counter(uint8), onTime(uint16), offTime(uint16), appType(string)
Level Control (3343)levelControl0xcc2dflags(uint8), level(float), onTime(uint16), offTime(uint16), appType(string)
Up/Down Control (3344)upDownControl0xcc2eflags(uint8), incInputState(boolean), decInputState(boolean), upCounter(uint8), downCounter(uint8), appType(string)
Multiple Axis Joystick (3345)multipleAxisJoystick0xcc2fflags(uint8), dInState(boolean), counter(uint8), xValue(float), yValue(float), zValue(float), appType(string)
Rate (3346)rate0xcc30flags(uint8), sensorValue(float), units(string), minMeaValue(float), maxMeaValue(float), minRangeValue(float), maxRangeValue(float), resetMinMaxMeaValues(buffer), calOffset(float), appType(string)
Push Button (3347)pushButton0xcc31flags(uint8), dInState(boolean), counter(uint8), appType(string)
Multistate Selector (3348)multistateSelector0xcc32flags(uint8), mStateIn(uint8), appType(string)

6. License

The MIT License (MIT)

Copyright (c) 2016 Hedy Wang hedywings@gmail.com

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. |

FAQs

Package last updated on 18 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc