I hereby claim:
- I am don on github.
- I am doncoleman (https://keybase.io/doncoleman) on keybase.
- I have a public key ASAHcDKLEfyv4tJbdZ2G6eO7Zk1RB8L0EUeiC8hBtIaEPQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
location / { | |
proxy_set_header X-Forwarded-Host $host:$server_port; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_pass http://localhost:8000/; | |
} |
// Print the WiFi firmware version and MAC address for MRK boards | |
// Based on https://www.arduino.cc/en/Reference/WiFiNINAMACAddress | |
// and https://forum.arduino.cc/index.php?topic=114568.msg862118#msg862118 | |
#include <SPI.h> | |
#ifdef ARDUINO_SAMD_MKR1000 | |
#include <WiFi101.h> | |
#define WIFI_LIB "WiFi101" | |
#else | |
#include <WiFiNINA.h> |
var app = { | |
initialize: function() { | |
document.addEventListener('deviceready', this.onDeviceReady.bind(this), false); | |
}, | |
onDeviceReady: function() { | |
// Auto connect whenever the device is in range | |
const MAC_ADDRESS = 'E4:86:1E:4E:5A:FB'; | |
ble.autoConnect(MAC_ADDRESS, app.onConnected, app.onDisconnected); | |
}, |
/** | |
* Convert a hex string to an ArrayBuffer. | |
* | |
* @param {string} hexString - hex representation of bytes | |
* @return {ArrayBuffer} - The bytes in an ArrayBuffer. | |
*/ | |
function hexStringToArrayBuffer(hexString) { | |
// remove the leading 0x | |
hexString = hexString.replace(/^0x/, ''); | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;"> | |
<meta name="format-detection" content="telephone=no"> | |
<meta name="msapplication-tap-highlight" content="no"> | |
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"> | |
<link rel="stylesheet" type="text/css" href="css/index.css"> | |
<title>NFC Reader</title> | |
</head> |
// Broadcast Characteristic Value | |
// Simple counter that broadcasts a value | |
// Use v2 of CurieBLE library | |
#include <CurieBLE.h> // Arduino 101 | |
uint8_t value = 0; | |
unsigned long previousMillis = 0; // will store last time counter was updated | |
unsigned short interval = 1000; // interval at which to update counter (milliseconds) |
// Mock BLE so you can run example from nodejs | |
const ble = { | |
write: function(device_id, service, characteristic, buffer, success, failure) { | |
// log to console instead of writing | |
console.log('>>', new Uint8Array(buffer)); | |
// always call success callback | |
success(); | |
} | |
} |
if (device.id !== '5F5D6C62-1414-4657-3ECA-3B34E124CE60') { // Android AA:BB:CC:DD:EE:FF | |
console.log('skipping ' + device.id); | |
return; | |
} |
PhoneGap Day NY - October 12th, 2017
In order to get the most of the class, we're asking everyone to install the software before the workshop.
It's important that you follow this guide and have you computer setup before you arrive. We want to spend time learning about Bluetooth not installing software.