Comparing version 0.0.2 to 0.0.3
38
bglib.js
@@ -749,7 +749,7 @@ var bitwise = require('./libs/bitwise-ops'); | ||
// // Attribute Database | ||
// attributesWrite : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.PersistentStore, command : _bgcommandIDs.Attributes_Write}, paramCode: 0x824}, | ||
// attributesRead : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.PersistentStore, command : _bgcommandIDs.Attributes_Read}, paramCode: 0x44}, | ||
// attributesReadType : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.PersistentStore, command : _bgcommandIDs.Attributes_Read_Type}, paramCode: 0x04}, | ||
// attributesUserReadResponse : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.PersistentStore, command : _bgcommandIDs.Attributes_User_Read_Response}, paramCode: 0x822}, | ||
// attributesUserWriteResponse : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.PersistentStore, command : _bgcommandIDs.Attributes_User_Write_Response}, paramCode: 0x22}, | ||
// attributesWrite : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeDatabase, command : _bgcommandIDs.Attributes_Write}, paramCode: 0x824}, | ||
attributesRead : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeDatabase, command : _bgcommandIDs.Attributes_Read}, paramCode: 0x44}, | ||
attributesReadType : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeDatabase, command : _bgcommandIDs.Attributes_Read_Type}, paramCode: 0x04}, | ||
// attributesUserReadResponse : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeDatabase, command : _bgcommandIDs.Attributes_User_Read_Response}, paramCode: 0x822}, | ||
// attributesUserWriteResponse : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeDatabase, command : _bgcommandIDs.Attributes_User_Write_Response}, paramCode: 0x22}, | ||
@@ -759,3 +759,3 @@ | ||
// connectionDisconnect : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Disconnect}, paramCode: 0x02}, | ||
connectionGetRSSI : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Get_RSSI}, paramCode: 0x02}, | ||
// connectionGetRSSI : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Get_RSSI}, paramCode: 0x02}, | ||
// connectionUpdate : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Update}, paramCode: 0x44442}, | ||
@@ -766,3 +766,3 @@ // connectionVersion : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Version_Update}, paramCode: 0x02}, | ||
// connectionFeaturesGet : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Features_Get}, paramCode: 0x02}, | ||
connectionGetStatus : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Get_Status}, paramCode: 0x02}, | ||
// connectionGetStatus : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Get_Status}, paramCode: 0x02}, | ||
// connectionRawTx : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Connection, command : _bgcommandIDs.Connection_Raw_Tx}, paramCode: 0x82}, | ||
@@ -775,3 +775,3 @@ | ||
attClientFindInformation : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeClient, command : _bgcommandIDs.Attclient_Find_Information}, paramCode: 0x442}, | ||
// attClientReadByHandle : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeClient, command : _bgcommandIDs.Attclient_Read_By_Handle}, paramCode: 0x42}, | ||
attClientReadByHandle : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeClient, command : _bgcommandIDs.Attclient_Read_By_Handle}, paramCode: 0x42}, | ||
// attClientAttributeWrite : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeClient, command : _bgcommandIDs.Attclient_Attribute_Write}, paramCode: 0x842}, | ||
@@ -824,15 +824,15 @@ // attClientWriteCommand : {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.AttributeClient, command : _bgcommandIDs.Attclient_Write_Command}, paramCode: 0x842}, | ||
// // Test | ||
// testPhyTx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Phy_Tx}, paramCode: 0x222}, | ||
// testPhyTx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Phy_Rx}, paramCode: 0x02}, | ||
// testPhyTx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Phy_End}, paramCode: 0x00}, | ||
// testPhyTx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Phy_Reset}, paramCode: 0x00}, | ||
// testPhyTx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Get_Channel_Map}, paramCode: 0x00}, | ||
// testPhyTx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Debug}, paramCode: 0x08}, | ||
// testPhyTx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Channel_Mode}, paramCode: 0x02}, | ||
// testPhyTx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Phy_Tx}, paramCode: 0x00}, | ||
// testPhyRx: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Phy_Rx}, paramCode: 0x00}, | ||
// testPhyEnd: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Phy_End}, paramCode: 0x04}, | ||
// testPhyReset: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Phy_Reset}, paramCode: 0x00}, | ||
// testGetChannelMap: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Get_Channel_Map}, paramCode: 0x08}, | ||
// testDebug {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Debug}, paramCode: 0x08}, | ||
// testgetChannelMode: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.Test, command : _bgcommandIDs.Test_Channel_Mode}, paramCode: 0x00}, | ||
// // DFU | ||
// dfuReset: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.DFU, command : _bgcommandIDs.DFU_Reset}, paramCode: 0x02}, | ||
// dfuReset: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.DFU, command : _bgcommandIDs.DFU_Flash_Set_Address}, paramCode: 0x06}, | ||
// dfuReset: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.DFU, command : _bgcommandIDs.DFU_Flash_Upload}, paramCode: 0x08}, | ||
// dfuReset: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.DFU, command : _bgcommandIDs.DFU_Flash_Upload_Finish}, paramCode: 0x00}, | ||
dfuReset: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.DFU, command : _bgcommandIDs.DFU_Reset}, paramCode: 0x02}, | ||
// dfuFlashSetAddress: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.DFU, command : _bgcommandIDs.DFU_Flash_Set_Address}, paramCode: 0x06}, | ||
// dfuFlashUpload: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.DFU, command : _bgcommandIDs.DFU_Flash_Upload}, paramCode: 0x08}, | ||
// dfuFlashUploadFinish: {header : {tType: _bgtechnologyType.Bluetooth, mType: _bgmessageType.Command, cls : _bgcommandClass.DFU, command : _bgcommandIDs.DFU_Flash_Upload_Finish}, paramCode: 0x04}, | ||
} | ||
@@ -839,0 +839,0 @@ |
@@ -39,11 +39,11 @@ var bitwise = require('./bitwise-ops'); | ||
// var _bgResponseGetInfo = function(params) { | ||
// this.major = bitwise.numberFromUint8Bytes([params[0], params[1]]); | ||
// this.minor = bitwise.numberFromUint8Bytes([params[2], params[3]]); | ||
// this.patch = bitwise.numberFromUint8Bytes([params[4], params[5]]); | ||
// this.build = bitwise.numberFromUint8Bytes([params[6], params[7]]); | ||
// this.llversion = bitwise.numberFromUint8Bytes([params[8], params[9]]); | ||
// this.protocol_version = params[10]; | ||
// this.hw = params[11]; | ||
// } | ||
var _bgResponseGetInfo = function(params) { | ||
this.major = bitwise.numberFromUint8Bytes([params[0], params[1]]); | ||
this.minor = bitwise.numberFromUint8Bytes([params[2], params[3]]); | ||
this.patch = bitwise.numberFromUint8Bytes([params[4], params[5]]); | ||
this.build = bitwise.numberFromUint8Bytes([params[6], params[7]]); | ||
this.llversion = bitwise.numberFromUint8Bytes([params[8], params[9]]); | ||
this.protocol_version = params[10]; | ||
this.hw = params[11]; | ||
} | ||
@@ -50,0 +50,0 @@ // var _bgResponseEndpointTx = function(params) { |
@@ -77,3 +77,2 @@ function getUpperBits(num) { | ||
var byteArray = []; | ||
for (var i = 0; i < n; i++) { | ||
@@ -80,0 +79,0 @@ byteArray.push(number & 0xFF); |
{ | ||
"name": "bglib", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Create and parse packets for the BlueGiga BLE112 and BLE113", | ||
@@ -5,0 +5,0 @@ "main": "bglib.js", |
@@ -6,3 +6,3 @@ var bgLib = require('../'); | ||
lib.parseIncoming([ 128, 7, 7, 0, 179, 48, 3, 0, 1, 16, 19, 0, 2], | ||
lib.parseIncoming([ 0, 2, 6, 2, 0], | ||
function(err, parsedPackets) { | ||
@@ -14,11 +14,11 @@ if (err) return console.log(err); | ||
}); | ||
lib.parseIncoming([128, 12, 0, 0, 1, 0, 2, 0, 1, 0, 91, 0, 3, 0, 1, 6], | ||
function(err, parsedPackets) { | ||
if (err) return console.log(err); | ||
// lib.parseIncoming([128, 12, 0, 0, 1, 0, 2, 0, 1, 0, 91, 0, 3, 0, 1, 6], | ||
// function(err, parsedPackets) { | ||
// if (err) return console.log(err); | ||
console.log(parsedPackets); | ||
// console.log(parsedPackets); | ||
}); | ||
// }); | ||
console.log("All tests passed.") |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70972