Skip to content

Instantly share code, notes, and snippets.

View jacobrosenthal's full-sized avatar

Jacob Rosenthal jacobrosenthal

View GitHub Profile
### Keybase proof
I hereby claim:
* I am jacobrosenthal on github.
* I am jacobrosenthal (https://keybase.io/jacobrosenthal) on keybase.
* I have a public key whose fingerprint is 987C E5D1 F64A 7791 425A 041A C01F 65B1 923F 1D5A
To claim this, I am signing this object:
@jacobrosenthal
jacobrosenthal / eddystone mac bindings debug
Created August 29, 2015 14:57
eddystone mac bindings debug
Jacobs-MacBook-Air:redux-friendlist-demo jacobrosenthal$ DEBUG=bindings node node_modules/eddystone-beacon/examples/url/simple.js
bindings sendCBMsg: 1, {
"kCBMsgArgName": "node-1440860023598",
"kCBMsgArgOptions": {
"kCBInitOptionShowPowerAlert": 1
},
"kCBMsgArgType": 1
} +0ms
bindings xpcEvent: {
"kCBMsgId": 6,
@jacobrosenthal
jacobrosenthal / Doesnt stop
Created September 5, 2015 22:20
uid advertising (and probably more) doesnt stop from websocket -- notice the xpc stop confirm time is too short
[email protected] ws /Users/jacobrosenthal/Downloads/ble_software
> DEBUG=bindings node ./node_modules/eddystone-beacon/node_modules/bleno/ws-slave.js
bindings sendCBMsg: 1, {
"kCBMsgArgName": "node-1441491214887",
"kCBMsgArgOptions": {
"kCBInitOptionShowPowerAlert": 1
},
"kCBMsgArgType": 1
} +0ms
@jacobrosenthal
jacobrosenthal / gist:489022611eca9c60f5c9
Last active September 7, 2015 22:19
ios combines scan response and adv packets clobbering the adv packet's manufacturer data so devices like wimoto who store data there are out of luck
RCTLogInfo(@"startScanning %@ %d", uuids, allowDuplicates);
NSMutableDictionary *scanOptions = [NSMutableDictionary dictionaryWithObject:@NO
forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
if(allowDuplicates){
[scanOptions setObject:@YES forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
}
[centralManager scanForPeripheralsWithServices:nil options:scanOptions];
@jacobrosenthal
jacobrosenthal / index.ios.js
Last active September 15, 2015 23:48
Example React Native BLE
/**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
var React = require('react-native');
var {
AppRegistry,
Text,
@jacobrosenthal
jacobrosenthal / index.ios.js
Last active September 23, 2015 02:11
React Native Swipe Example
'use strict';
var React = require('react-native');
var {
StyleSheet,
PanResponder,
View,
AppRegistry,
Dimensions
} = React;
@jacobrosenthal
jacobrosenthal / gist:b6ab2205da5bad6ad0f5
Created September 28, 2015 22:05
Bleno Battery Linux Bindings
jacob@gaia:~/Downloads/ble_software$ DEBUG=bindings,gatt,gap,smp,mgmt,crypto,acl-att-stream node node_modules/bleno/examples/battery-service/main.js
on -> stateChange: poweredOn
gap startAdvertising: name = Battery, serviceUuids = [
"180F"
] +0ms
gap startAdvertisingWithEIRData: advertisement data = 02010603030f18, scan data = 080842617474657279 +4ms
on -> advertisingStart: success
gatt handles = [
{},
{
@jacobrosenthal
jacobrosenthal / gist:0cff7544c46346573e56
Created September 28, 2015 22:06
Bleno Battery OSX (yosemite) bindings
^CJacobs-MacBook-Air:bleno jacobrosenthalDEBUG=bindings node examples/battery-service/main.js
bindings sendCBMsg: 1, {
"kCBMsgArgName": "node-1443477764659",
"kCBMsgArgOptions": {
"kCBInitOptionShowPowerAlert": 1
},
"kCBMsgArgType": 1
} +0ms
bindings xpcEvent: {
"kCBMsgId": 6,
@jacobrosenthal
jacobrosenthal / gist:4959a66a5fa5984113eb
Created September 29, 2015 01:51
hcidump bleno linux
jacob@gaia:~/Downloads/ble_software$ hcidump -t -x
HCI sniffer - Bluetooth packet analyzer ver 5.23
device: hci0 snap_len: 1500 filter: 0xffffffff
2015-09-29 03:49:55.964575 > HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Response Data (0x08|0x0009) ncmd 1
status 0x00
2015-09-29 03:49:55.965584 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Data (0x08|0x0008) ncmd 1
status 0x00
2015-09-29 03:49:55.966575 > HCI Event: Command Complete (0x0e) plen 4
@jacobrosenthal
jacobrosenthal / gist:28fbcdfa3df29262f63a
Created September 29, 2015 02:08
hcidump bleno linux raspberry pi
2015-09-29 02:08:03.310259 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Data (0x08|0x0008) ncmd 1
status 0x00
2015-09-29 02:08:03.312255 > HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x0c
Error: Command Disallowed
2015-09-29 02:08:03.314266 > HCI Event: Command Complete (0x0e) plen 4
LE Set Scan Response Data (0x08|0x0009) ncmd 1
status 0x00