tessel / ble-ble113a Goto Github PK
View Code? Open in Web Editor NEW[UNMAINTAINED] JavaScript module for the BlueGiga BLE113 SOC.
License: Other
[UNMAINTAINED] JavaScript module for the BlueGiga BLE113 SOC.
License: Other
See relevant forum issue for more details. I've made a forum post on the Bluegiga website about the issue.
Any UUID with dashes, such as 12ad43a2-a21b-d321-afd3-864ab23a1111
will not be parsed into a pure UUID.
It would be nice to be able to set the advertising rate of a BLE module acting as a beacon.
To do that, we need to add a function to messenger.js which outlines the raw packet that is being sent over UART to the module. It will use the bglib.gapSetAdvParameters
function. The function expects a 16 bit number describing the min interval, a 16 bit number specifying the max interval, and a bit mask to specify which advertisement channels are used. The interval argument can be between 0x20 and 0x400. The advertisement channel should probably be 0x07 to continue using all three channels.
Then, this messenger API function should be surfaced to the BluetoothController object in index.js.
Here is the output from trying to run the example:
INFO Looking for your Tessel...
INFO Connected to doorman.
INFO Building project.
INFO Writing project to RAM on doorman (149.504 kB)...
INFO Deployed.
INFO Running ble.js...
Trace: <Buffer ef bf bd 0c 00 00 01 00 02 00 02 00 5d 00 03 00 01 06>
at e.parseIncomingPackets (/tmp/remote-script/node_modules/ble-ble113a/lib/messenger.js:1:7049)
at emitOne (events.js:77:13)
at emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Readable.push (_stream_readable.js:110:10)
at null.<anonymous> (/usr/lib/node/tessel-export.js:229:24)
at emitNone (events.js:67:13)
at Socket.emit (events.js:166:7)
at emitReadable_ (_stream_readable.js:411:10)
at emitReadable (_stream_readable.js:405:7)
[Error: No existing response creator for packet of class 0 and command id 93]
events.js:141
throw er; // Unhandled 'error' event
^
Error: Unable to connect to module.
at Error (native)
at e.<anonymous> (/tmp/remote-script/node_modules/ble-ble113a/lib/messenger.js:1:524)
at processImmediate [as _immediateCallback] (timers.js:368:17)
The first byte should be an 0x80
, instead there are three nonsense bytes (0xef
, 0xbf
, 0xed
) so there may be an issue with the UART peripheral in T2 firmware.
Without the passkey display and passkey entry events it is impossible to connect to a passkey enabled BLE device.
The connection_status
event is not being fired when trying to connect to an iOS device. See more details and test code on this forum post.
Bonus points if you make example code that other people can use to integrate Tessel BLE with iOS and/or Android
On the order of 1-2 minutes to do an unfiltered service discovery. Not sure if this is a function of the Tessel or BLE113.
The feature to change the transmission power has been requested on the forums.
To do this, a function needs to be added to messenger.js (the agent that sends and receives packages from the BLE113) to send the correct packet. To do that, call the bglib. hwSetTxPower
function and pass in a value from 0 to 15 to sent the transmission power. 15 is the highest. Then, expose the function in index.js, where the BluetoothController will ask the messenger API to send the message and receive the response.
I tried using your example by running it directly from the example directory and my iphone does not pick up on it.
npm init
npm i tessel --save
npm i
Then in the ble-advertise.js
var tessel = require('tessel');
var blelib = require('ble-ble113a');
var ble = blelib.use(tessel.port['A']);
// var ble = require('../').use(tessel.port['A']); // Replace '../' with 'ble-ble113a' in your own code
var interval;
then
tessel run ble-advertise.js
I get started advertising...
but with nothing showing on my iphone.
I have connected to an Arduino based BLE Slave and am listening for serial commands on it right now. Can't seem to find a good way to explicitly write out and listen to it through the Tessel BLE api.
Here is the device (LightBlue Bean)
{
"services": {},
"rssi": -52,
"advertisingData": [
{
"typeFlag": 1,
"type": "Flags",
"raw": {},
"data": [
"LE General Discoverable Mode",
"BR/EDR Not Supported"
],
"byteOrder": "BE"
},
{
"typeFlag": 6,
"type": "Incomplete List of 128-bit Service Class UUIDs",
"raw": {},
"data": [
"a495ff10c5b14b44b5121370f02d74de"
],
"byteOrder": "BE"
}
],
"address": "194.45.205.114.57.208"
}
We need to throw an error when someone tries to send an advertising packet that is great than the maximum number of bytes (which I believe is 32).
Add code of conduct badge, a la tessel/project#190
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.