Jewelbots/jewelapp

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

Homepage:

Size: 36312

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Jewelapp

Jewelbots App for iOS/Android

Setup

TBA, this is an unfinished application. If you like, you can ask us questions on Slack here.

Build

  1. gulp - updates www folder
  2. ionic build ios - prepare app to be built in xcode
  3. XCode - Product -> 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

Dependencies

Reading Firmware Services and Characteristics

Important Services and Characteristics
Friends List Data Structure

Basic Bluetoothle Library Usage

iOS
Scan for devices ex: pair-ctrl.js
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();

Read Characteristics ex: dashboard-ctrl.js

On iOS, you will need to follow the same basic pattern to read a characteristic:

  1. initialize() bluetooth
  2. connect() to device
  3. discover services() for device
  4. discover characteristics() for a service
  5. read() a characteristic

You 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"})


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.