Name: jewelapp
Owner: Jewelbots
Description: Jewelbots App for iOS/Android
Created: 2015-04-29 18:35:15.0
Updated: 2017-10-23 18:56:28.0
Pushed: 2017-11-29 06:03:45.0
Size: 36312
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Jewelbots App for iOS/Android
TBA, this is an unfinished application. If you like, you can ask us questions on Slack here.
gulp
- updates www folderionic build ios
- prepare app to be built in xcodeProduct -> Archive
Basic HTML stuff can be tested in the browser with ionic serve
, but the bluetoothle library is not
supported in the browser or emulator, so most of your testing will need to happen on a device itself.
See instructions to build and deploy to your phone here
Service 180A - Device information
Service 63400001-1A1E-5704-0A53-844BD14254A1 - Jewelbots Information
The friends will come from device as a flattened uint8array
each “friend” is 8 bytes of the array, up to I think 16 friends
so a if the friend list is [1,2,3,4,5,6,7,1,2,10,11,12,13,14,15,3]
that's
really 2 “friends” of [1,2,3,4,5,6,7,2]
and [2,10,11,12,13,14,15,3]
.
In practice, it will always be “full”, and any unused friend “slots” will be all zeroes.
The breakdown of each friend is first byte index, second-seventh bytes address (stored reversed), eighth byte color
Color codes: 0 = red, 1 = green, 2 = blue, 3 = cyan (will be more later but only 4 currently active)
cReady().then(function () {
use initialize to get bluetooth up and running. will error if bluetooth not enabled on phone
turn $cordovaBluetoothle.initialize(params)
n(function (data) {
startScan() scans for devices. You can filter with params
turn $cordovaBluetoothle.startScan(params);
n(function (data) {
r(var i=0;i < data.length; i++) {
if (data[i].status === 'scanResult' && data[i].advertisement.isConnectable) {
console.log(data[i])
}
make sure to stopScan()
turn $cordovaBluetoothle.stopScan();
On iOS, you will need to follow the same basic pattern to read a characteristic:
initialize()
bluetoothconnect()
to deviceservices()
for devicecharacteristics()
for a serviceread()
a characteristicYou have to do this even if you already know which service and characteristic you want. Trying to go straight to the read()
will result in an error.
result = $cordovaBluetoothle.initialize({'request': true})
n(function(data) {
turn $timeout($cordovaBluetoothle.connect(params))
n(function(response) {
turn $cordovaBluetoothle.services({address: deviceId})
n(function(response) {
turn $cordovaBluetoothle.characteristics({address: deviceId, service: "180A"});
n(function(response) {
turn $cordovaBluetoothle.read({address: DataService.GetDeviceId(), service: "180A", characteristic: "2A26"})