Closed dlech closed 6 years ago
Have you seen this repo, will have lots of info you could add into this
https://github.com/nathankellenicki/node-poweredup
Here are a few gotchas that you might like to look at
external ports on boost move are 0x01 and 0x02, but on poweredup hub are 0x00 and 0x01 (!)
Virtual port 0x39 only exists if the two inserted motors are the same type on boost move hub up two internal motors are 0x37 and 0x38, together give virtual port 0x39 (always present) on powered up hub insert two motors into 0x00 and 0x01 and a virtual port 0x39 will then appear, try and use 0x39 at any other time and the hub will crash...
Sensor types such as voltage (0x14) are not always on the same port (i.e. not always 0x3B). The notification when a sensor is attached (or at power up for internal sensors) tells you which port to use. e.g. https://github.com/nathankellenicki/node-poweredup/issues/1
var typeLookup:{[id:number]:string} = {};
typeLookup[0x00] = TYPE_EMPTY;
typeLookup[0x01] = TYPE_MOTOR;
typeLookup[0x02] = TYPE_TRAIN_MOTOR;
typeLookup[0x08] = TYPE_LIGHTS;
typeLookup[0x14] = TYPE_VOLTAGE;
typeLookup[0x15] = TYPE_CURRENT;
typeLookup[0x16] = TYPE_PIEZO;
typeLookup[0x17] = TYPE_RGB;
typeLookup[0x22] = TYPE_TILT;
typeLookup[0x23] = TYPE_DISTANCE;
typeLookup[0x24] = TYPE_GENERIC;
typeLookup[0x25] = TYPE_COLOR;
typeLookup[0x26] = TYPE_INTERACTIVE_MOTOR;
typeLookup[0x27] = TYPE_INTERNAL_MOTOR;
typeLookup[0x28] = TYPE_INTERNAL_TILT;
typeLookup[0x29] = TYPE_DUPLO_TRAIN_MOTOR;
typeLookup[0x30] = TYPE_DUPLO_TRAIN_PIEZO;
typeLookup[0x31] = TYPE_DUPLO_TRAIN_COLOR;
typeLookup[0x32] = TYPE_DUPLO_TRAIN_SPEEDO;
typeLookup[0x37] = TYPE_REMOTE_BUTTON;
typeLookup[0x38] = TYPE_REMOTE_CURRENT;
This is a protocol dissector for Wireshark. It parses GATT characteristic data into human-readable form. Currently, only device info (0x01) commands are implemented.