npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nitsnetsnpm/cordova-plugin-mindv2le

v1.0.3

Published

Use the Bluetooth Low Energy plugin to connect NITSNETS app to new Mondraker MINDV2 devices. *Based on cordova-plugin-bluetoothle.

Downloads

25

Readme

MINDV2 Bluetooth LE Plugin

This plugin allows you to interact with MINDV2 Bluetooth LE devices on Android and iOS.

  • Added support for Espressif Blufi Protocol

Instalación y uso

  • Cordova install: cordova plugin add @nitsnetsnpm/cordova-plugin-mindv2le

  • NPM install: npm i @nitsnetsnpm/cordova-plugin-mindv2le

  • Uso de plugin mindv2le con Promise (Observable en Ionic):


new Promise(function (resolve) {
    mindv2le.initialize(resolve, {
    request: true,
    statusReceiver: true,
    restoreKey: "mindv2leplugin",
    });
}).then(initializeSuccess, handleError);

Métodos básicos

Los métodos básicos de inicialización de BLe, escaneo de dispositivos, conexión, desconexión, estado...etc son los mismos del plugin original Métodos cordova-plugin-bluetoothle

  • mindv2le.initialize
  • mindv2le.enable
  • mindv2le.disable
  • mindv2le.startScan (Buscar dispositivos MINDV2)
  • mindv2le.stopScan
  • mindv2le.connect
  • mindv2le.reconnect
  • mindv2le.disconnect
  • mindv2le.close
  • mindv2le.isEnabled
  • mindv2le.isScanning
  • mindv2le.wasConnected
  • mindv2le.isConnected
  • ...etc

Métodos y Eventos conexión MindV2

Métodos MindV2

Ciclo de conexión

  • Inicializar BLe y esperar evento OK de inicialización plugin: mindv2le.initialize
  • Escanear dispositivos MindV2 y buscar dispositivos "MINDV2": mindv2le.startScan
  • Registrar regMINDv2CallBack: Método mindv2le.regMINDv2
  • Conectar a dispositivo MindV2: mindv2le.connect
  • Esperar eventos OK: isPreparedMINDv2
  • Get keyID de sesión y Shock/Fork Serial, FW version y HW version: Método mindv2le.getIDConMINDv2
  • Desencriptar keyID con servidor.
  • Registrar Bike Serial y keyID de autenticación con MINDv2: Método mindv2le.regSerialMINDv2
  • Ejecutar función MindV2 necesaria: mindv2le.requestDeviceScanMINDv2, mindv2le.postProvisionMINDv2
  • Desconectar de dispositivo: mindv2le.disconnect
  • Cerrar y liberar recurso: mindv2le.close

keyID Autenticación

  • MINDv2 generará a partir de un número random un cifrado AES-128-CBC y codificación en base64.
keyID = "1234567890"
keyID cifrado: = "jFSJtrLGCGmO5V2GSoL3mg=="
  • Servidor desencriptará el keyID y lo enviará como autenticación cuando registre Bike Serial.

Ej. PHP:

$pass = 'A2EC71B835F49D71';
$iv = "62C95F98BA425ED6";
$method = 'aes-128-cbc';
echo openssl_decrypt(base64_decode('jFSJtrLGCGmO5V2GSoL3mg=='),$method,$pass,OPENSSL_RAW_DATA,$iv);

regMINDv2

El primer paso antes de conectar con un dispositivo es registrar el Callback MINDv2 necesario para recibir cualquier evento relacionado con el protocolo de MindV2.

  • No es necesario llamar el método con Promise (por determinar con Observable).
  • En caso de error o no obtener respuesta no se debería conectar a dispositivo.
mindv2le.regMINDv2(regMINDv2CallBack, handleError, { address: addr });

params

  • regMINDv2CallBack: función para recibir tipo de evento, status y/o resultado.
  • handleError: error function
  • address: dirección obtenida tras respuesta de mindv2le.startScan

isPreparedMINDv2

Evento MINDv2 CallBack: Estado de conexión a dispositivo MindV2 e inicialización de GATT peripheral.

  • En caso de error proceder a desconexión.

result

  • result.type: "isPreparedMINDv2"
  • result.status: true / false

recvErrorMINDv2

Evento MINDv2 CallBack: Estado sobre error en la conexión.

  • En caso de error proceder a desconexión.

result

  • result.type: "recvErrorMINDv2"
  • result.status: false
  • result.message: Srtring mensaje error

getIDConMINDv2

Obtener KeyID secret encriptado, el servidor debe desencriptarlo y devolver el keyID al registrar Bike Serial. Obtener Shock & Fork Serial, Firmware y Hardware

new Promise(function (resolve, error) {
    mindv2le.getIDConMINDv2(resolve, error, { address: addr });
}).then(getIDConMINDv2CallBack, handleError);

params

  • address: dirección dispositivo MindV2

result

  • result.status: true false
  • result.keyID: String en base64
  • result.ShockSerial
  • result.ForkSerial
  • result.ShockFW
  • result.ShockHW
  • result.ForkFW
  • result.ForkHW

regSerialMINDv2

Registrar Bike Serial y keyID desencriptado por servidor (autenticación en Mind2)

new Promise(function (resolve, error) {
    mindv2le.regSerialMINDv2(resolve, error, { address: addr , mindv2bikeserial:"ABCDEFGHI1", keyID:"1234567890"});
}).then(regSerialMINDv2CallBack, handleError);

params

  • address: dirección dispositivo MindV2
  • mindv2bikeserial: Bike Serial
  • keyID: keyID Autenticación

result

  • result.regSerialStatus: 0 Registro serial OK: el dispositivo era nuevo o tenía el mismo serial
  • result.regSerialStatus: 1 Serial no coincide con el que está registrado en SHOCK
  • result.regSerialStatus: 2 Error Autenticación
  • result.regSerialStatus: -1 Error

requestDeviceScanMINDv2

Obtener lista de Puntos de Acceso Wifi detectada por MindV2 (No es necesario indicar callback, las respuestas se reciben directamente en BlufiCallBack)

  • El listado de Wifis debe obtenerse desde MindV2, no del escaneo que realiza el propio móvil.
new Promise(function (resolve, error) {
    mindv2le.requestDeviceScanMINDv2(resolve, error, { address: addr});
}).then(requestDeviceScanMINDv2CallBack, handleError);

params

  • address: dirección dispositivo MindV2

result

  • result.status: true false
  • result.wifiList: Lista Wifi en formato JSON ({"SSID":nivel_señal_rssi, ...})

postProvisionMINDv2

Provisioning SSID y credenciales para conectar a Punto Acceso Wifi (No es necesario indicar callback, las respuestas se reciben directamente en BlufiCallBack)

  • Si conecta correctamente automáticamente MindV2 devuelve un evento de tipo Status.
new Promise(function (resolve, error) {
    mindv2le.postProvisionMINDv2(resolve, error, { address: addr, provssid: "YOUR-WIFI-SSID", provpass: "YOUR-PASS" });
}).then(postProvisionMINDv2CallBack, handleError);

params

  • address: dirección dispositivo MindV2
  • provssid: Nombre punto acceso Wifi
  • provpass: Password

result

  • result.provWifiStatus: 0 Conectado
  • result.provWifiStatus: !0 No Conectado/ No se guarda Wifi