microbit-web-bluetooth
Advanced tools
Comparing version 0.3.1-next.bbe94a4.0 to 0.4.1-next.c10a634.0
@@ -1,2 +0,2 @@ | ||
var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function n(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function u(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,u)}s((r=r.apply(e,t||[])).next())})}function r(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}var i,a=function(){function e(e){void 0===e&&(e=1),this.concurrent=e,this.queue=[],this.running=0}return e.prototype.pump=function(){return n(this,void 0,void 0,function(){var e,t,n;return r(this,function(r){switch(r.label){case 0:if(this.running>=this.concurrent)return[2];if(!(e=this.queue.shift()))return[2];this.running++,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.fn()];case 2:return t=r.sent(),e.resolve(t),[3,4];case 3:return n=r.sent(),e.reject(n),[3,4];case 4:return this.running--,[2,this.pump()]}})})},e.prototype.add=function(e){var t=this;return new Promise(function(n,r){return t.queue.push({fn:e,resolve:n,reject:r}),t.pump()})},e}(),o=function(){function e(e,t){this.service=e,this.emitter=t}return e.prototype.getCharacteristic=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return this.characteristics?[3,2]:(t=this,[4,this.service.getCharacteristics()]);case 1:t.characteristics=n.sent(),n.label=2;case 2:return[2,this.characteristics.find(function(t){return t.uuid===e})]}})})},e.prototype.getCharacteristicValue=function(t){return n(this,void 0,void 0,function(){var i,a=this;return r(this,function(o){switch(o.label){case 0:return[4,this.getCharacteristic(t)];case 1:if(!(i=o.sent()))throw new Error("Unable to locate characteristic");return[4,e.queue.add(function(){return n(a,void 0,void 0,function(){return r(this,function(e){return[2,i.readValue()]})})})];case 2:return[2,o.sent()]}})})},e.prototype.setCharacteristicValue=function(t,i){return n(this,void 0,void 0,function(){var a,o=this;return r(this,function(u){switch(u.label){case 0:return[4,this.getCharacteristic(t)];case 1:if(!(a=u.sent()))throw new Error("Unable to locate characteristic");return[4,e.queue.add(function(){return n(o,void 0,void 0,function(){return r(this,function(e){return[2,a.writeValue(i)]})})})];case 2:return u.sent(),[2]}})})},e.prototype.handleListener=function(t,i,a){return n(this,void 0,void 0,function(){var o,u=this;return r(this,function(s){switch(s.label){case 0:return[4,this.getCharacteristic(i)];case 1:return(o=s.sent())?[4,e.queue.add(function(){return n(u,void 0,void 0,function(){return r(this,function(e){return[2,o.startNotifications()]})})})]:[2];case 2:return s.sent(),this.emitter.on("newListener",function(i){if(!(i!==t||u.emitter.listenerCount(t)>0))return e.queue.add(function(){return n(u,void 0,void 0,function(){return r(this,function(e){return[2,o.addEventListener("characteristicvaluechanged",a)]})})})}),this.emitter.on("removeListener",function(i){if(!(i!==t||u.emitter.listenerCount(t)>0))return e.queue.add(function(){return n(u,void 0,void 0,function(){return r(this,function(e){return[2,o.removeEventListener("characteristicvaluechanged",a)]})})})}),[2]}})})},e.queue=new a,e}();!function(e){e.modelNumber="00002a24-0000-1000-8000-00805f9b34fb",e.serialNumber="00002a25-0000-1000-8000-00805f9b34fb",e.firmwareRevision="00002a26-0000-1000-8000-00805f9b34fb",e.hardwareRevision="00002a27-0000-1000-8000-00805f9b34fb",e.manufacturer="00002a29-0000-1000-8000-00805f9b34fb"}(i||(i={}));var u=function(){function e(e){this.helper=new o(e)}return e.create=function(t){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,new e(t)]})})},e.prototype.readDeviceInformation=function(){return n(this,void 0,void 0,function(){var e,t,n,a,o,u;return r(this,function(r){switch(r.label){case 0:return e={},[4,this.readStringCharacteristic(i.modelNumber)];case 1:return(t=r.sent())&&(e.modelNumber=t),[4,this.readStringCharacteristic(i.serialNumber)];case 2:return(n=r.sent())&&(e.serialNumber=n),[4,this.readStringCharacteristic(i.firmwareRevision)];case 3:return(a=r.sent())&&(e.firmwareRevision=a),[4,this.readStringCharacteristic(i.hardwareRevision)];case 4:return(o=r.sent())&&(e.hardwareRevision=o),[4,this.readStringCharacteristic(i.manufacturer)];case 5:return(u=r.sent())&&(e.manufacturer=u),[2,e]}})})},e.prototype.readStringCharacteristic=function(e){return n(this,void 0,void 0,function(){var t,n;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.helper.getCharacteristicValue(e)];case 1:return t=r.sent(),n=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),[2,String.fromCharCode.apply(null,Array.from(new Uint8Array(n)))];case 2:return r.sent(),[2,void 0];case 3:return[2]}})})},e.uuid="0000180a-0000-1000-8000-00805f9b34fb",e}();function s(){}function c(){c.init.call(this)}function h(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,a,o,u;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]):(a=e._events=new s,e._eventsCount=0),o){if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),!o.warned&&(i=h(e))&&i>0&&o.length>i){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,u=c,"function"==typeof console.warn?console.warn(u):console.log(u)}}else o=a[t]=n,++e._eventsCount;return e}function d(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function l(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function v(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}s.prototype=Object.create(null),c.EventEmitter=c,c.usingDomains=!1,c.prototype.domain=void 0,c.prototype._events=void 0,c.prototype._maxListeners=void 0,c.defaultMaxListeners=10,c.init=function(){this.domain=null,c.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new s,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},c.prototype.getMaxListeners=function(){return h(this)},c.prototype.emit=function(e){var t,n,r,i,a,o,u,s="error"===e;if(o=this._events)s=s&&null==o.error;else if(!s)return!1;if(u=this.domain,s){if(t=arguments[1],!u){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=u,t.domainThrown=!1,u.emit("error",t),!1}if(!(n=o[e]))return!1;var h="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=v(e,r),a=0;a<r;++a)i[a].call(n)}(n,h,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,a=v(e,i),o=0;o<i;++o)a[o].call(n,r)}(n,h,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var a=e.length,o=v(e,a),u=0;u<a;++u)o[u].call(n,r,i)}(n,h,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,a){if(t)e.call(n,r,i,a);else for(var o=e.length,u=v(e,o),s=0;s<o;++s)u[s].call(n,r,i,a)}(n,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),a=1;a<r;a++)i[a-1]=arguments[a];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,a=v(e,i),o=0;o<i;++o)a[o].apply(n,r)}(n,h,this,i)}return!0},c.prototype.addListener=function(e,t){return f(this,e,t,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(e,t){return f(this,e,t,!0)},c.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,d(this,e,t)),this},c.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,d(this,e,t)),this},c.prototype.removeListener=function(e,t){var n,r,i,a,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new s:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new s,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i);r.removeListener&&this.emit("removeListener",e,o||t)}return this},c.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new s,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new s:delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),a=0;a<i.length;++a)"removeListener"!==(r=i[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new s,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},c.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},c.prototype.listenerCount=l,c.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var p,m,g=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.isEventListenerObject=function(e){return void 0!==e.handleEvent},t}return t(n,e),n.prototype.addEventListener=function(t,n){if(n){var r=this.isEventListenerObject(n)?n.handleEvent:n;e.prototype.addListener.call(this,t,r)}},n.prototype.removeEventListener=function(t,n){if(n){var r=this.isEventListenerObject(n)?n.handleEvent:n;e.prototype.removeListener.call(this,t,r)}},n.prototype.dispatchEvent=function(t,n){var r;return r="string"==typeof t?new CustomEvent(t,{detail:n}):t,e.prototype.emit.call(this,r.type,r)},n}(c);!function(e){e.buttonAState="e95dda90-251d-470a-a062-fa1922dfa9a8",e.buttonBState="e95dda91-251d-470a-a062-fa1922dfa9a8"}(p||(p={})),function(e){e[e.Release=0]="Release",e[e.ShortPress=1]="ShortPress",e[e.LongPress=2]="LongPress"}(m||(m={}));var y,b=function(e){function i(t){var n=e.call(this)||this;return n.helper=new o(t,n),n}return t(i,e),i.create=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,(t=new i(e)).init()];case 1:return n.sent(),[2,t]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("buttonastatechanged",p.buttonAState,this.buttonAStateChangedHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("buttonbstatechanged",p.buttonBState,this.buttonBStateChangedHandler.bind(this))];case 2:return e.sent(),[2]}})})},i.prototype.readButtonAState=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(p.buttonAState)];case 1:return[2,e.sent().getUint8(0)]}})})},i.prototype.readButtonBState=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(p.buttonBState)];case 1:return[2,e.sent().getUint8(0)]}})})},i.prototype.buttonAStateChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("buttonastatechanged",t.getUint8(0))},i.prototype.buttonBStateChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("buttonbstatechanged",t.getUint8(0))},i.uuid="e95d9882-251d-470a-a062-fa1922dfa9a8",i}(g);!function(e){e.ledMatrixState="e95d7b77-251d-470a-a062-fa1922dfa9a8",e.ledText="e95d93ee-251d-470a-a062-fa1922dfa9a8",e.scrollingDelay="e95d0d2d-251d-470a-a062-fa1922dfa9a8"}(y||(y={}));var w,C=function(){function e(e){this.helper=new o(e)}return e.create=function(t){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,new e(t)]})})},e.prototype.writeText=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){return t=this.encodeString(e),[2,this.helper.setCharacteristicValue(y.ledText,t)]})})},e.prototype.readMatrixState=function(){return n(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(y.ledMatrixState)];case 1:return e=t.sent(),[2,this.viewToLedMatrix(e)]}})})},e.prototype.writeMatrixState=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){return t=this.ledMatrixToView(e),[2,this.helper.setCharacteristicValue(y.ledMatrixState,t)]})})},e.prototype.getScrollingDelay=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(y.scrollingDelay)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},e.prototype.setScrollingDelay=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(y.scrollingDelay,t)]})})},e.prototype.encodeString=function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return t},e.prototype.viewToLedMatrix=function(e){for(var t=[],n=0;n<5;n++)t[n]=this.byteToBoolArray(e.getUint8(n));return t},e.prototype.byteToBoolArray=function(e){for(var t=[!1,!1,!1,!1,!1],n=0;n<t.length;n++)t[n]=1==(1&e),e>>=1;return t.reverse()},e.prototype.ledMatrixToView=function(e){for(var t=new DataView(new ArrayBuffer(5)),n=0;n<5;n++)t.setUint8(n,this.boolArrayToByte(e[n]));return t},e.prototype.boolArrayToByte=function(e){return e.reduce(function(e,t){return e<<1|(t?1:0)},0)},e.uuid="e95dd91d-251d-470a-a062-fa1922dfa9a8",e}();!function(e){e.temperature="e95d9250-251d-470a-a062-fa1922dfa9a8",e.temperaturePeriod="e95d1b25-251d-470a-a062-fa1922dfa9a8"}(w||(w={}));var L,E=function(e){function i(t){var n=e.call(this)||this;return n.helper=new o(t,n),n}return t(i,e),i.create=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,(t=new i(e)).init()];case 1:return n.sent(),[2,t]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("temperaturechanged",w.temperature,this.temperatureChangedHandler.bind(this))];case 1:return e.sent(),[2]}})})},i.prototype.readTemperature=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(w.temperature)];case 1:return[2,e.sent().getInt8(0)]}})})},i.prototype.getTemperaturePeriod=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(w.temperaturePeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},i.prototype.setTemperaturePeriod=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[4,this.helper.setCharacteristicValue(w.temperaturePeriod,t)];case 1:return[2,n.sent()]}})})},i.prototype.temperatureChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("temperaturechanged",t.getInt8(0))},i.uuid="e95d6100-251d-470a-a062-fa1922dfa9a8",i}(g);!function(e){e.accelerometerData="e95dca4b-251d-470a-a062-fa1922dfa9a8",e.accelerometerPeriod="e95dfb24-251d-470a-a062-fa1922dfa9a8"}(L||(L={}));var S,x,V=function(e){function i(t){var n=e.call(this)||this;return n.helper=new o(t,n),n}return t(i,e),i.create=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,(t=new i(e)).init()];case 1:return n.sent(),[2,t]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("accelerometerdatachanged",L.accelerometerData,this.accelerometerDataChangedHandler.bind(this))];case 1:return e.sent(),[2]}})})},i.prototype.readAccelerometerData=function(){return n(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(L.accelerometerData)];case 1:return e=t.sent(),[2,this.dataViewToAccelerometerData(e)]}})})},i.prototype.getAccelerometerPeriod=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(L.accelerometerPeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},i.prototype.setAccelerometerPeriod=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(L.accelerometerPeriod,t)]})})},i.prototype.accelerometerDataChangedHandler=function(e){var t=e.target.value,n=this.dataViewToAccelerometerData(t);this.dispatchEvent("accelerometerdatachanged",n)},i.prototype.dataViewToAccelerometerData=function(e){return{x:e.getInt16(0,!0)/1e3,y:e.getInt16(2,!0)/1e3,z:e.getInt16(4,!0)/1e3}},i.uuid="e95d0753-251d-470a-a062-fa1922dfa9a8",i}(g);!function(e){e.magnetometerData="e95dfb11-251d-470a-a062-fa1922dfa9a8",e.magnetometerPeriod="e95d386c-251d-470a-a062-fa1922dfa9a8",e.magnetometerBearing="e95d9715-251d-470a-a062-fa1922dfa9a8",e.magnetometerCalibration="e95db358-251d-470a-a062-fa1922dfa9a8"}(S||(S={})),function(e){e[e.unknown=0]="unknown",e[e.requested=1]="requested",e[e.completed=2]="completed",e[e.errored=3]="errored"}(x||(x={}));var A,_=function(e){function i(t){var n=e.call(this)||this;return n.helper=new o(t,n),n}return t(i,e),i.create=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,(t=new i(e)).init()];case 1:return n.sent(),[2,t]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("magnetometerdatachanged",S.magnetometerData,this.magnetometerDataChangedHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("magnetometerbearingchanged",S.magnetometerBearing,this.magnetometerBearingChangedHandler.bind(this))];case 2:return e.sent(),[4,this.helper.handleListener("magnetometercalibrationchanged",S.magnetometerCalibration,this.magnetometerCalibrationChangedHandler.bind(this))];case 3:return e.sent(),[2]}})})},i.prototype.calibrate=function(){return n(this,void 0,void 0,function(){return r(this,function(e){return[2,this.helper.setCharacteristicValue(S.magnetometerCalibration,new Uint8Array([1]))]})})},i.prototype.readMagnetometerData=function(){return n(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(S.magnetometerData)];case 1:return e=t.sent(),[2,this.dataViewToMagnetometerData(e)]}})})},i.prototype.readMagnetometerBearing=function(){return n(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(S.magnetometerBearing)];case 1:return 2===(e=t.sent()).byteLength?[2,e.getUint16(0,!0)]:[2,void 0]}})})},i.prototype.getMagnetometerPeriod=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(S.magnetometerPeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},i.prototype.setMagnetometerPeriod=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(S.magnetometerPeriod,t)]})})},i.prototype.magnetometerDataChangedHandler=function(e){var t=e.target.value,n=this.dataViewToMagnetometerData(t);this.dispatchEvent("magnetometerdatachanged",n)},i.prototype.magnetometerBearingChangedHandler=function(e){var t=e.target.value;2===t.byteLength&&this.dispatchEvent("magnetometerbearingchanged",t.getUint16(0,!0))},i.prototype.magnetometerCalibrationChangedHandler=function(e){var t=e.target.value;1===t.byteLength&&this.dispatchEvent("magnetometercalibrationchanged",t.getUint8(0))},i.prototype.dataViewToMagnetometerData=function(e){return{x:e.getInt16(0,!0),y:e.getInt16(1,!0),z:e.getInt16(2,!0)}},i.uuid="e95df2d8-251d-470a-a062-fa1922dfa9a8",i}(g);!function(e){e.pinData="e95d8d00-251d-470a-a062-fa1922dfa9a8",e.pinAdConfiguration="e95d5899-251d-470a-a062-fa1922dfa9a8",e.pinIoConfiguration="e95db9fe-251d-470a-a062-fa1922dfa9a8",e.pwmControl="e95dd822-251d-470a-a062-fa1922dfa9a8"}(A||(A={}));var T,D=function(){function e(e){this.helper=new o(e)}return e.create=function(t){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,new e(t)]})})},e.uuid="e95d127b-251d-470a-a062-fa1922dfa9a8",e}();!function(e){e.tx="6e400002-b5a3-f393-e0a9-e50e24dcca9e",e.rx="6e400003-b5a3-f393-e0a9-e50e24dcca9e"}(T||(T={}));var B,U=function(e){function i(t){var n=e.call(this)||this;return n.helper=new o(t,n),n}return t(i,e),i.create=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,(t=new i(e)).init()];case 1:return n.sent(),[2,t]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("receive",T.tx,this.receiveHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("receiveText",T.tx,this.receiveTextHandler.bind(this))];case 2:return e.sent(),[2]}})})},i.prototype.send=function(e){return n(this,void 0,void 0,function(){return r(this,function(t){return[2,this.helper.setCharacteristicValue(T.rx,e)]})})},i.prototype.sendText=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){return t=e.split("").map(function(e){return e.charCodeAt(0)}),[2,this.helper.setCharacteristicValue(T.rx,new Uint8Array(t).buffer)]})})},i.prototype.receiveHandler=function(e){var t=e.target.value,n=new Uint8Array(t.buffer);this.dispatchEvent("receive",n)},i.prototype.receiveTextHandler=function(e){var t=e.target.value,n=Array.prototype.slice.call(new Uint8Array(t.buffer)),r=String.fromCharCode.apply(null,n);this.dispatchEvent("receiveText",r)},i.uuid="6e400001-b5a3-f393-e0a9-e50e24dcca9e",i}(g);!function(e){e.microBitRequirements="e95db84c-251d-470a-a062-fa1922dfa9a8",e.microBitEvent="e95d9775-251d-470a-a062-fa1922dfa9a8",e.clientRequirements="e95d23c4-251d-470a-a062-fa1922dfa9a8",e.clientEvent="e95d5404-251d-470a-a062-fa1922dfa9a8"}(B||(B={}));var M,P=function(e){function i(t){var n=e.call(this)||this;return n.helper=new o(t,n),n}return t(i,e),i.create=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return[4,(t=new i(e)).init()];case 1:return n.sent(),[2,t]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("microbitevent",B.microBitEvent,this.eventHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("microbitrequirementschanged",B.microBitRequirements,this.microbitRequirementsChangedHandler.bind(this))];case 2:return e.sent(),[2]}})})},i.prototype.getMicrobitRequirements=function(){return n(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(B.microBitRequirements)];case 1:return e=t.sent(),[2,this.viewToMicrobitEvent(e)]}})})},i.prototype.setClientRequirements=function(e,t){return n(this,void 0,void 0,function(){var n;return r(this,function(r){switch(r.label){case 0:return(n=new DataView(new ArrayBuffer(4))).setUint16(0,e,!0),n.setUint16(1,t,!0),[4,this.helper.setCharacteristicValue(B.clientRequirements,n)];case 1:return[2,r.sent()]}})})},i.prototype.readMicrobitEvent=function(){return n(this,void 0,void 0,function(){var e;return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(B.microBitEvent)];case 1:return e=t.sent(),[2,this.viewToMicrobitEvent(e)]}})})},i.prototype.writeClientEvent=function(e,t){return n(this,void 0,void 0,function(){var n;return r(this,function(r){switch(r.label){case 0:return(n=new DataView(new ArrayBuffer(4))).setUint16(0,e,!0),n.setUint16(1,t,!0),[4,this.helper.setCharacteristicValue(B.clientEvent,n)];case 1:return[2,r.sent()]}})})},i.prototype.microbitRequirementsChangedHandler=function(e){var t=e.target.value,n=this.viewToMicrobitEvent(t);this.dispatchEvent("microbitrequirementschanged",n)},i.prototype.eventHandler=function(e){var t=e.target.value,n=this.viewToMicrobitEvent(t);this.dispatchEvent("microbitevent",n)},i.prototype.viewToMicrobitEvent=function(e){return{type:e.getUint16(0,!0),value:e.getUint16(1,!0)}},i.uuid="e95d93af-251d-470a-a062-fa1922dfa9a8",i}(g);!function(e){e.dfuControl="e95d93b1-251d-470a-a062-fa1922dfa9a8"}(M||(M={}));var q=function(){function e(e){this.helper=new o(e)}return e.create=function(t){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,new e(t)]})})},e.uuid="e95d93b0-251d-470a-a062-fa1922dfa9a8",e}(),H=function(){function e(e){this.services=e}return e.prototype.createService=function(e){return n(this,void 0,void 0,function(){var t;return r(this,function(n){switch(n.label){case 0:return(t=this.services.find(function(t){return t.uuid===e.uuid}))?[4,e.create(t)]:[2,void 0];case 1:return[2,n.sent()]}})})},e}(),R=function(e){return n(void 0,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,e.requestDevice({filters:[{namePrefix:"BBC micro:bit"}],optionalServices:[u.uuid,b.uuid,C.uuid,E.uuid,V.uuid,_.uuid,D.uuid,U.uuid,P.uuid,q.uuid]})];case 1:return[2,t.sent()]}})})},O=function(e){return n(void 0,void 0,void 0,function(){var t,n,i,a,o,s,c,h,f,d;return r(this,function(r){switch(r.label){case 0:return e&&e.gatt?e.gatt.connected?[3,2]:[4,e.gatt.connect()]:[2,{}];case 1:r.sent(),r.label=2;case 2:return[4,e.gatt.getPrimaryServices()];case 3:return t=r.sent(),[4,(n=new H(t)).createService(u)];case 4:return i=r.sent(),[4,n.createService(b)];case 5:return a=r.sent(),[4,n.createService(C)];case 6:return o=r.sent(),[4,n.createService(E)];case 7:return s=r.sent(),[4,n.createService(V)];case 8:return c=r.sent(),[4,n.createService(_)];case 9:return h=r.sent(),[4,n.createService(U)];case 10:return f=r.sent(),[4,n.createService(P)];case 11:return d=r.sent(),[2,{deviceInformationService:i,buttonService:a,ledService:o,temperatureService:s,accelerometerService:c,magnetometerService:h,uartService:f,eventService:d}]}})})};export{O as getServices,R as requestMicrobit}; | ||
var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};function e(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function n(t,e,n,r){return new(n||(n=Promise))(function(i,a){function o(t){try{s(r.next(t))}catch(t){a(t)}}function u(t){try{s(r.throw(t))}catch(t){a(t)}}function s(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(o,u)}s((r=r.apply(t,e||[])).next())})}function r(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}var i,a=function(){function t(t){void 0===t&&(t=1),this.concurrent=t,this.queue=[],this.running=0}return t.prototype.pump=function(){return n(this,void 0,void 0,function(){var t,e,n;return r(this,function(r){switch(r.label){case 0:if(this.running>=this.concurrent)return[2];if(!(t=this.queue.shift()))return[2];this.running++,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,t.fn()];case 2:return e=r.sent(),t.resolve(e),[3,4];case 3:return n=r.sent(),t.reject(n),[3,4];case 4:return this.running--,[2,this.pump()]}})})},t.prototype.add=function(t){var e=this;return new Promise(function(n,r){return e.queue.push({fn:t,resolve:n,reject:r}),e.pump()})},t}(),o=function(){function t(t,e){this.service=t,this.emitter=e}return t.prototype.getCharacteristic=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return this.characteristics?[3,2]:(e=this,[4,this.service.getCharacteristics()]);case 1:e.characteristics=n.sent(),n.label=2;case 2:return[2,this.characteristics.find(function(e){return e.uuid===t})]}})})},t.prototype.getCharacteristicValue=function(e){return n(this,void 0,void 0,function(){var i,a=this;return r(this,function(o){switch(o.label){case 0:return[4,this.getCharacteristic(e)];case 1:if(!(i=o.sent()))throw new Error("Unable to locate characteristic");return[4,t.queue.add(function(){return n(a,void 0,void 0,function(){return r(this,function(t){return[2,i.readValue()]})})})];case 2:return[2,o.sent()]}})})},t.prototype.setCharacteristicValue=function(e,i){return n(this,void 0,void 0,function(){var a,o=this;return r(this,function(u){switch(u.label){case 0:return[4,this.getCharacteristic(e)];case 1:if(!(a=u.sent()))throw new Error("Unable to locate characteristic");return[4,t.queue.add(function(){return n(o,void 0,void 0,function(){return r(this,function(t){return[2,a.writeValue(i)]})})})];case 2:return u.sent(),[2]}})})},t.prototype.handleListener=function(e,i,a){return n(this,void 0,void 0,function(){var o,u=this;return r(this,function(s){switch(s.label){case 0:return[4,this.getCharacteristic(i)];case 1:return(o=s.sent())?[4,t.queue.add(function(){return n(u,void 0,void 0,function(){return r(this,function(t){return[2,o.startNotifications()]})})})]:[2];case 2:return s.sent(),this.emitter.on("newListener",function(i){if(!(i!==e||u.emitter.listenerCount(e)>0))return t.queue.add(function(){return n(u,void 0,void 0,function(){return r(this,function(t){return[2,o.addEventListener("characteristicvaluechanged",a)]})})})}),this.emitter.on("removeListener",function(i){if(!(i!==e||u.emitter.listenerCount(e)>0))return t.queue.add(function(){return n(u,void 0,void 0,function(){return r(this,function(t){return[2,o.removeEventListener("characteristicvaluechanged",a)]})})})}),[2]}})})},t.queue=new a,t}();!function(t){t.modelNumber="00002a24-0000-1000-8000-00805f9b34fb",t.serialNumber="00002a25-0000-1000-8000-00805f9b34fb",t.firmwareRevision="00002a26-0000-1000-8000-00805f9b34fb",t.hardwareRevision="00002a27-0000-1000-8000-00805f9b34fb",t.manufacturer="00002a29-0000-1000-8000-00805f9b34fb"}(i||(i={}));var u=function(){function t(t){this.helper=new o(t)}return t.create=function(e){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,new t(e)]})})},t.prototype.readDeviceInformation=function(){return n(this,void 0,void 0,function(){var t,e,n,a,o,u;return r(this,function(r){switch(r.label){case 0:return t={},[4,this.readStringCharacteristic(i.modelNumber)];case 1:return(e=r.sent())&&(t.modelNumber=e),[4,this.readStringCharacteristic(i.serialNumber)];case 2:return(n=r.sent())&&(t.serialNumber=n),[4,this.readStringCharacteristic(i.firmwareRevision)];case 3:return(a=r.sent())&&(t.firmwareRevision=a),[4,this.readStringCharacteristic(i.hardwareRevision)];case 4:return(o=r.sent())&&(t.hardwareRevision=o),[4,this.readStringCharacteristic(i.manufacturer)];case 5:return(u=r.sent())&&(t.manufacturer=u),[2,t]}})})},t.prototype.readStringCharacteristic=function(t){return n(this,void 0,void 0,function(){var e,n;return r(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.helper.getCharacteristicValue(t)];case 1:return e=r.sent(),n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),[2,String.fromCharCode.apply(null,Array.from(new Uint8Array(n)))];case 2:return r.sent(),[2,void 0];case 3:return[2]}})})},t.uuid="0000180a-0000-1000-8000-00805f9b34fb",t}();function s(){}function c(){c.init.call(this)}function h(t){return void 0===t._maxListeners?c.defaultMaxListeners:t._maxListeners}function f(t,e,n,r){var i,a,o,u;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),a=t._events),o=a[e]):(a=t._events=new s,t._eventsCount=0),o){if("function"==typeof o?o=a[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),!o.warned&&(i=h(t))&&i>0&&o.length>i){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,u=c,"function"==typeof console.warn?console.warn(u):console.log(u)}}else o=a[e]=n,++t._eventsCount;return t}function d(t,e,n){var r=!1;function i(){t.removeListener(e,i),r||(r=!0,n.apply(t,arguments))}return i.listener=n,i}function l(t){var e=this._events;if(e){var n=e[t];if("function"==typeof n)return 1;if(n)return n.length}return 0}function v(t,e){for(var n=new Array(e);e--;)n[e]=t[e];return n}s.prototype=Object.create(null),c.EventEmitter=c,c.usingDomains=!1,c.prototype.domain=void 0,c.prototype._events=void 0,c.prototype._maxListeners=void 0,c.defaultMaxListeners=10,c.init=function(){this.domain=null,c.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new s,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},c.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},c.prototype.getMaxListeners=function(){return h(this)},c.prototype.emit=function(t){var e,n,r,i,a,o,u,s="error"===t;if(o=this._events)s=s&&null==o.error;else if(!s)return!1;if(u=this.domain,s){if(e=arguments[1],!u){if(e instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}return e||(e=new Error('Uncaught, unspecified "error" event')),e.domainEmitter=this,e.domain=u,e.domainThrown=!1,u.emit("error",e),!1}if(!(n=o[t]))return!1;var h="function"==typeof n;switch(r=arguments.length){case 1:!function(t,e,n){if(e)t.call(n);else for(var r=t.length,i=v(t,r),a=0;a<r;++a)i[a].call(n)}(n,h,this);break;case 2:!function(t,e,n,r){if(e)t.call(n,r);else for(var i=t.length,a=v(t,i),o=0;o<i;++o)a[o].call(n,r)}(n,h,this,arguments[1]);break;case 3:!function(t,e,n,r,i){if(e)t.call(n,r,i);else for(var a=t.length,o=v(t,a),u=0;u<a;++u)o[u].call(n,r,i)}(n,h,this,arguments[1],arguments[2]);break;case 4:!function(t,e,n,r,i,a){if(e)t.call(n,r,i,a);else for(var o=t.length,u=v(t,o),s=0;s<o;++s)u[s].call(n,r,i,a)}(n,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),a=1;a<r;a++)i[a-1]=arguments[a];!function(t,e,n,r){if(e)t.apply(n,r);else for(var i=t.length,a=v(t,i),o=0;o<i;++o)a[o].apply(n,r)}(n,h,this,i)}return!0},c.prototype.addListener=function(t,e){return f(this,t,e,!1)},c.prototype.on=c.prototype.addListener,c.prototype.prependListener=function(t,e){return f(this,t,e,!0)},c.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,d(this,t,e)),this},c.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,d(this,t,e)),this},c.prototype.removeListener=function(t,e){var n,r,i,a,o;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[t]))return this;if(n===e||n.listener&&n.listener===e)0==--this._eventsCount?this._events=new s:(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,a=n.length;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){o=n[a].listener,i=a;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new s,this;delete r[t]}else!function(t,e){for(var n=e,r=n+1,i=t.length;r<i;n+=1,r+=1)t[n]=t[r];t.pop()}(n,i);r.removeListener&&this.emit("removeListener",t,o||e)}return this},c.prototype.removeAllListeners=function(t){var e,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new s,this._eventsCount=0):n[t]&&(0==--this._eventsCount?this._events=new s:delete n[t]),this;if(0===arguments.length){for(var r,i=Object.keys(n),a=0;a<i.length;++a)"removeListener"!==(r=i[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new s,this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(e)do{this.removeListener(t,e[e.length-1])}while(e[0]);return this},c.prototype.listeners=function(t){var e,n=this._events;return n&&(e=n[t])?"function"==typeof e?[e.listener||e]:function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(e):[]},c.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):l.call(t,e)},c.prototype.listenerCount=l,c.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var p,g,m=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isEventListenerObject=function(t){return void 0!==t.handleEvent},e}return e(n,t),n.prototype.addEventListener=function(e,n){if(n){var r=this.isEventListenerObject(n)?n.handleEvent:n;t.prototype.addListener.call(this,e,r)}},n.prototype.removeEventListener=function(e,n){if(n){var r=this.isEventListenerObject(n)?n.handleEvent:n;t.prototype.removeListener.call(this,e,r)}},n.prototype.dispatchEvent=function(e,n){var r;return r="string"==typeof e?new CustomEvent(e,{detail:n}):e,t.prototype.emit.call(this,r.type,r)},n}(c);!function(t){t.buttonAState="e95dda90-251d-470a-a062-fa1922dfa9a8",t.buttonBState="e95dda91-251d-470a-a062-fa1922dfa9a8"}(p||(p={})),function(t){t[t.Release=0]="Release",t[t.ShortPress=1]="ShortPress",t[t.LongPress=2]="LongPress"}(g||(g={}));var w,y=function(t){function i(e){var n=t.call(this)||this;return n.helper=new o(e,n),n}return e(i,t),i.create=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return[4,(e=new i(t)).init()];case 1:return n.sent(),[2,e]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.handleListener("buttonastatechanged",p.buttonAState,this.buttonAStateChangedHandler.bind(this))];case 1:return t.sent(),[4,this.helper.handleListener("buttonbstatechanged",p.buttonBState,this.buttonBStateChangedHandler.bind(this))];case 2:return t.sent(),[2]}})})},i.prototype.readButtonAState=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(p.buttonAState)];case 1:return[2,t.sent().getUint8(0)]}})})},i.prototype.readButtonBState=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(p.buttonBState)];case 1:return[2,t.sent().getUint8(0)]}})})},i.prototype.buttonAStateChangedHandler=function(t){var e=t.target.value;this.dispatchEvent("buttonastatechanged",e.getUint8(0))},i.prototype.buttonBStateChangedHandler=function(t){var e=t.target.value;this.dispatchEvent("buttonbstatechanged",e.getUint8(0))},i.uuid="e95d9882-251d-470a-a062-fa1922dfa9a8",i}(m);!function(t){t.ledMatrixState="e95d7b77-251d-470a-a062-fa1922dfa9a8",t.ledText="e95d93ee-251d-470a-a062-fa1922dfa9a8",t.scrollingDelay="e95d0d2d-251d-470a-a062-fa1922dfa9a8"}(w||(w={}));var b,C=function(){function t(t){this.helper=new o(t)}return t.create=function(e){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,new t(e)]})})},t.prototype.writeText=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return e=this.encodeString(t),[2,this.helper.setCharacteristicValue(w.ledText,e)]})})},t.prototype.readMatrixState=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(w.ledMatrixState)];case 1:return t=e.sent(),[2,this.viewToLedMatrix(t)]}})})},t.prototype.writeMatrixState=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return e=this.ledMatrixToView(t),[2,this.helper.setCharacteristicValue(w.ledMatrixState,e)]})})},t.prototype.getScrollingDelay=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(w.scrollingDelay)];case 1:return[2,t.sent().getUint16(0,!0)]}})})},t.prototype.setScrollingDelay=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return(e=new DataView(new ArrayBuffer(2))).setUint16(0,t,!0),[2,this.helper.setCharacteristicValue(w.scrollingDelay,e)]})})},t.prototype.encodeString=function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return e},t.prototype.viewToLedMatrix=function(t){for(var e=[],n=0;n<5;n++)e[n]=this.byteToBoolArray(t.getUint8(n));return e},t.prototype.byteToBoolArray=function(t){for(var e=[!1,!1,!1,!1,!1],n=0;n<e.length;n++)e[n]=1==(1&t),t>>=1;return e.reverse()},t.prototype.ledMatrixToView=function(t){for(var e=new DataView(new ArrayBuffer(5)),n=0;n<5;n++)e.setUint8(n,this.boolArrayToByte(t[n]));return e},t.prototype.boolArrayToByte=function(t){return t.reduce(function(t,e){return t<<1|(e?1:0)},0)},t.uuid="e95dd91d-251d-470a-a062-fa1922dfa9a8",t}();!function(t){t.temperature="e95d9250-251d-470a-a062-fa1922dfa9a8",t.temperaturePeriod="e95d1b25-251d-470a-a062-fa1922dfa9a8"}(b||(b={}));var V,L=function(t){function i(e){var n=t.call(this)||this;return n.helper=new o(e,n),n}return e(i,t),i.create=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return[4,(e=new i(t)).init()];case 1:return n.sent(),[2,e]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.handleListener("temperaturechanged",b.temperature,this.temperatureChangedHandler.bind(this))];case 1:return t.sent(),[2]}})})},i.prototype.readTemperature=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(b.temperature)];case 1:return[2,t.sent().getInt8(0)]}})})},i.prototype.getTemperaturePeriod=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(b.temperaturePeriod)];case 1:return[2,t.sent().getUint16(0,!0)]}})})},i.prototype.setTemperaturePeriod=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return(e=new DataView(new ArrayBuffer(2))).setUint16(0,t,!0),[4,this.helper.setCharacteristicValue(b.temperaturePeriod,e)];case 1:return[2,n.sent()]}})})},i.prototype.temperatureChangedHandler=function(t){var e=t.target.value;this.dispatchEvent("temperaturechanged",e.getInt8(0))},i.uuid="e95d6100-251d-470a-a062-fa1922dfa9a8",i}(m);!function(t){t.accelerometerData="e95dca4b-251d-470a-a062-fa1922dfa9a8",t.accelerometerPeriod="e95dfb24-251d-470a-a062-fa1922dfa9a8"}(V||(V={}));var D,S,E=function(t){function i(e){var n=t.call(this)||this;return n.helper=new o(e,n),n}return e(i,t),i.create=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return[4,(e=new i(t)).init()];case 1:return n.sent(),[2,e]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.handleListener("accelerometerdatachanged",V.accelerometerData,this.accelerometerDataChangedHandler.bind(this))];case 1:return t.sent(),[2]}})})},i.prototype.readAccelerometerData=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(V.accelerometerData)];case 1:return t=e.sent(),[2,this.dataViewToAccelerometerData(t)]}})})},i.prototype.getAccelerometerPeriod=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(V.accelerometerPeriod)];case 1:return[2,t.sent().getUint16(0,!0)]}})})},i.prototype.setAccelerometerPeriod=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return(e=new DataView(new ArrayBuffer(2))).setUint16(0,t,!0),[2,this.helper.setCharacteristicValue(V.accelerometerPeriod,e)]})})},i.prototype.accelerometerDataChangedHandler=function(t){var e=t.target.value,n=this.dataViewToAccelerometerData(e);this.dispatchEvent("accelerometerdatachanged",n)},i.prototype.dataViewToAccelerometerData=function(t){return{x:t.getInt16(0,!0)/1e3,y:t.getInt16(2,!0)/1e3,z:t.getInt16(4,!0)/1e3}},i.uuid="e95d0753-251d-470a-a062-fa1922dfa9a8",i}(m);!function(t){t.magnetometerData="e95dfb11-251d-470a-a062-fa1922dfa9a8",t.magnetometerPeriod="e95d386c-251d-470a-a062-fa1922dfa9a8",t.magnetometerBearing="e95d9715-251d-470a-a062-fa1922dfa9a8",t.magnetometerCalibration="e95db358-251d-470a-a062-fa1922dfa9a8"}(D||(D={})),function(t){t[t.unknown=0]="unknown",t[t.requested=1]="requested",t[t.completed=2]="completed",t[t.errored=3]="errored"}(S||(S={}));var A,T,U,x=function(t){function i(e){var n=t.call(this)||this;return n.helper=new o(e,n),n}return e(i,t),i.create=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return[4,(e=new i(t)).init()];case 1:return n.sent(),[2,e]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.handleListener("magnetometerdatachanged",D.magnetometerData,this.magnetometerDataChangedHandler.bind(this))];case 1:return t.sent(),[4,this.helper.handleListener("magnetometerbearingchanged",D.magnetometerBearing,this.magnetometerBearingChangedHandler.bind(this))];case 2:return t.sent(),[4,this.helper.handleListener("magnetometercalibrationchanged",D.magnetometerCalibration,this.magnetometerCalibrationChangedHandler.bind(this))];case 3:return t.sent(),[2]}})})},i.prototype.calibrate=function(){return n(this,void 0,void 0,function(){return r(this,function(t){return[2,this.helper.setCharacteristicValue(D.magnetometerCalibration,new Uint8Array([1]))]})})},i.prototype.readMagnetometerData=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(D.magnetometerData)];case 1:return t=e.sent(),[2,this.dataViewToMagnetometerData(t)]}})})},i.prototype.readMagnetometerBearing=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(D.magnetometerBearing)];case 1:return 2===(t=e.sent()).byteLength?[2,t.getUint16(0,!0)]:[2,void 0]}})})},i.prototype.getMagnetometerPeriod=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(D.magnetometerPeriod)];case 1:return[2,t.sent().getUint16(0,!0)]}})})},i.prototype.setMagnetometerPeriod=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return(e=new DataView(new ArrayBuffer(2))).setUint16(0,t,!0),[2,this.helper.setCharacteristicValue(D.magnetometerPeriod,e)]})})},i.prototype.magnetometerDataChangedHandler=function(t){var e=t.target.value,n=this.dataViewToMagnetometerData(e);this.dispatchEvent("magnetometerdatachanged",n)},i.prototype.magnetometerBearingChangedHandler=function(t){var e=t.target.value;2===e.byteLength&&this.dispatchEvent("magnetometerbearingchanged",e.getUint16(0,!0))},i.prototype.magnetometerCalibrationChangedHandler=function(t){var e=t.target.value;1===e.byteLength&&this.dispatchEvent("magnetometercalibrationchanged",e.getUint8(0))},i.prototype.dataViewToMagnetometerData=function(t){return{x:t.getInt16(0,!0),y:t.getInt16(1,!0),z:t.getInt16(2,!0)}},i.uuid="e95df2d8-251d-470a-a062-fa1922dfa9a8",i}(m);!function(t){t.pinData="e95d8d00-251d-470a-a062-fa1922dfa9a8",t.pinAdConfiguration="e95d5899-251d-470a-a062-fa1922dfa9a8",t.pinIoConfiguration="e95db9fe-251d-470a-a062-fa1922dfa9a8",t.pwmControl="e95dd822-251d-470a-a062-fa1922dfa9a8"}(A||(A={})),function(t){t[t.Digital=0]="Digital",t[t.Analogue=1]="Analogue"}(T||(T={})),function(t){t[t.Output=0]="Output",t[t.Input=1]="Input"}(U||(U={}));var _,B=function(t){function i(e){var n=t.call(this)||this;return n.helper=new o(e,n),n}return e(i,t),i.create=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return[4,(e=new i(t)).init()];case 1:return n.sent(),[2,e]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.handleListener("pindatachanged",A.pinData,this.pinDataChangedHandler.bind(this))];case 1:return t.sent(),[2]}})})},i.prototype.readPinData=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(A.pinData)];case 1:return t=e.sent(),[2,this.dataViewToPinData(t)]}})})},i.prototype.writePinData=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return e=this.pinDataToDataView(t),[2,this.helper.setCharacteristicValue(A.pinData,e)]})})},i.prototype.getAdConfiguration=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(A.pinAdConfiguration)];case 1:return t=e.sent(),[2,this.dataViewToConfig(t)]}})})},i.prototype.setAdConfiguration=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return e=this.configToDataView(t),[2,this.helper.setCharacteristicValue(A.pinAdConfiguration,e)]})})},i.prototype.getIoConfiguration=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(A.pinIoConfiguration)];case 1:return t=e.sent(),[2,this.dataViewToConfig(t)]}})})},i.prototype.setIoConfiguration=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return e=this.configToDataView(t),[2,this.helper.setCharacteristicValue(A.pinIoConfiguration,e)]})})},i.prototype.setPwmControl=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return e=this.pwmControlDataToDataView(t),[2,this.helper.setCharacteristicValue(A.pwmControl,e)]})})},i.prototype.pinDataChangedHandler=function(t){var e=t.target.value,n=this.dataViewToPinData(e);this.dispatchEvent("pindatachanged",n)},i.prototype.dataViewToPinData=function(t){for(var e=[],n=0;n<t.byteLength;n+=2)e.push({pin:t.getUint8(n),value:t.getUint8(n+1)});return e},i.prototype.pinDataToDataView=function(t){var e=new DataView(new ArrayBuffer(2*t.length));return t.forEach(function(t,n){e.setUint8(2*n,t.pin),e.setUint8(2*n+1,t.value)}),e},i.prototype.dataViewToConfig=function(t){for(var e=[],n=(t.getUint16(0)<<8)+t.getUint8(2),r=0;r<24;r++)e.push(n>>r);return e},i.prototype.configToDataView=function(t){for(var e=new DataView(new ArrayBuffer(3)),n=0,r=0;r<t.length;r++)n&=1<<t[r];return e.setUint16(0,n>>8),e.setUint8(2,255&n),e},i.prototype.pwmControlDataToDataView=function(t){var e=new DataView(new ArrayBuffer(7));return e.setUint8(0,t.pin),e.setUint16(1,t.value),e.setUint32(3,t.period),e},i.uuid="e95d127b-251d-470a-a062-fa1922dfa9a8",i}(m);!function(t){t.tx="6e400002-b5a3-f393-e0a9-e50e24dcca9e",t.rx="6e400003-b5a3-f393-e0a9-e50e24dcca9e"}(_||(_={}));var P,M=function(t){function i(e){var n=t.call(this)||this;return n.helper=new o(e,n),n}return e(i,t),i.create=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return[4,(e=new i(t)).init()];case 1:return n.sent(),[2,e]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.handleListener("receive",_.tx,this.receiveHandler.bind(this))];case 1:return t.sent(),[4,this.helper.handleListener("receiveText",_.tx,this.receiveTextHandler.bind(this))];case 2:return t.sent(),[2]}})})},i.prototype.send=function(t){return n(this,void 0,void 0,function(){return r(this,function(e){return[2,this.helper.setCharacteristicValue(_.rx,t)]})})},i.prototype.sendText=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){return e=t.split("").map(function(t){return t.charCodeAt(0)}),[2,this.helper.setCharacteristicValue(_.rx,new Uint8Array(e).buffer)]})})},i.prototype.receiveHandler=function(t){var e=t.target.value,n=new Uint8Array(e.buffer);this.dispatchEvent("receive",n)},i.prototype.receiveTextHandler=function(t){var e=t.target.value,n=Array.prototype.slice.call(new Uint8Array(e.buffer)),r=String.fromCharCode.apply(null,n);this.dispatchEvent("receiveText",r)},i.uuid="6e400001-b5a3-f393-e0a9-e50e24dcca9e",i}(m);!function(t){t.microBitRequirements="e95db84c-251d-470a-a062-fa1922dfa9a8",t.microBitEvent="e95d9775-251d-470a-a062-fa1922dfa9a8",t.clientRequirements="e95d23c4-251d-470a-a062-fa1922dfa9a8",t.clientEvent="e95d5404-251d-470a-a062-fa1922dfa9a8"}(P||(P={}));var q,H=function(t){function i(e){var n=t.call(this)||this;return n.helper=new o(e,n),n}return e(i,t),i.create=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return[4,(e=new i(t)).init()];case 1:return n.sent(),[2,e]}})})},i.prototype.init=function(){return n(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,this.helper.handleListener("microbitevent",P.microBitEvent,this.eventHandler.bind(this))];case 1:return t.sent(),[4,this.helper.handleListener("microbitrequirementschanged",P.microBitRequirements,this.microbitRequirementsChangedHandler.bind(this))];case 2:return t.sent(),[2]}})})},i.prototype.getMicrobitRequirements=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(P.microBitRequirements)];case 1:return t=e.sent(),[2,this.viewToMicrobitEvent(t)]}})})},i.prototype.setClientRequirements=function(t,e){return n(this,void 0,void 0,function(){var n;return r(this,function(r){switch(r.label){case 0:return(n=new DataView(new ArrayBuffer(4))).setUint16(0,t,!0),n.setUint16(1,e,!0),[4,this.helper.setCharacteristicValue(P.clientRequirements,n)];case 1:return[2,r.sent()]}})})},i.prototype.readMicrobitEvent=function(){return n(this,void 0,void 0,function(){var t;return r(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(P.microBitEvent)];case 1:return t=e.sent(),[2,this.viewToMicrobitEvent(t)]}})})},i.prototype.writeClientEvent=function(t,e){return n(this,void 0,void 0,function(){var n;return r(this,function(r){switch(r.label){case 0:return(n=new DataView(new ArrayBuffer(4))).setUint16(0,t,!0),n.setUint16(1,e,!0),[4,this.helper.setCharacteristicValue(P.clientEvent,n)];case 1:return[2,r.sent()]}})})},i.prototype.microbitRequirementsChangedHandler=function(t){var e=t.target.value,n=this.viewToMicrobitEvent(e);this.dispatchEvent("microbitrequirementschanged",n)},i.prototype.eventHandler=function(t){var e=t.target.value,n=this.viewToMicrobitEvent(e);this.dispatchEvent("microbitevent",n)},i.prototype.viewToMicrobitEvent=function(t){return{type:t.getUint16(0,!0),value:t.getUint16(1,!0)}},i.uuid="e95d93af-251d-470a-a062-fa1922dfa9a8",i}(m);!function(t){t.dfuControl="e95d93b1-251d-470a-a062-fa1922dfa9a8"}(q||(q={}));var R=function(){function t(t){this.helper=new o(t)}return t.create=function(e){return n(this,void 0,void 0,function(){return r(this,function(n){return[2,new t(e)]})})},t.prototype.requestDfu=function(){return this.helper.setCharacteristicValue(q.dfuControl,new Uint8Array([1]))},t.prototype.requestFlashCode=function(){return this.helper.setCharacteristicValue(q.dfuControl,new Uint8Array([2]))},t.uuid="e95d93b0-251d-470a-a062-fa1922dfa9a8",t}(),I=function(){function t(t){this.services=t}return t.prototype.createService=function(t){return n(this,void 0,void 0,function(){var e;return r(this,function(n){switch(n.label){case 0:return(e=this.services.find(function(e){return e.uuid===t.uuid}))?[4,t.create(e)]:[2,void 0];case 1:return[2,n.sent()]}})})},t}(),O=function(t){return n(void 0,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,t.requestDevice({filters:[{namePrefix:"BBC micro:bit"}],optionalServices:[u.uuid,y.uuid,C.uuid,L.uuid,E.uuid,x.uuid,B.uuid,M.uuid,H.uuid,R.uuid]})];case 1:return[2,e.sent()]}})})},k=function(t){return n(void 0,void 0,void 0,function(){var e,n,i,a,o,s,c,h,f,d,l,v;return r(this,function(r){switch(r.label){case 0:return t&&t.gatt?t.gatt.connected?[3,2]:[4,t.gatt.connect()]:[2,{}];case 1:r.sent(),r.label=2;case 2:return[4,t.gatt.getPrimaryServices()];case 3:return e=r.sent(),[4,(n=new I(e)).createService(u)];case 4:return i=r.sent(),[4,n.createService(y)];case 5:return a=r.sent(),[4,n.createService(C)];case 6:return o=r.sent(),[4,n.createService(L)];case 7:return s=r.sent(),[4,n.createService(E)];case 8:return c=r.sent(),[4,n.createService(x)];case 9:return h=r.sent(),[4,n.createService(M)];case 10:return f=r.sent(),[4,n.createService(H)];case 11:return d=r.sent(),[4,n.createService(R)];case 12:return l=r.sent(),[4,n.createService(B)];case 13:return v=r.sent(),[2,{deviceInformationService:i,buttonService:a,ledService:o,temperatureService:s,accelerometerService:c,magnetometerService:h,uartService:f,eventService:d,dfuControlService:l,ioPinService:v}]}})})};export{k as getServices,O as requestMicrobit}; | ||
//# sourceMappingURL=microbit.esm.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).microbit={})}(this,function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function r(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function u(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,u)}s((r=r.apply(e,t||[])).next())})}function i(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}var a,o=function(){function e(e){void 0===e&&(e=1),this.concurrent=e,this.queue=[],this.running=0}return e.prototype.pump=function(){return r(this,void 0,void 0,function(){var e,t,n;return i(this,function(r){switch(r.label){case 0:if(this.running>=this.concurrent)return[2];if(!(e=this.queue.shift()))return[2];this.running++,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.fn()];case 2:return t=r.sent(),e.resolve(t),[3,4];case 3:return n=r.sent(),e.reject(n),[3,4];case 4:return this.running--,[2,this.pump()]}})})},e.prototype.add=function(e){var t=this;return new Promise(function(n,r){return t.queue.push({fn:e,resolve:n,reject:r}),t.pump()})},e}(),u=function(){function e(e,t){this.service=e,this.emitter=t}return e.prototype.getCharacteristic=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return this.characteristics?[3,2]:(t=this,[4,this.service.getCharacteristics()]);case 1:t.characteristics=n.sent(),n.label=2;case 2:return[2,this.characteristics.find(function(t){return t.uuid===e})]}})})},e.prototype.getCharacteristicValue=function(t){return r(this,void 0,void 0,function(){var n,a=this;return i(this,function(o){switch(o.label){case 0:return[4,this.getCharacteristic(t)];case 1:if(!(n=o.sent()))throw new Error("Unable to locate characteristic");return[4,e.queue.add(function(){return r(a,void 0,void 0,function(){return i(this,function(e){return[2,n.readValue()]})})})];case 2:return[2,o.sent()]}})})},e.prototype.setCharacteristicValue=function(t,n){return r(this,void 0,void 0,function(){var a,o=this;return i(this,function(u){switch(u.label){case 0:return[4,this.getCharacteristic(t)];case 1:if(!(a=u.sent()))throw new Error("Unable to locate characteristic");return[4,e.queue.add(function(){return r(o,void 0,void 0,function(){return i(this,function(e){return[2,a.writeValue(n)]})})})];case 2:return u.sent(),[2]}})})},e.prototype.handleListener=function(t,n,a){return r(this,void 0,void 0,function(){var o,u=this;return i(this,function(s){switch(s.label){case 0:return[4,this.getCharacteristic(n)];case 1:return(o=s.sent())?[4,e.queue.add(function(){return r(u,void 0,void 0,function(){return i(this,function(e){return[2,o.startNotifications()]})})})]:[2];case 2:return s.sent(),this.emitter.on("newListener",function(n){if(!(n!==t||u.emitter.listenerCount(t)>0))return e.queue.add(function(){return r(u,void 0,void 0,function(){return i(this,function(e){return[2,o.addEventListener("characteristicvaluechanged",a)]})})})}),this.emitter.on("removeListener",function(n){if(!(n!==t||u.emitter.listenerCount(t)>0))return e.queue.add(function(){return r(u,void 0,void 0,function(){return i(this,function(e){return[2,o.removeEventListener("characteristicvaluechanged",a)]})})})}),[2]}})})},e.queue=new o,e}();!function(e){e.modelNumber="00002a24-0000-1000-8000-00805f9b34fb",e.serialNumber="00002a25-0000-1000-8000-00805f9b34fb",e.firmwareRevision="00002a26-0000-1000-8000-00805f9b34fb",e.hardwareRevision="00002a27-0000-1000-8000-00805f9b34fb",e.manufacturer="00002a29-0000-1000-8000-00805f9b34fb"}(a||(a={}));var s=function(){function e(e){this.helper=new u(e)}return e.create=function(t){return r(this,void 0,void 0,function(){return i(this,function(n){return[2,new e(t)]})})},e.prototype.readDeviceInformation=function(){return r(this,void 0,void 0,function(){var e,t,n,r,o,u;return i(this,function(i){switch(i.label){case 0:return e={},[4,this.readStringCharacteristic(a.modelNumber)];case 1:return(t=i.sent())&&(e.modelNumber=t),[4,this.readStringCharacteristic(a.serialNumber)];case 2:return(n=i.sent())&&(e.serialNumber=n),[4,this.readStringCharacteristic(a.firmwareRevision)];case 3:return(r=i.sent())&&(e.firmwareRevision=r),[4,this.readStringCharacteristic(a.hardwareRevision)];case 4:return(o=i.sent())&&(e.hardwareRevision=o),[4,this.readStringCharacteristic(a.manufacturer)];case 5:return(u=i.sent())&&(e.manufacturer=u),[2,e]}})})},e.prototype.readStringCharacteristic=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.helper.getCharacteristicValue(e)];case 1:return t=r.sent(),n=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),[2,String.fromCharCode.apply(null,Array.from(new Uint8Array(n)))];case 2:return r.sent(),[2,void 0];case 3:return[2]}})})},e.uuid="0000180a-0000-1000-8000-00805f9b34fb",e}();function c(){}function h(){h.init.call(this)}function f(e){return void 0===e._maxListeners?h.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,o,u;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]):(a=e._events=new c,e._eventsCount=0),o){if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),!o.warned&&(i=f(e))&&i>0&&o.length>i){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,u=s,"function"==typeof console.warn?console.warn(u):console.log(u)}}else o=a[t]=n,++e._eventsCount;return e}function l(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function v(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function p(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}c.prototype=Object.create(null),h.EventEmitter=h,h.usingDomains=!1,h.prototype.domain=void 0,h.prototype._events=void 0,h.prototype._maxListeners=void 0,h.defaultMaxListeners=10,h.init=function(){this.domain=null,h.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new c,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},h.prototype.getMaxListeners=function(){return f(this)},h.prototype.emit=function(e){var t,n,r,i,a,o,u,s="error"===e;if(o=this._events)s=s&&null==o.error;else if(!s)return!1;if(u=this.domain,s){if(t=arguments[1],!u){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=u,t.domainThrown=!1,u.emit("error",t),!1}if(!(n=o[e]))return!1;var h="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=p(e,r),a=0;a<r;++a)i[a].call(n)}(n,h,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,a=p(e,i),o=0;o<i;++o)a[o].call(n,r)}(n,h,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var a=e.length,o=p(e,a),u=0;u<a;++u)o[u].call(n,r,i)}(n,h,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,a){if(t)e.call(n,r,i,a);else for(var o=e.length,u=p(e,o),s=0;s<o;++s)u[s].call(n,r,i,a)}(n,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),a=1;a<r;a++)i[a-1]=arguments[a];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,a=p(e,i),o=0;o<i;++o)a[o].apply(n,r)}(n,h,this,i)}return!0},h.prototype.addListener=function(e,t){return d(this,e,t,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(e,t){return d(this,e,t,!0)},h.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,l(this,e,t)),this},h.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,l(this,e,t)),this},h.prototype.removeListener=function(e,t){var n,r,i,a,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new c:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new c,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i);r.removeListener&&this.emit("removeListener",e,o||t)}return this},h.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new c,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new c:delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),a=0;a<i.length;++a)"removeListener"!==(r=i[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new c,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},h.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},h.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},h.prototype.listenerCount=v,h.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var m,g,y=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isEventListenerObject=function(e){return void 0!==e.handleEvent},t}return n(t,e),t.prototype.addEventListener=function(t,n){if(n){var r=this.isEventListenerObject(n)?n.handleEvent:n;e.prototype.addListener.call(this,t,r)}},t.prototype.removeEventListener=function(t,n){if(n){var r=this.isEventListenerObject(n)?n.handleEvent:n;e.prototype.removeListener.call(this,t,r)}},t.prototype.dispatchEvent=function(t,n){var r;return r="string"==typeof t?new CustomEvent(t,{detail:n}):t,e.prototype.emit.call(this,r.type,r)},t}(h);!function(e){e.buttonAState="e95dda90-251d-470a-a062-fa1922dfa9a8",e.buttonBState="e95dda91-251d-470a-a062-fa1922dfa9a8"}(m||(m={})),function(e){e[e.Release=0]="Release",e[e.ShortPress=1]="ShortPress",e[e.LongPress=2]="LongPress"}(g||(g={}));var b,w=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("buttonastatechanged",m.buttonAState,this.buttonAStateChangedHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("buttonbstatechanged",m.buttonBState,this.buttonBStateChangedHandler.bind(this))];case 2:return e.sent(),[2]}})})},t.prototype.readButtonAState=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(m.buttonAState)];case 1:return[2,e.sent().getUint8(0)]}})})},t.prototype.readButtonBState=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(m.buttonBState)];case 1:return[2,e.sent().getUint8(0)]}})})},t.prototype.buttonAStateChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("buttonastatechanged",t.getUint8(0))},t.prototype.buttonBStateChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("buttonbstatechanged",t.getUint8(0))},t.uuid="e95d9882-251d-470a-a062-fa1922dfa9a8",t}(y);!function(e){e.ledMatrixState="e95d7b77-251d-470a-a062-fa1922dfa9a8",e.ledText="e95d93ee-251d-470a-a062-fa1922dfa9a8",e.scrollingDelay="e95d0d2d-251d-470a-a062-fa1922dfa9a8"}(b||(b={}));var C,L=function(){function e(e){this.helper=new u(e)}return e.create=function(t){return r(this,void 0,void 0,function(){return i(this,function(n){return[2,new e(t)]})})},e.prototype.writeText=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=this.encodeString(e),[2,this.helper.setCharacteristicValue(b.ledText,t)]})})},e.prototype.readMatrixState=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(b.ledMatrixState)];case 1:return e=t.sent(),[2,this.viewToLedMatrix(e)]}})})},e.prototype.writeMatrixState=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=this.ledMatrixToView(e),[2,this.helper.setCharacteristicValue(b.ledMatrixState,t)]})})},e.prototype.getScrollingDelay=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(b.scrollingDelay)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},e.prototype.setScrollingDelay=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(b.scrollingDelay,t)]})})},e.prototype.encodeString=function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return t},e.prototype.viewToLedMatrix=function(e){for(var t=[],n=0;n<5;n++)t[n]=this.byteToBoolArray(e.getUint8(n));return t},e.prototype.byteToBoolArray=function(e){for(var t=[!1,!1,!1,!1,!1],n=0;n<t.length;n++)t[n]=1==(1&e),e>>=1;return t.reverse()},e.prototype.ledMatrixToView=function(e){for(var t=new DataView(new ArrayBuffer(5)),n=0;n<5;n++)t.setUint8(n,this.boolArrayToByte(e[n]));return t},e.prototype.boolArrayToByte=function(e){return e.reduce(function(e,t){return e<<1|(t?1:0)},0)},e.uuid="e95dd91d-251d-470a-a062-fa1922dfa9a8",e}();!function(e){e.temperature="e95d9250-251d-470a-a062-fa1922dfa9a8",e.temperaturePeriod="e95d1b25-251d-470a-a062-fa1922dfa9a8"}(C||(C={}));var E,S=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("temperaturechanged",C.temperature,this.temperatureChangedHandler.bind(this))];case 1:return e.sent(),[2]}})})},t.prototype.readTemperature=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(C.temperature)];case 1:return[2,e.sent().getInt8(0)]}})})},t.prototype.getTemperaturePeriod=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(C.temperaturePeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},t.prototype.setTemperaturePeriod=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[4,this.helper.setCharacteristicValue(C.temperaturePeriod,t)];case 1:return[2,n.sent()]}})})},t.prototype.temperatureChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("temperaturechanged",t.getInt8(0))},t.uuid="e95d6100-251d-470a-a062-fa1922dfa9a8",t}(y);!function(e){e.accelerometerData="e95dca4b-251d-470a-a062-fa1922dfa9a8",e.accelerometerPeriod="e95dfb24-251d-470a-a062-fa1922dfa9a8"}(E||(E={}));var x,V,_=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("accelerometerdatachanged",E.accelerometerData,this.accelerometerDataChangedHandler.bind(this))];case 1:return e.sent(),[2]}})})},t.prototype.readAccelerometerData=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(E.accelerometerData)];case 1:return e=t.sent(),[2,this.dataViewToAccelerometerData(e)]}})})},t.prototype.getAccelerometerPeriod=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(E.accelerometerPeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},t.prototype.setAccelerometerPeriod=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(E.accelerometerPeriod,t)]})})},t.prototype.accelerometerDataChangedHandler=function(e){var t=e.target.value,n=this.dataViewToAccelerometerData(t);this.dispatchEvent("accelerometerdatachanged",n)},t.prototype.dataViewToAccelerometerData=function(e){return{x:e.getInt16(0,!0)/1e3,y:e.getInt16(2,!0)/1e3,z:e.getInt16(4,!0)/1e3}},t.uuid="e95d0753-251d-470a-a062-fa1922dfa9a8",t}(y);!function(e){e.magnetometerData="e95dfb11-251d-470a-a062-fa1922dfa9a8",e.magnetometerPeriod="e95d386c-251d-470a-a062-fa1922dfa9a8",e.magnetometerBearing="e95d9715-251d-470a-a062-fa1922dfa9a8",e.magnetometerCalibration="e95db358-251d-470a-a062-fa1922dfa9a8"}(x||(x={})),function(e){e[e.unknown=0]="unknown",e[e.requested=1]="requested",e[e.completed=2]="completed",e[e.errored=3]="errored"}(V||(V={}));var A,T=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("magnetometerdatachanged",x.magnetometerData,this.magnetometerDataChangedHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("magnetometerbearingchanged",x.magnetometerBearing,this.magnetometerBearingChangedHandler.bind(this))];case 2:return e.sent(),[4,this.helper.handleListener("magnetometercalibrationchanged",x.magnetometerCalibration,this.magnetometerCalibrationChangedHandler.bind(this))];case 3:return e.sent(),[2]}})})},t.prototype.calibrate=function(){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,this.helper.setCharacteristicValue(x.magnetometerCalibration,new Uint8Array([1]))]})})},t.prototype.readMagnetometerData=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(x.magnetometerData)];case 1:return e=t.sent(),[2,this.dataViewToMagnetometerData(e)]}})})},t.prototype.readMagnetometerBearing=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(x.magnetometerBearing)];case 1:return 2===(e=t.sent()).byteLength?[2,e.getUint16(0,!0)]:[2,void 0]}})})},t.prototype.getMagnetometerPeriod=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(x.magnetometerPeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},t.prototype.setMagnetometerPeriod=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(x.magnetometerPeriod,t)]})})},t.prototype.magnetometerDataChangedHandler=function(e){var t=e.target.value,n=this.dataViewToMagnetometerData(t);this.dispatchEvent("magnetometerdatachanged",n)},t.prototype.magnetometerBearingChangedHandler=function(e){var t=e.target.value;2===t.byteLength&&this.dispatchEvent("magnetometerbearingchanged",t.getUint16(0,!0))},t.prototype.magnetometerCalibrationChangedHandler=function(e){var t=e.target.value;1===t.byteLength&&this.dispatchEvent("magnetometercalibrationchanged",t.getUint8(0))},t.prototype.dataViewToMagnetometerData=function(e){return{x:e.getInt16(0,!0),y:e.getInt16(1,!0),z:e.getInt16(2,!0)}},t.uuid="e95df2d8-251d-470a-a062-fa1922dfa9a8",t}(y);!function(e){e.pinData="e95d8d00-251d-470a-a062-fa1922dfa9a8",e.pinAdConfiguration="e95d5899-251d-470a-a062-fa1922dfa9a8",e.pinIoConfiguration="e95db9fe-251d-470a-a062-fa1922dfa9a8",e.pwmControl="e95dd822-251d-470a-a062-fa1922dfa9a8"}(A||(A={}));var D,B=function(){function e(e){this.helper=new u(e)}return e.create=function(t){return r(this,void 0,void 0,function(){return i(this,function(n){return[2,new e(t)]})})},e.uuid="e95d127b-251d-470a-a062-fa1922dfa9a8",e}();!function(e){e.tx="6e400002-b5a3-f393-e0a9-e50e24dcca9e",e.rx="6e400003-b5a3-f393-e0a9-e50e24dcca9e"}(D||(D={}));var U,M=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("receive",D.tx,this.receiveHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("receiveText",D.tx,this.receiveTextHandler.bind(this))];case 2:return e.sent(),[2]}})})},t.prototype.send=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,this.helper.setCharacteristicValue(D.rx,e)]})})},t.prototype.sendText=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=e.split("").map(function(e){return e.charCodeAt(0)}),[2,this.helper.setCharacteristicValue(D.rx,new Uint8Array(t).buffer)]})})},t.prototype.receiveHandler=function(e){var t=e.target.value,n=new Uint8Array(t.buffer);this.dispatchEvent("receive",n)},t.prototype.receiveTextHandler=function(e){var t=e.target.value,n=Array.prototype.slice.call(new Uint8Array(t.buffer)),r=String.fromCharCode.apply(null,n);this.dispatchEvent("receiveText",r)},t.uuid="6e400001-b5a3-f393-e0a9-e50e24dcca9e",t}(y);!function(e){e.microBitRequirements="e95db84c-251d-470a-a062-fa1922dfa9a8",e.microBitEvent="e95d9775-251d-470a-a062-fa1922dfa9a8",e.clientRequirements="e95d23c4-251d-470a-a062-fa1922dfa9a8",e.clientEvent="e95d5404-251d-470a-a062-fa1922dfa9a8"}(U||(U={}));var P,q=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("microbitevent",U.microBitEvent,this.eventHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("microbitrequirementschanged",U.microBitRequirements,this.microbitRequirementsChangedHandler.bind(this))];case 2:return e.sent(),[2]}})})},t.prototype.getMicrobitRequirements=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(U.microBitRequirements)];case 1:return e=t.sent(),[2,this.viewToMicrobitEvent(e)]}})})},t.prototype.setClientRequirements=function(e,t){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return(n=new DataView(new ArrayBuffer(4))).setUint16(0,e,!0),n.setUint16(1,t,!0),[4,this.helper.setCharacteristicValue(U.clientRequirements,n)];case 1:return[2,r.sent()]}})})},t.prototype.readMicrobitEvent=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(U.microBitEvent)];case 1:return e=t.sent(),[2,this.viewToMicrobitEvent(e)]}})})},t.prototype.writeClientEvent=function(e,t){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return(n=new DataView(new ArrayBuffer(4))).setUint16(0,e,!0),n.setUint16(1,t,!0),[4,this.helper.setCharacteristicValue(U.clientEvent,n)];case 1:return[2,r.sent()]}})})},t.prototype.microbitRequirementsChangedHandler=function(e){var t=e.target.value,n=this.viewToMicrobitEvent(t);this.dispatchEvent("microbitrequirementschanged",n)},t.prototype.eventHandler=function(e){var t=e.target.value,n=this.viewToMicrobitEvent(t);this.dispatchEvent("microbitevent",n)},t.prototype.viewToMicrobitEvent=function(e){return{type:e.getUint16(0,!0),value:e.getUint16(1,!0)}},t.uuid="e95d93af-251d-470a-a062-fa1922dfa9a8",t}(y);!function(e){e.dfuControl="e95d93b1-251d-470a-a062-fa1922dfa9a8"}(P||(P={}));var H=function(){function e(e){this.helper=new u(e)}return e.create=function(t){return r(this,void 0,void 0,function(){return i(this,function(n){return[2,new e(t)]})})},e.uuid="e95d93b0-251d-470a-a062-fa1922dfa9a8",e}(),R=function(){function e(e){this.services=e}return e.prototype.createService=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return(t=this.services.find(function(t){return t.uuid===e.uuid}))?[4,e.create(t)]:[2,void 0];case 1:return[2,n.sent()]}})})},e}();e.getServices=function(e){return r(void 0,void 0,void 0,function(){var t,n,r,a,o,u,c,h,f,d;return i(this,function(i){switch(i.label){case 0:return e&&e.gatt?e.gatt.connected?[3,2]:[4,e.gatt.connect()]:[2,{}];case 1:i.sent(),i.label=2;case 2:return[4,e.gatt.getPrimaryServices()];case 3:return t=i.sent(),[4,(n=new R(t)).createService(s)];case 4:return r=i.sent(),[4,n.createService(w)];case 5:return a=i.sent(),[4,n.createService(L)];case 6:return o=i.sent(),[4,n.createService(S)];case 7:return u=i.sent(),[4,n.createService(_)];case 8:return c=i.sent(),[4,n.createService(T)];case 9:return h=i.sent(),[4,n.createService(M)];case 10:return f=i.sent(),[4,n.createService(q)];case 11:return d=i.sent(),[2,{deviceInformationService:r,buttonService:a,ledService:o,temperatureService:u,accelerometerService:c,magnetometerService:h,uartService:f,eventService:d}]}})})},e.requestMicrobit=function(e){return r(void 0,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,e.requestDevice({filters:[{namePrefix:"BBC micro:bit"}],optionalServices:[s.uuid,w.uuid,L.uuid,S.uuid,_.uuid,T.uuid,B.uuid,M.uuid,q.uuid,H.uuid]})];case 1:return[2,t.sent()]}})})},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).microbit={})}(this,function(e){"use strict";var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,n)};function n(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function r(e,t,n,r){return new(n||(n=Promise))(function(i,a){function o(e){try{s(r.next(e))}catch(e){a(e)}}function u(e){try{s(r.throw(e))}catch(e){a(e)}}function s(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(o,u)}s((r=r.apply(e,t||[])).next())})}function i(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}var a,o=function(){function e(e){void 0===e&&(e=1),this.concurrent=e,this.queue=[],this.running=0}return e.prototype.pump=function(){return r(this,void 0,void 0,function(){var e,t,n;return i(this,function(r){switch(r.label){case 0:if(this.running>=this.concurrent)return[2];if(!(e=this.queue.shift()))return[2];this.running++,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.fn()];case 2:return t=r.sent(),e.resolve(t),[3,4];case 3:return n=r.sent(),e.reject(n),[3,4];case 4:return this.running--,[2,this.pump()]}})})},e.prototype.add=function(e){var t=this;return new Promise(function(n,r){return t.queue.push({fn:e,resolve:n,reject:r}),t.pump()})},e}(),u=function(){function e(e,t){this.service=e,this.emitter=t}return e.prototype.getCharacteristic=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return this.characteristics?[3,2]:(t=this,[4,this.service.getCharacteristics()]);case 1:t.characteristics=n.sent(),n.label=2;case 2:return[2,this.characteristics.find(function(t){return t.uuid===e})]}})})},e.prototype.getCharacteristicValue=function(t){return r(this,void 0,void 0,function(){var n,a=this;return i(this,function(o){switch(o.label){case 0:return[4,this.getCharacteristic(t)];case 1:if(!(n=o.sent()))throw new Error("Unable to locate characteristic");return[4,e.queue.add(function(){return r(a,void 0,void 0,function(){return i(this,function(e){return[2,n.readValue()]})})})];case 2:return[2,o.sent()]}})})},e.prototype.setCharacteristicValue=function(t,n){return r(this,void 0,void 0,function(){var a,o=this;return i(this,function(u){switch(u.label){case 0:return[4,this.getCharacteristic(t)];case 1:if(!(a=u.sent()))throw new Error("Unable to locate characteristic");return[4,e.queue.add(function(){return r(o,void 0,void 0,function(){return i(this,function(e){return[2,a.writeValue(n)]})})})];case 2:return u.sent(),[2]}})})},e.prototype.handleListener=function(t,n,a){return r(this,void 0,void 0,function(){var o,u=this;return i(this,function(s){switch(s.label){case 0:return[4,this.getCharacteristic(n)];case 1:return(o=s.sent())?[4,e.queue.add(function(){return r(u,void 0,void 0,function(){return i(this,function(e){return[2,o.startNotifications()]})})})]:[2];case 2:return s.sent(),this.emitter.on("newListener",function(n){if(!(n!==t||u.emitter.listenerCount(t)>0))return e.queue.add(function(){return r(u,void 0,void 0,function(){return i(this,function(e){return[2,o.addEventListener("characteristicvaluechanged",a)]})})})}),this.emitter.on("removeListener",function(n){if(!(n!==t||u.emitter.listenerCount(t)>0))return e.queue.add(function(){return r(u,void 0,void 0,function(){return i(this,function(e){return[2,o.removeEventListener("characteristicvaluechanged",a)]})})})}),[2]}})})},e.queue=new o,e}();!function(e){e.modelNumber="00002a24-0000-1000-8000-00805f9b34fb",e.serialNumber="00002a25-0000-1000-8000-00805f9b34fb",e.firmwareRevision="00002a26-0000-1000-8000-00805f9b34fb",e.hardwareRevision="00002a27-0000-1000-8000-00805f9b34fb",e.manufacturer="00002a29-0000-1000-8000-00805f9b34fb"}(a||(a={}));var s=function(){function e(e){this.helper=new u(e)}return e.create=function(t){return r(this,void 0,void 0,function(){return i(this,function(n){return[2,new e(t)]})})},e.prototype.readDeviceInformation=function(){return r(this,void 0,void 0,function(){var e,t,n,r,o,u;return i(this,function(i){switch(i.label){case 0:return e={},[4,this.readStringCharacteristic(a.modelNumber)];case 1:return(t=i.sent())&&(e.modelNumber=t),[4,this.readStringCharacteristic(a.serialNumber)];case 2:return(n=i.sent())&&(e.serialNumber=n),[4,this.readStringCharacteristic(a.firmwareRevision)];case 3:return(r=i.sent())&&(e.firmwareRevision=r),[4,this.readStringCharacteristic(a.hardwareRevision)];case 4:return(o=i.sent())&&(e.hardwareRevision=o),[4,this.readStringCharacteristic(a.manufacturer)];case 5:return(u=i.sent())&&(e.manufacturer=u),[2,e]}})})},e.prototype.readStringCharacteristic=function(e){return r(this,void 0,void 0,function(){var t,n;return i(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.helper.getCharacteristicValue(e)];case 1:return t=r.sent(),n=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),[2,String.fromCharCode.apply(null,Array.from(new Uint8Array(n)))];case 2:return r.sent(),[2,void 0];case 3:return[2]}})})},e.uuid="0000180a-0000-1000-8000-00805f9b34fb",e}();function c(){}function h(){h.init.call(this)}function f(e){return void 0===e._maxListeners?h.defaultMaxListeners:e._maxListeners}function d(e,t,n,r){var i,a,o,u;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((a=e._events)?(a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]):(a=e._events=new c,e._eventsCount=0),o){if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),!o.warned&&(i=f(e))&&i>0&&o.length>i){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,u=s,"function"==typeof console.warn?console.warn(u):console.log(u)}}else o=a[t]=n,++e._eventsCount;return e}function l(e,t,n){var r=!1;function i(){e.removeListener(t,i),r||(r=!0,n.apply(e,arguments))}return i.listener=n,i}function v(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function p(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}c.prototype=Object.create(null),h.EventEmitter=h,h.usingDomains=!1,h.prototype.domain=void 0,h.prototype._events=void 0,h.prototype._maxListeners=void 0,h.defaultMaxListeners=10,h.init=function(){this.domain=null,h.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new c,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},h.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},h.prototype.getMaxListeners=function(){return f(this)},h.prototype.emit=function(e){var t,n,r,i,a,o,u,s="error"===e;if(o=this._events)s=s&&null==o.error;else if(!s)return!1;if(u=this.domain,s){if(t=arguments[1],!u){if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=u,t.domainThrown=!1,u.emit("error",t),!1}if(!(n=o[e]))return!1;var h="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=p(e,r),a=0;a<r;++a)i[a].call(n)}(n,h,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,a=p(e,i),o=0;o<i;++o)a[o].call(n,r)}(n,h,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var a=e.length,o=p(e,a),u=0;u<a;++u)o[u].call(n,r,i)}(n,h,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,a){if(t)e.call(n,r,i,a);else for(var o=e.length,u=p(e,o),s=0;s<o;++s)u[s].call(n,r,i,a)}(n,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),a=1;a<r;a++)i[a-1]=arguments[a];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,a=p(e,i),o=0;o<i;++o)a[o].apply(n,r)}(n,h,this,i)}return!0},h.prototype.addListener=function(e,t){return d(this,e,t,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(e,t){return d(this,e,t,!0)},h.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,l(this,e,t)),this},h.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,l(this,e,t)),this},h.prototype.removeListener=function(e,t){var n,r,i,a,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)0==--this._eventsCount?this._events=new c:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,a=n.length;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;if(1===n.length){if(n[0]=void 0,0==--this._eventsCount)return this._events=new c,this;delete r[e]}else!function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i);r.removeListener&&this.emit("removeListener",e,o||t)}return this},h.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=new c,this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=new c:delete n[e]),this;if(0===arguments.length){for(var r,i=Object.keys(n),a=0;a<i.length;++a)"removeListener"!==(r=i[a])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new c,this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},h.prototype.listeners=function(e){var t,n=this._events;return n&&(t=n[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(t):[]},h.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},h.prototype.listenerCount=v,h.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var g,m,w=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isEventListenerObject=function(e){return void 0!==e.handleEvent},t}return n(t,e),t.prototype.addEventListener=function(t,n){if(n){var r=this.isEventListenerObject(n)?n.handleEvent:n;e.prototype.addListener.call(this,t,r)}},t.prototype.removeEventListener=function(t,n){if(n){var r=this.isEventListenerObject(n)?n.handleEvent:n;e.prototype.removeListener.call(this,t,r)}},t.prototype.dispatchEvent=function(t,n){var r;return r="string"==typeof t?new CustomEvent(t,{detail:n}):t,e.prototype.emit.call(this,r.type,r)},t}(h);!function(e){e.buttonAState="e95dda90-251d-470a-a062-fa1922dfa9a8",e.buttonBState="e95dda91-251d-470a-a062-fa1922dfa9a8"}(g||(g={})),function(e){e[e.Release=0]="Release",e[e.ShortPress=1]="ShortPress",e[e.LongPress=2]="LongPress"}(m||(m={}));var y,b=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("buttonastatechanged",g.buttonAState,this.buttonAStateChangedHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("buttonbstatechanged",g.buttonBState,this.buttonBStateChangedHandler.bind(this))];case 2:return e.sent(),[2]}})})},t.prototype.readButtonAState=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(g.buttonAState)];case 1:return[2,e.sent().getUint8(0)]}})})},t.prototype.readButtonBState=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(g.buttonBState)];case 1:return[2,e.sent().getUint8(0)]}})})},t.prototype.buttonAStateChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("buttonastatechanged",t.getUint8(0))},t.prototype.buttonBStateChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("buttonbstatechanged",t.getUint8(0))},t.uuid="e95d9882-251d-470a-a062-fa1922dfa9a8",t}(w);!function(e){e.ledMatrixState="e95d7b77-251d-470a-a062-fa1922dfa9a8",e.ledText="e95d93ee-251d-470a-a062-fa1922dfa9a8",e.scrollingDelay="e95d0d2d-251d-470a-a062-fa1922dfa9a8"}(y||(y={}));var C,V=function(){function e(e){this.helper=new u(e)}return e.create=function(t){return r(this,void 0,void 0,function(){return i(this,function(n){return[2,new e(t)]})})},e.prototype.writeText=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=this.encodeString(e),[2,this.helper.setCharacteristicValue(y.ledText,t)]})})},e.prototype.readMatrixState=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(y.ledMatrixState)];case 1:return e=t.sent(),[2,this.viewToLedMatrix(e)]}})})},e.prototype.writeMatrixState=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=this.ledMatrixToView(e),[2,this.helper.setCharacteristicValue(y.ledMatrixState,t)]})})},e.prototype.getScrollingDelay=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(y.scrollingDelay)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},e.prototype.setScrollingDelay=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(y.scrollingDelay,t)]})})},e.prototype.encodeString=function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return t},e.prototype.viewToLedMatrix=function(e){for(var t=[],n=0;n<5;n++)t[n]=this.byteToBoolArray(e.getUint8(n));return t},e.prototype.byteToBoolArray=function(e){for(var t=[!1,!1,!1,!1,!1],n=0;n<t.length;n++)t[n]=1==(1&e),e>>=1;return t.reverse()},e.prototype.ledMatrixToView=function(e){for(var t=new DataView(new ArrayBuffer(5)),n=0;n<5;n++)t.setUint8(n,this.boolArrayToByte(e[n]));return t},e.prototype.boolArrayToByte=function(e){return e.reduce(function(e,t){return e<<1|(t?1:0)},0)},e.uuid="e95dd91d-251d-470a-a062-fa1922dfa9a8",e}();!function(e){e.temperature="e95d9250-251d-470a-a062-fa1922dfa9a8",e.temperaturePeriod="e95d1b25-251d-470a-a062-fa1922dfa9a8"}(C||(C={}));var L,D=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("temperaturechanged",C.temperature,this.temperatureChangedHandler.bind(this))];case 1:return e.sent(),[2]}})})},t.prototype.readTemperature=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(C.temperature)];case 1:return[2,e.sent().getInt8(0)]}})})},t.prototype.getTemperaturePeriod=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(C.temperaturePeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},t.prototype.setTemperaturePeriod=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[4,this.helper.setCharacteristicValue(C.temperaturePeriod,t)];case 1:return[2,n.sent()]}})})},t.prototype.temperatureChangedHandler=function(e){var t=e.target.value;this.dispatchEvent("temperaturechanged",t.getInt8(0))},t.uuid="e95d6100-251d-470a-a062-fa1922dfa9a8",t}(w);!function(e){e.accelerometerData="e95dca4b-251d-470a-a062-fa1922dfa9a8",e.accelerometerPeriod="e95dfb24-251d-470a-a062-fa1922dfa9a8"}(L||(L={}));var S,E,A=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("accelerometerdatachanged",L.accelerometerData,this.accelerometerDataChangedHandler.bind(this))];case 1:return e.sent(),[2]}})})},t.prototype.readAccelerometerData=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(L.accelerometerData)];case 1:return e=t.sent(),[2,this.dataViewToAccelerometerData(e)]}})})},t.prototype.getAccelerometerPeriod=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(L.accelerometerPeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},t.prototype.setAccelerometerPeriod=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(L.accelerometerPeriod,t)]})})},t.prototype.accelerometerDataChangedHandler=function(e){var t=e.target.value,n=this.dataViewToAccelerometerData(t);this.dispatchEvent("accelerometerdatachanged",n)},t.prototype.dataViewToAccelerometerData=function(e){return{x:e.getInt16(0,!0)/1e3,y:e.getInt16(2,!0)/1e3,z:e.getInt16(4,!0)/1e3}},t.uuid="e95d0753-251d-470a-a062-fa1922dfa9a8",t}(w);!function(e){e.magnetometerData="e95dfb11-251d-470a-a062-fa1922dfa9a8",e.magnetometerPeriod="e95d386c-251d-470a-a062-fa1922dfa9a8",e.magnetometerBearing="e95d9715-251d-470a-a062-fa1922dfa9a8",e.magnetometerCalibration="e95db358-251d-470a-a062-fa1922dfa9a8"}(S||(S={})),function(e){e[e.unknown=0]="unknown",e[e.requested=1]="requested",e[e.completed=2]="completed",e[e.errored=3]="errored"}(E||(E={}));var T,x,U,_=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("magnetometerdatachanged",S.magnetometerData,this.magnetometerDataChangedHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("magnetometerbearingchanged",S.magnetometerBearing,this.magnetometerBearingChangedHandler.bind(this))];case 2:return e.sent(),[4,this.helper.handleListener("magnetometercalibrationchanged",S.magnetometerCalibration,this.magnetometerCalibrationChangedHandler.bind(this))];case 3:return e.sent(),[2]}})})},t.prototype.calibrate=function(){return r(this,void 0,void 0,function(){return i(this,function(e){return[2,this.helper.setCharacteristicValue(S.magnetometerCalibration,new Uint8Array([1]))]})})},t.prototype.readMagnetometerData=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(S.magnetometerData)];case 1:return e=t.sent(),[2,this.dataViewToMagnetometerData(e)]}})})},t.prototype.readMagnetometerBearing=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(S.magnetometerBearing)];case 1:return 2===(e=t.sent()).byteLength?[2,e.getUint16(0,!0)]:[2,void 0]}})})},t.prototype.getMagnetometerPeriod=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.getCharacteristicValue(S.magnetometerPeriod)];case 1:return[2,e.sent().getUint16(0,!0)]}})})},t.prototype.setMagnetometerPeriod=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return(t=new DataView(new ArrayBuffer(2))).setUint16(0,e,!0),[2,this.helper.setCharacteristicValue(S.magnetometerPeriod,t)]})})},t.prototype.magnetometerDataChangedHandler=function(e){var t=e.target.value,n=this.dataViewToMagnetometerData(t);this.dispatchEvent("magnetometerdatachanged",n)},t.prototype.magnetometerBearingChangedHandler=function(e){var t=e.target.value;2===t.byteLength&&this.dispatchEvent("magnetometerbearingchanged",t.getUint16(0,!0))},t.prototype.magnetometerCalibrationChangedHandler=function(e){var t=e.target.value;1===t.byteLength&&this.dispatchEvent("magnetometercalibrationchanged",t.getUint8(0))},t.prototype.dataViewToMagnetometerData=function(e){return{x:e.getInt16(0,!0),y:e.getInt16(1,!0),z:e.getInt16(2,!0)}},t.uuid="e95df2d8-251d-470a-a062-fa1922dfa9a8",t}(w);!function(e){e.pinData="e95d8d00-251d-470a-a062-fa1922dfa9a8",e.pinAdConfiguration="e95d5899-251d-470a-a062-fa1922dfa9a8",e.pinIoConfiguration="e95db9fe-251d-470a-a062-fa1922dfa9a8",e.pwmControl="e95dd822-251d-470a-a062-fa1922dfa9a8"}(T||(T={})),function(e){e[e.Digital=0]="Digital",e[e.Analogue=1]="Analogue"}(x||(x={})),function(e){e[e.Output=0]="Output",e[e.Input=1]="Input"}(U||(U={}));var B,P=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("pindatachanged",T.pinData,this.pinDataChangedHandler.bind(this))];case 1:return e.sent(),[2]}})})},t.prototype.readPinData=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(T.pinData)];case 1:return e=t.sent(),[2,this.dataViewToPinData(e)]}})})},t.prototype.writePinData=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=this.pinDataToDataView(e),[2,this.helper.setCharacteristicValue(T.pinData,t)]})})},t.prototype.getAdConfiguration=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(T.pinAdConfiguration)];case 1:return e=t.sent(),[2,this.dataViewToConfig(e)]}})})},t.prototype.setAdConfiguration=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=this.configToDataView(e),[2,this.helper.setCharacteristicValue(T.pinAdConfiguration,t)]})})},t.prototype.getIoConfiguration=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(T.pinIoConfiguration)];case 1:return e=t.sent(),[2,this.dataViewToConfig(e)]}})})},t.prototype.setIoConfiguration=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=this.configToDataView(e),[2,this.helper.setCharacteristicValue(T.pinIoConfiguration,t)]})})},t.prototype.setPwmControl=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=this.pwmControlDataToDataView(e),[2,this.helper.setCharacteristicValue(T.pwmControl,t)]})})},t.prototype.pinDataChangedHandler=function(e){var t=e.target.value,n=this.dataViewToPinData(t);this.dispatchEvent("pindatachanged",n)},t.prototype.dataViewToPinData=function(e){for(var t=[],n=0;n<e.byteLength;n+=2)t.push({pin:e.getUint8(n),value:e.getUint8(n+1)});return t},t.prototype.pinDataToDataView=function(e){var t=new DataView(new ArrayBuffer(2*e.length));return e.forEach(function(e,n){t.setUint8(2*n,e.pin),t.setUint8(2*n+1,e.value)}),t},t.prototype.dataViewToConfig=function(e){for(var t=[],n=(e.getUint16(0)<<8)+e.getUint8(2),r=0;r<24;r++)t.push(n>>r);return t},t.prototype.configToDataView=function(e){for(var t=new DataView(new ArrayBuffer(3)),n=0,r=0;r<e.length;r++)n&=1<<e[r];return t.setUint16(0,n>>8),t.setUint8(2,255&n),t},t.prototype.pwmControlDataToDataView=function(e){var t=new DataView(new ArrayBuffer(7));return t.setUint8(0,e.pin),t.setUint16(1,e.value),t.setUint32(3,e.period),t},t.uuid="e95d127b-251d-470a-a062-fa1922dfa9a8",t}(w);!function(e){e.tx="6e400002-b5a3-f393-e0a9-e50e24dcca9e",e.rx="6e400003-b5a3-f393-e0a9-e50e24dcca9e"}(B||(B={}));var M,q=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("receive",B.tx,this.receiveHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("receiveText",B.tx,this.receiveTextHandler.bind(this))];case 2:return e.sent(),[2]}})})},t.prototype.send=function(e){return r(this,void 0,void 0,function(){return i(this,function(t){return[2,this.helper.setCharacteristicValue(B.rx,e)]})})},t.prototype.sendText=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){return t=e.split("").map(function(e){return e.charCodeAt(0)}),[2,this.helper.setCharacteristicValue(B.rx,new Uint8Array(t).buffer)]})})},t.prototype.receiveHandler=function(e){var t=e.target.value,n=new Uint8Array(t.buffer);this.dispatchEvent("receive",n)},t.prototype.receiveTextHandler=function(e){var t=e.target.value,n=Array.prototype.slice.call(new Uint8Array(t.buffer)),r=String.fromCharCode.apply(null,n);this.dispatchEvent("receiveText",r)},t.uuid="6e400001-b5a3-f393-e0a9-e50e24dcca9e",t}(w);!function(e){e.microBitRequirements="e95db84c-251d-470a-a062-fa1922dfa9a8",e.microBitEvent="e95d9775-251d-470a-a062-fa1922dfa9a8",e.clientRequirements="e95d23c4-251d-470a-a062-fa1922dfa9a8",e.clientEvent="e95d5404-251d-470a-a062-fa1922dfa9a8"}(M||(M={}));var H,R=function(e){function t(t){var n=e.call(this)||this;return n.helper=new u(t,n),n}return n(t,e),t.create=function(e){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return[4,(n=new t(e)).init()];case 1:return r.sent(),[2,n]}})})},t.prototype.init=function(){return r(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,this.helper.handleListener("microbitevent",M.microBitEvent,this.eventHandler.bind(this))];case 1:return e.sent(),[4,this.helper.handleListener("microbitrequirementschanged",M.microBitRequirements,this.microbitRequirementsChangedHandler.bind(this))];case 2:return e.sent(),[2]}})})},t.prototype.getMicrobitRequirements=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(M.microBitRequirements)];case 1:return e=t.sent(),[2,this.viewToMicrobitEvent(e)]}})})},t.prototype.setClientRequirements=function(e,t){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return(n=new DataView(new ArrayBuffer(4))).setUint16(0,e,!0),n.setUint16(1,t,!0),[4,this.helper.setCharacteristicValue(M.clientRequirements,n)];case 1:return[2,r.sent()]}})})},t.prototype.readMicrobitEvent=function(){return r(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:return[4,this.helper.getCharacteristicValue(M.microBitEvent)];case 1:return e=t.sent(),[2,this.viewToMicrobitEvent(e)]}})})},t.prototype.writeClientEvent=function(e,t){return r(this,void 0,void 0,function(){var n;return i(this,function(r){switch(r.label){case 0:return(n=new DataView(new ArrayBuffer(4))).setUint16(0,e,!0),n.setUint16(1,t,!0),[4,this.helper.setCharacteristicValue(M.clientEvent,n)];case 1:return[2,r.sent()]}})})},t.prototype.microbitRequirementsChangedHandler=function(e){var t=e.target.value,n=this.viewToMicrobitEvent(t);this.dispatchEvent("microbitrequirementschanged",n)},t.prototype.eventHandler=function(e){var t=e.target.value,n=this.viewToMicrobitEvent(t);this.dispatchEvent("microbitevent",n)},t.prototype.viewToMicrobitEvent=function(e){return{type:e.getUint16(0,!0),value:e.getUint16(1,!0)}},t.uuid="e95d93af-251d-470a-a062-fa1922dfa9a8",t}(w);!function(e){e.dfuControl="e95d93b1-251d-470a-a062-fa1922dfa9a8"}(H||(H={}));var I=function(){function e(e){this.helper=new u(e)}return e.create=function(t){return r(this,void 0,void 0,function(){return i(this,function(n){return[2,new e(t)]})})},e.prototype.requestDfu=function(){return this.helper.setCharacteristicValue(H.dfuControl,new Uint8Array([1]))},e.prototype.requestFlashCode=function(){return this.helper.setCharacteristicValue(H.dfuControl,new Uint8Array([2]))},e.uuid="e95d93b0-251d-470a-a062-fa1922dfa9a8",e}(),O=function(){function e(e){this.services=e}return e.prototype.createService=function(e){return r(this,void 0,void 0,function(){var t;return i(this,function(n){switch(n.label){case 0:return(t=this.services.find(function(t){return t.uuid===e.uuid}))?[4,e.create(t)]:[2,void 0];case 1:return[2,n.sent()]}})})},e}();e.getServices=function(e){return r(void 0,void 0,void 0,function(){var t,n,r,a,o,u,c,h,f,d,l,v;return i(this,function(i){switch(i.label){case 0:return e&&e.gatt?e.gatt.connected?[3,2]:[4,e.gatt.connect()]:[2,{}];case 1:i.sent(),i.label=2;case 2:return[4,e.gatt.getPrimaryServices()];case 3:return t=i.sent(),[4,(n=new O(t)).createService(s)];case 4:return r=i.sent(),[4,n.createService(b)];case 5:return a=i.sent(),[4,n.createService(V)];case 6:return o=i.sent(),[4,n.createService(D)];case 7:return u=i.sent(),[4,n.createService(A)];case 8:return c=i.sent(),[4,n.createService(_)];case 9:return h=i.sent(),[4,n.createService(q)];case 10:return f=i.sent(),[4,n.createService(R)];case 11:return d=i.sent(),[4,n.createService(I)];case 12:return l=i.sent(),[4,n.createService(P)];case 13:return v=i.sent(),[2,{deviceInformationService:r,buttonService:a,ledService:o,temperatureService:u,accelerometerService:c,magnetometerService:h,uartService:f,eventService:d,dfuControlService:l,ioPinService:v}]}})})},e.requestMicrobit=function(e){return r(void 0,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,e.requestDevice({filters:[{namePrefix:"BBC micro:bit"}],optionalServices:[s.uuid,b.uuid,V.uuid,D.uuid,A.uuid,_.uuid,P.uuid,q.uuid,R.uuid,I.uuid]})];case 1:return[2,t.sent()]}})})},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=microbit.umd.js.map |
var typedoc = typedoc || {}; | ||
typedoc.search = typedoc.search || {}; | ||
typedoc.search.data = {"kinds":{"4":"Enumeration","16":"Enumeration member","64":"Function","128":"Class","256":"Interface","1024":"Property","2048":"Method","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"DeviceInformation","url":"interfaces/deviceinformation.html","classes":"tsd-kind-interface"},{"id":1,"kind":1024,"name":"modelNumber","url":"interfaces/deviceinformation.html#modelnumber","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":2,"kind":1024,"name":"serialNumber","url":"interfaces/deviceinformation.html#serialnumber","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":3,"kind":1024,"name":"firmwareRevision","url":"interfaces/deviceinformation.html#firmwarerevision","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":4,"kind":1024,"name":"hardwareRevision","url":"interfaces/deviceinformation.html#hardwarerevision","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":5,"kind":1024,"name":"manufacturer","url":"interfaces/deviceinformation.html#manufacturer","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":6,"kind":128,"name":"DeviceInformationService","url":"classes/deviceinformationservice.html","classes":"tsd-kind-class"},{"id":7,"kind":2048,"name":"readDeviceInformation","url":"classes/deviceinformationservice.html#readdeviceinformation","classes":"tsd-kind-method tsd-parent-kind-class","parent":"DeviceInformationService"},{"id":8,"kind":4,"name":"ButtonState","url":"enums/buttonstate.html","classes":"tsd-kind-enum"},{"id":9,"kind":16,"name":"Release","url":"enums/buttonstate.html#release","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ButtonState"},{"id":10,"kind":16,"name":"ShortPress","url":"enums/buttonstate.html#shortpress","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ButtonState"},{"id":11,"kind":16,"name":"LongPress","url":"enums/buttonstate.html#longpress","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ButtonState"},{"id":12,"kind":256,"name":"ButtonEvents","url":"interfaces/buttonevents.html","classes":"tsd-kind-interface"},{"id":13,"kind":1024,"name":"buttonastatechanged","url":"interfaces/buttonevents.html#buttonastatechanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ButtonEvents"},{"id":14,"kind":1024,"name":"buttonbstatechanged","url":"interfaces/buttonevents.html#buttonbstatechanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ButtonEvents"},{"id":15,"kind":128,"name":"ButtonService","url":"classes/buttonservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":16,"kind":2048,"name":"readButtonAState","url":"classes/buttonservice.html#readbuttonastate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"ButtonService"},{"id":17,"kind":2048,"name":"readButtonBState","url":"classes/buttonservice.html#readbuttonbstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"ButtonService"},{"id":18,"kind":2048,"name":"addEventListener","url":"classes/buttonservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":19,"kind":2048,"name":"removeEventListener","url":"classes/buttonservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":20,"kind":2048,"name":"dispatchEvent","url":"classes/buttonservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":21,"kind":2048,"name":"addListener","url":"classes/buttonservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":22,"kind":2048,"name":"on","url":"classes/buttonservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":23,"kind":2048,"name":"once","url":"classes/buttonservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":24,"kind":2048,"name":"prependListener","url":"classes/buttonservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":25,"kind":2048,"name":"prependOnceListener","url":"classes/buttonservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":26,"kind":2048,"name":"removeListener","url":"classes/buttonservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":27,"kind":2048,"name":"removeAllListeners","url":"classes/buttonservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":28,"kind":2048,"name":"listeners","url":"classes/buttonservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":29,"kind":2048,"name":"emit","url":"classes/buttonservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":30,"kind":2048,"name":"eventNames","url":"classes/buttonservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":31,"kind":2048,"name":"listenerCount","url":"classes/buttonservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":32,"kind":2048,"name":"setMaxListeners","url":"classes/buttonservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"ButtonService"},{"id":33,"kind":2048,"name":"getMaxListeners","url":"classes/buttonservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"ButtonService"},{"id":34,"kind":128,"name":"LedService","url":"classes/ledservice.html","classes":"tsd-kind-class"},{"id":35,"kind":2048,"name":"writeText","url":"classes/ledservice.html#writetext","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":36,"kind":2048,"name":"readMatrixState","url":"classes/ledservice.html#readmatrixstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":37,"kind":2048,"name":"writeMatrixState","url":"classes/ledservice.html#writematrixstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":38,"kind":2048,"name":"getScrollingDelay","url":"classes/ledservice.html#getscrollingdelay","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":39,"kind":2048,"name":"setScrollingDelay","url":"classes/ledservice.html#setscrollingdelay","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":40,"kind":4194304,"name":"LedMatrix","url":"globals.html#ledmatrix","classes":"tsd-kind-type-alias"},{"id":41,"kind":256,"name":"TemperatureEvents","url":"interfaces/temperatureevents.html","classes":"tsd-kind-interface"},{"id":42,"kind":1024,"name":"temperaturechanged","url":"interfaces/temperatureevents.html#temperaturechanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"TemperatureEvents"},{"id":43,"kind":128,"name":"TemperatureService","url":"classes/temperatureservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":44,"kind":2048,"name":"readTemperature","url":"classes/temperatureservice.html#readtemperature","classes":"tsd-kind-method tsd-parent-kind-class","parent":"TemperatureService"},{"id":45,"kind":2048,"name":"getTemperaturePeriod","url":"classes/temperatureservice.html#gettemperatureperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"TemperatureService"},{"id":46,"kind":2048,"name":"setTemperaturePeriod","url":"classes/temperatureservice.html#settemperatureperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"TemperatureService"},{"id":47,"kind":2048,"name":"addEventListener","url":"classes/temperatureservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":48,"kind":2048,"name":"removeEventListener","url":"classes/temperatureservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":49,"kind":2048,"name":"dispatchEvent","url":"classes/temperatureservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":50,"kind":2048,"name":"addListener","url":"classes/temperatureservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":51,"kind":2048,"name":"on","url":"classes/temperatureservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":52,"kind":2048,"name":"once","url":"classes/temperatureservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":53,"kind":2048,"name":"prependListener","url":"classes/temperatureservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":54,"kind":2048,"name":"prependOnceListener","url":"classes/temperatureservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":55,"kind":2048,"name":"removeListener","url":"classes/temperatureservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":56,"kind":2048,"name":"removeAllListeners","url":"classes/temperatureservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":57,"kind":2048,"name":"listeners","url":"classes/temperatureservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":58,"kind":2048,"name":"emit","url":"classes/temperatureservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":59,"kind":2048,"name":"eventNames","url":"classes/temperatureservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":60,"kind":2048,"name":"listenerCount","url":"classes/temperatureservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":61,"kind":2048,"name":"setMaxListeners","url":"classes/temperatureservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"TemperatureService"},{"id":62,"kind":2048,"name":"getMaxListeners","url":"classes/temperatureservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"TemperatureService"},{"id":63,"kind":256,"name":"AccelerometerData","url":"interfaces/accelerometerdata.html","classes":"tsd-kind-interface"},{"id":64,"kind":1024,"name":"x","url":"interfaces/accelerometerdata.html#x","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"AccelerometerData"},{"id":65,"kind":1024,"name":"y","url":"interfaces/accelerometerdata.html#y","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"AccelerometerData"},{"id":66,"kind":1024,"name":"z","url":"interfaces/accelerometerdata.html#z","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"AccelerometerData"},{"id":67,"kind":256,"name":"AccelerometerEvents","url":"interfaces/accelerometerevents.html","classes":"tsd-kind-interface"},{"id":68,"kind":1024,"name":"accelerometerdatachanged","url":"interfaces/accelerometerevents.html#accelerometerdatachanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"AccelerometerEvents"},{"id":69,"kind":128,"name":"AccelerometerService","url":"classes/accelerometerservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":70,"kind":2048,"name":"readAccelerometerData","url":"classes/accelerometerservice.html#readaccelerometerdata","classes":"tsd-kind-method tsd-parent-kind-class","parent":"AccelerometerService"},{"id":71,"kind":2048,"name":"getAccelerometerPeriod","url":"classes/accelerometerservice.html#getaccelerometerperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"AccelerometerService"},{"id":72,"kind":2048,"name":"setAccelerometerPeriod","url":"classes/accelerometerservice.html#setaccelerometerperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"AccelerometerService"},{"id":73,"kind":2048,"name":"addEventListener","url":"classes/accelerometerservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":74,"kind":2048,"name":"removeEventListener","url":"classes/accelerometerservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":75,"kind":2048,"name":"dispatchEvent","url":"classes/accelerometerservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":76,"kind":2048,"name":"addListener","url":"classes/accelerometerservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":77,"kind":2048,"name":"on","url":"classes/accelerometerservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":78,"kind":2048,"name":"once","url":"classes/accelerometerservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":79,"kind":2048,"name":"prependListener","url":"classes/accelerometerservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":80,"kind":2048,"name":"prependOnceListener","url":"classes/accelerometerservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":81,"kind":2048,"name":"removeListener","url":"classes/accelerometerservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":82,"kind":2048,"name":"removeAllListeners","url":"classes/accelerometerservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":83,"kind":2048,"name":"listeners","url":"classes/accelerometerservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":84,"kind":2048,"name":"emit","url":"classes/accelerometerservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":85,"kind":2048,"name":"eventNames","url":"classes/accelerometerservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":86,"kind":2048,"name":"listenerCount","url":"classes/accelerometerservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":87,"kind":2048,"name":"setMaxListeners","url":"classes/accelerometerservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"AccelerometerService"},{"id":88,"kind":2048,"name":"getMaxListeners","url":"classes/accelerometerservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"AccelerometerService"},{"id":89,"kind":4194304,"name":"AccelerometerPeriod","url":"globals.html#accelerometerperiod","classes":"tsd-kind-type-alias"},{"id":90,"kind":256,"name":"MagnetometerData","url":"interfaces/magnetometerdata.html","classes":"tsd-kind-interface"},{"id":91,"kind":1024,"name":"x","url":"interfaces/magnetometerdata.html#x","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerData"},{"id":92,"kind":1024,"name":"y","url":"interfaces/magnetometerdata.html#y","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerData"},{"id":93,"kind":1024,"name":"z","url":"interfaces/magnetometerdata.html#z","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerData"},{"id":94,"kind":4,"name":"MagnetometerCalibration","url":"enums/magnetometercalibration.html","classes":"tsd-kind-enum"},{"id":95,"kind":16,"name":"unknown","url":"enums/magnetometercalibration.html#unknown","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MagnetometerCalibration"},{"id":96,"kind":16,"name":"requested","url":"enums/magnetometercalibration.html#requested","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MagnetometerCalibration"},{"id":97,"kind":16,"name":"completed","url":"enums/magnetometercalibration.html#completed","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MagnetometerCalibration"},{"id":98,"kind":16,"name":"errored","url":"enums/magnetometercalibration.html#errored","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MagnetometerCalibration"},{"id":99,"kind":256,"name":"MagnetometerEvents","url":"interfaces/magnetometerevents.html","classes":"tsd-kind-interface"},{"id":100,"kind":1024,"name":"magnetometerdatachanged","url":"interfaces/magnetometerevents.html#magnetometerdatachanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerEvents"},{"id":101,"kind":1024,"name":"magnetometerbearingchanged","url":"interfaces/magnetometerevents.html#magnetometerbearingchanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerEvents"},{"id":102,"kind":1024,"name":"magnetometercalibrationchanged","url":"interfaces/magnetometerevents.html#magnetometercalibrationchanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerEvents"},{"id":103,"kind":128,"name":"MagnetometerService","url":"classes/magnetometerservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":104,"kind":2048,"name":"calibrate","url":"classes/magnetometerservice.html#calibrate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":105,"kind":2048,"name":"readMagnetometerData","url":"classes/magnetometerservice.html#readmagnetometerdata","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":106,"kind":2048,"name":"readMagnetometerBearing","url":"classes/magnetometerservice.html#readmagnetometerbearing","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":107,"kind":2048,"name":"getMagnetometerPeriod","url":"classes/magnetometerservice.html#getmagnetometerperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":108,"kind":2048,"name":"setMagnetometerPeriod","url":"classes/magnetometerservice.html#setmagnetometerperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":109,"kind":2048,"name":"addEventListener","url":"classes/magnetometerservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":110,"kind":2048,"name":"removeEventListener","url":"classes/magnetometerservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":111,"kind":2048,"name":"dispatchEvent","url":"classes/magnetometerservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":112,"kind":2048,"name":"addListener","url":"classes/magnetometerservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":113,"kind":2048,"name":"on","url":"classes/magnetometerservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":114,"kind":2048,"name":"once","url":"classes/magnetometerservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":115,"kind":2048,"name":"prependListener","url":"classes/magnetometerservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":116,"kind":2048,"name":"prependOnceListener","url":"classes/magnetometerservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":117,"kind":2048,"name":"removeListener","url":"classes/magnetometerservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":118,"kind":2048,"name":"removeAllListeners","url":"classes/magnetometerservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":119,"kind":2048,"name":"listeners","url":"classes/magnetometerservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":120,"kind":2048,"name":"emit","url":"classes/magnetometerservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":121,"kind":2048,"name":"eventNames","url":"classes/magnetometerservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":122,"kind":2048,"name":"listenerCount","url":"classes/magnetometerservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":123,"kind":2048,"name":"setMaxListeners","url":"classes/magnetometerservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"MagnetometerService"},{"id":124,"kind":2048,"name":"getMaxListeners","url":"classes/magnetometerservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"MagnetometerService"},{"id":125,"kind":4194304,"name":"MagnetometerPeriod","url":"globals.html#magnetometerperiod","classes":"tsd-kind-type-alias"},{"id":126,"kind":256,"name":"UartEvents","url":"interfaces/uartevents.html","classes":"tsd-kind-interface"},{"id":127,"kind":1024,"name":"receive","url":"interfaces/uartevents.html#receive","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"UartEvents"},{"id":128,"kind":1024,"name":"receiveText","url":"interfaces/uartevents.html#receivetext","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"UartEvents"},{"id":129,"kind":128,"name":"UartService","url":"classes/uartservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":130,"kind":2048,"name":"send","url":"classes/uartservice.html#send","classes":"tsd-kind-method tsd-parent-kind-class","parent":"UartService"},{"id":131,"kind":2048,"name":"sendText","url":"classes/uartservice.html#sendtext","classes":"tsd-kind-method tsd-parent-kind-class","parent":"UartService"},{"id":132,"kind":2048,"name":"addEventListener","url":"classes/uartservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":133,"kind":2048,"name":"removeEventListener","url":"classes/uartservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":134,"kind":2048,"name":"dispatchEvent","url":"classes/uartservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":135,"kind":2048,"name":"addListener","url":"classes/uartservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":136,"kind":2048,"name":"on","url":"classes/uartservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":137,"kind":2048,"name":"once","url":"classes/uartservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":138,"kind":2048,"name":"prependListener","url":"classes/uartservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":139,"kind":2048,"name":"prependOnceListener","url":"classes/uartservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":140,"kind":2048,"name":"removeListener","url":"classes/uartservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":141,"kind":2048,"name":"removeAllListeners","url":"classes/uartservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":142,"kind":2048,"name":"listeners","url":"classes/uartservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":143,"kind":2048,"name":"emit","url":"classes/uartservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":144,"kind":2048,"name":"eventNames","url":"classes/uartservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":145,"kind":2048,"name":"listenerCount","url":"classes/uartservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":146,"kind":2048,"name":"setMaxListeners","url":"classes/uartservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"UartService"},{"id":147,"kind":2048,"name":"getMaxListeners","url":"classes/uartservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"UartService"},{"id":148,"kind":256,"name":"MicrobitEvent","url":"interfaces/microbitevent.html","classes":"tsd-kind-interface"},{"id":149,"kind":1024,"name":"type","url":"interfaces/microbitevent.html#type","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MicrobitEvent"},{"id":150,"kind":1024,"name":"value","url":"interfaces/microbitevent.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MicrobitEvent"},{"id":151,"kind":256,"name":"MicrobitEvents","url":"interfaces/microbitevents.html","classes":"tsd-kind-interface"},{"id":152,"kind":1024,"name":"microbitrequirementschanged","url":"interfaces/microbitevents.html#microbitrequirementschanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MicrobitEvents"},{"id":153,"kind":1024,"name":"microbitevent","url":"interfaces/microbitevents.html#microbitevent","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MicrobitEvents"},{"id":154,"kind":128,"name":"EventService","url":"classes/eventservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":155,"kind":2048,"name":"getMicrobitRequirements","url":"classes/eventservice.html#getmicrobitrequirements","classes":"tsd-kind-method tsd-parent-kind-class","parent":"EventService"},{"id":156,"kind":2048,"name":"setClientRequirements","url":"classes/eventservice.html#setclientrequirements","classes":"tsd-kind-method tsd-parent-kind-class","parent":"EventService"},{"id":157,"kind":2048,"name":"readMicrobitEvent","url":"classes/eventservice.html#readmicrobitevent","classes":"tsd-kind-method tsd-parent-kind-class","parent":"EventService"},{"id":158,"kind":2048,"name":"writeClientEvent","url":"classes/eventservice.html#writeclientevent","classes":"tsd-kind-method tsd-parent-kind-class","parent":"EventService"},{"id":159,"kind":2048,"name":"addEventListener","url":"classes/eventservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":160,"kind":2048,"name":"removeEventListener","url":"classes/eventservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":161,"kind":2048,"name":"dispatchEvent","url":"classes/eventservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":162,"kind":2048,"name":"addListener","url":"classes/eventservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":163,"kind":2048,"name":"on","url":"classes/eventservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":164,"kind":2048,"name":"once","url":"classes/eventservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":165,"kind":2048,"name":"prependListener","url":"classes/eventservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":166,"kind":2048,"name":"prependOnceListener","url":"classes/eventservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":167,"kind":2048,"name":"removeListener","url":"classes/eventservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":168,"kind":2048,"name":"removeAllListeners","url":"classes/eventservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":169,"kind":2048,"name":"listeners","url":"classes/eventservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":170,"kind":2048,"name":"emit","url":"classes/eventservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":171,"kind":2048,"name":"eventNames","url":"classes/eventservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":172,"kind":2048,"name":"listenerCount","url":"classes/eventservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":173,"kind":2048,"name":"setMaxListeners","url":"classes/eventservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"EventService"},{"id":174,"kind":2048,"name":"getMaxListeners","url":"classes/eventservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"EventService"},{"id":175,"kind":256,"name":"Services","url":"interfaces/services.html","classes":"tsd-kind-interface"},{"id":176,"kind":1024,"name":"deviceInformationService","url":"interfaces/services.html#deviceinformationservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":177,"kind":1024,"name":"buttonService","url":"interfaces/services.html#buttonservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":178,"kind":1024,"name":"ledService","url":"interfaces/services.html#ledservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":179,"kind":1024,"name":"temperatureService","url":"interfaces/services.html#temperatureservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":180,"kind":1024,"name":"accelerometerService","url":"interfaces/services.html#accelerometerservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":181,"kind":1024,"name":"magnetometerService","url":"interfaces/services.html#magnetometerservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":182,"kind":1024,"name":"uartService","url":"interfaces/services.html#uartservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":183,"kind":1024,"name":"eventService","url":"interfaces/services.html#eventservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":184,"kind":64,"name":"requestMicrobit","url":"globals.html#requestmicrobit","classes":"tsd-kind-function"},{"id":185,"kind":64,"name":"getServices","url":"globals.html#getservices","classes":"tsd-kind-function"}]}; | ||
typedoc.search.data = {"kinds":{"4":"Enumeration","16":"Enumeration member","64":"Function","128":"Class","256":"Interface","1024":"Property","2048":"Method","4194304":"Type alias"},"rows":[{"id":0,"kind":256,"name":"DeviceInformation","url":"interfaces/deviceinformation.html","classes":"tsd-kind-interface"},{"id":1,"kind":1024,"name":"modelNumber","url":"interfaces/deviceinformation.html#modelnumber","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":2,"kind":1024,"name":"serialNumber","url":"interfaces/deviceinformation.html#serialnumber","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":3,"kind":1024,"name":"firmwareRevision","url":"interfaces/deviceinformation.html#firmwarerevision","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":4,"kind":1024,"name":"hardwareRevision","url":"interfaces/deviceinformation.html#hardwarerevision","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":5,"kind":1024,"name":"manufacturer","url":"interfaces/deviceinformation.html#manufacturer","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"DeviceInformation"},{"id":6,"kind":128,"name":"DeviceInformationService","url":"classes/deviceinformationservice.html","classes":"tsd-kind-class"},{"id":7,"kind":2048,"name":"readDeviceInformation","url":"classes/deviceinformationservice.html#readdeviceinformation","classes":"tsd-kind-method tsd-parent-kind-class","parent":"DeviceInformationService"},{"id":8,"kind":4,"name":"ButtonState","url":"enums/buttonstate.html","classes":"tsd-kind-enum"},{"id":9,"kind":16,"name":"Release","url":"enums/buttonstate.html#release","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ButtonState"},{"id":10,"kind":16,"name":"ShortPress","url":"enums/buttonstate.html#shortpress","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ButtonState"},{"id":11,"kind":16,"name":"LongPress","url":"enums/buttonstate.html#longpress","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"ButtonState"},{"id":12,"kind":256,"name":"ButtonEvents","url":"interfaces/buttonevents.html","classes":"tsd-kind-interface"},{"id":13,"kind":1024,"name":"buttonastatechanged","url":"interfaces/buttonevents.html#buttonastatechanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ButtonEvents"},{"id":14,"kind":1024,"name":"buttonbstatechanged","url":"interfaces/buttonevents.html#buttonbstatechanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"ButtonEvents"},{"id":15,"kind":128,"name":"ButtonService","url":"classes/buttonservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":16,"kind":2048,"name":"readButtonAState","url":"classes/buttonservice.html#readbuttonastate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"ButtonService"},{"id":17,"kind":2048,"name":"readButtonBState","url":"classes/buttonservice.html#readbuttonbstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"ButtonService"},{"id":18,"kind":2048,"name":"addEventListener","url":"classes/buttonservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":19,"kind":2048,"name":"removeEventListener","url":"classes/buttonservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":20,"kind":2048,"name":"dispatchEvent","url":"classes/buttonservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":21,"kind":2048,"name":"addListener","url":"classes/buttonservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":22,"kind":2048,"name":"on","url":"classes/buttonservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":23,"kind":2048,"name":"once","url":"classes/buttonservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":24,"kind":2048,"name":"prependListener","url":"classes/buttonservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":25,"kind":2048,"name":"prependOnceListener","url":"classes/buttonservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":26,"kind":2048,"name":"removeListener","url":"classes/buttonservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":27,"kind":2048,"name":"removeAllListeners","url":"classes/buttonservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":28,"kind":2048,"name":"listeners","url":"classes/buttonservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":29,"kind":2048,"name":"emit","url":"classes/buttonservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":30,"kind":2048,"name":"eventNames","url":"classes/buttonservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":31,"kind":2048,"name":"listenerCount","url":"classes/buttonservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"ButtonService"},{"id":32,"kind":2048,"name":"setMaxListeners","url":"classes/buttonservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"ButtonService"},{"id":33,"kind":2048,"name":"getMaxListeners","url":"classes/buttonservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"ButtonService"},{"id":34,"kind":128,"name":"LedService","url":"classes/ledservice.html","classes":"tsd-kind-class"},{"id":35,"kind":2048,"name":"writeText","url":"classes/ledservice.html#writetext","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":36,"kind":2048,"name":"readMatrixState","url":"classes/ledservice.html#readmatrixstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":37,"kind":2048,"name":"writeMatrixState","url":"classes/ledservice.html#writematrixstate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":38,"kind":2048,"name":"getScrollingDelay","url":"classes/ledservice.html#getscrollingdelay","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":39,"kind":2048,"name":"setScrollingDelay","url":"classes/ledservice.html#setscrollingdelay","classes":"tsd-kind-method tsd-parent-kind-class","parent":"LedService"},{"id":40,"kind":4194304,"name":"LedMatrix","url":"globals.html#ledmatrix","classes":"tsd-kind-type-alias"},{"id":41,"kind":256,"name":"TemperatureEvents","url":"interfaces/temperatureevents.html","classes":"tsd-kind-interface"},{"id":42,"kind":1024,"name":"temperaturechanged","url":"interfaces/temperatureevents.html#temperaturechanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"TemperatureEvents"},{"id":43,"kind":128,"name":"TemperatureService","url":"classes/temperatureservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":44,"kind":2048,"name":"readTemperature","url":"classes/temperatureservice.html#readtemperature","classes":"tsd-kind-method tsd-parent-kind-class","parent":"TemperatureService"},{"id":45,"kind":2048,"name":"getTemperaturePeriod","url":"classes/temperatureservice.html#gettemperatureperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"TemperatureService"},{"id":46,"kind":2048,"name":"setTemperaturePeriod","url":"classes/temperatureservice.html#settemperatureperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"TemperatureService"},{"id":47,"kind":2048,"name":"addEventListener","url":"classes/temperatureservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":48,"kind":2048,"name":"removeEventListener","url":"classes/temperatureservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":49,"kind":2048,"name":"dispatchEvent","url":"classes/temperatureservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":50,"kind":2048,"name":"addListener","url":"classes/temperatureservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":51,"kind":2048,"name":"on","url":"classes/temperatureservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":52,"kind":2048,"name":"once","url":"classes/temperatureservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":53,"kind":2048,"name":"prependListener","url":"classes/temperatureservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":54,"kind":2048,"name":"prependOnceListener","url":"classes/temperatureservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":55,"kind":2048,"name":"removeListener","url":"classes/temperatureservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":56,"kind":2048,"name":"removeAllListeners","url":"classes/temperatureservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":57,"kind":2048,"name":"listeners","url":"classes/temperatureservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":58,"kind":2048,"name":"emit","url":"classes/temperatureservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":59,"kind":2048,"name":"eventNames","url":"classes/temperatureservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":60,"kind":2048,"name":"listenerCount","url":"classes/temperatureservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"TemperatureService"},{"id":61,"kind":2048,"name":"setMaxListeners","url":"classes/temperatureservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"TemperatureService"},{"id":62,"kind":2048,"name":"getMaxListeners","url":"classes/temperatureservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"TemperatureService"},{"id":63,"kind":256,"name":"AccelerometerData","url":"interfaces/accelerometerdata.html","classes":"tsd-kind-interface"},{"id":64,"kind":1024,"name":"x","url":"interfaces/accelerometerdata.html#x","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"AccelerometerData"},{"id":65,"kind":1024,"name":"y","url":"interfaces/accelerometerdata.html#y","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"AccelerometerData"},{"id":66,"kind":1024,"name":"z","url":"interfaces/accelerometerdata.html#z","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"AccelerometerData"},{"id":67,"kind":256,"name":"AccelerometerEvents","url":"interfaces/accelerometerevents.html","classes":"tsd-kind-interface"},{"id":68,"kind":1024,"name":"accelerometerdatachanged","url":"interfaces/accelerometerevents.html#accelerometerdatachanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"AccelerometerEvents"},{"id":69,"kind":128,"name":"AccelerometerService","url":"classes/accelerometerservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":70,"kind":2048,"name":"readAccelerometerData","url":"classes/accelerometerservice.html#readaccelerometerdata","classes":"tsd-kind-method tsd-parent-kind-class","parent":"AccelerometerService"},{"id":71,"kind":2048,"name":"getAccelerometerPeriod","url":"classes/accelerometerservice.html#getaccelerometerperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"AccelerometerService"},{"id":72,"kind":2048,"name":"setAccelerometerPeriod","url":"classes/accelerometerservice.html#setaccelerometerperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"AccelerometerService"},{"id":73,"kind":2048,"name":"addEventListener","url":"classes/accelerometerservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":74,"kind":2048,"name":"removeEventListener","url":"classes/accelerometerservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":75,"kind":2048,"name":"dispatchEvent","url":"classes/accelerometerservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":76,"kind":2048,"name":"addListener","url":"classes/accelerometerservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":77,"kind":2048,"name":"on","url":"classes/accelerometerservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":78,"kind":2048,"name":"once","url":"classes/accelerometerservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":79,"kind":2048,"name":"prependListener","url":"classes/accelerometerservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":80,"kind":2048,"name":"prependOnceListener","url":"classes/accelerometerservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":81,"kind":2048,"name":"removeListener","url":"classes/accelerometerservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":82,"kind":2048,"name":"removeAllListeners","url":"classes/accelerometerservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":83,"kind":2048,"name":"listeners","url":"classes/accelerometerservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":84,"kind":2048,"name":"emit","url":"classes/accelerometerservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":85,"kind":2048,"name":"eventNames","url":"classes/accelerometerservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":86,"kind":2048,"name":"listenerCount","url":"classes/accelerometerservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"AccelerometerService"},{"id":87,"kind":2048,"name":"setMaxListeners","url":"classes/accelerometerservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"AccelerometerService"},{"id":88,"kind":2048,"name":"getMaxListeners","url":"classes/accelerometerservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"AccelerometerService"},{"id":89,"kind":4194304,"name":"AccelerometerPeriod","url":"globals.html#accelerometerperiod","classes":"tsd-kind-type-alias"},{"id":90,"kind":256,"name":"MagnetometerData","url":"interfaces/magnetometerdata.html","classes":"tsd-kind-interface"},{"id":91,"kind":1024,"name":"x","url":"interfaces/magnetometerdata.html#x","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerData"},{"id":92,"kind":1024,"name":"y","url":"interfaces/magnetometerdata.html#y","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerData"},{"id":93,"kind":1024,"name":"z","url":"interfaces/magnetometerdata.html#z","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerData"},{"id":94,"kind":4,"name":"MagnetometerCalibration","url":"enums/magnetometercalibration.html","classes":"tsd-kind-enum"},{"id":95,"kind":16,"name":"unknown","url":"enums/magnetometercalibration.html#unknown","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MagnetometerCalibration"},{"id":96,"kind":16,"name":"requested","url":"enums/magnetometercalibration.html#requested","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MagnetometerCalibration"},{"id":97,"kind":16,"name":"completed","url":"enums/magnetometercalibration.html#completed","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MagnetometerCalibration"},{"id":98,"kind":16,"name":"errored","url":"enums/magnetometercalibration.html#errored","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"MagnetometerCalibration"},{"id":99,"kind":256,"name":"MagnetometerEvents","url":"interfaces/magnetometerevents.html","classes":"tsd-kind-interface"},{"id":100,"kind":1024,"name":"magnetometerdatachanged","url":"interfaces/magnetometerevents.html#magnetometerdatachanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerEvents"},{"id":101,"kind":1024,"name":"magnetometerbearingchanged","url":"interfaces/magnetometerevents.html#magnetometerbearingchanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerEvents"},{"id":102,"kind":1024,"name":"magnetometercalibrationchanged","url":"interfaces/magnetometerevents.html#magnetometercalibrationchanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MagnetometerEvents"},{"id":103,"kind":128,"name":"MagnetometerService","url":"classes/magnetometerservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":104,"kind":2048,"name":"calibrate","url":"classes/magnetometerservice.html#calibrate","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":105,"kind":2048,"name":"readMagnetometerData","url":"classes/magnetometerservice.html#readmagnetometerdata","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":106,"kind":2048,"name":"readMagnetometerBearing","url":"classes/magnetometerservice.html#readmagnetometerbearing","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":107,"kind":2048,"name":"getMagnetometerPeriod","url":"classes/magnetometerservice.html#getmagnetometerperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":108,"kind":2048,"name":"setMagnetometerPeriod","url":"classes/magnetometerservice.html#setmagnetometerperiod","classes":"tsd-kind-method tsd-parent-kind-class","parent":"MagnetometerService"},{"id":109,"kind":2048,"name":"addEventListener","url":"classes/magnetometerservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":110,"kind":2048,"name":"removeEventListener","url":"classes/magnetometerservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":111,"kind":2048,"name":"dispatchEvent","url":"classes/magnetometerservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":112,"kind":2048,"name":"addListener","url":"classes/magnetometerservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":113,"kind":2048,"name":"on","url":"classes/magnetometerservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":114,"kind":2048,"name":"once","url":"classes/magnetometerservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":115,"kind":2048,"name":"prependListener","url":"classes/magnetometerservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":116,"kind":2048,"name":"prependOnceListener","url":"classes/magnetometerservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":117,"kind":2048,"name":"removeListener","url":"classes/magnetometerservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":118,"kind":2048,"name":"removeAllListeners","url":"classes/magnetometerservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":119,"kind":2048,"name":"listeners","url":"classes/magnetometerservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":120,"kind":2048,"name":"emit","url":"classes/magnetometerservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":121,"kind":2048,"name":"eventNames","url":"classes/magnetometerservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":122,"kind":2048,"name":"listenerCount","url":"classes/magnetometerservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"MagnetometerService"},{"id":123,"kind":2048,"name":"setMaxListeners","url":"classes/magnetometerservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"MagnetometerService"},{"id":124,"kind":2048,"name":"getMaxListeners","url":"classes/magnetometerservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"MagnetometerService"},{"id":125,"kind":4194304,"name":"MagnetometerPeriod","url":"globals.html#magnetometerperiod","classes":"tsd-kind-type-alias"},{"id":126,"kind":256,"name":"PinData","url":"interfaces/pindata.html","classes":"tsd-kind-interface"},{"id":127,"kind":1024,"name":"pin","url":"interfaces/pindata.html#pin","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PinData"},{"id":128,"kind":1024,"name":"value","url":"interfaces/pindata.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PinData"},{"id":129,"kind":256,"name":"PwmControlData","url":"interfaces/pwmcontroldata.html","classes":"tsd-kind-interface"},{"id":130,"kind":1024,"name":"pin","url":"interfaces/pwmcontroldata.html#pin","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PwmControlData"},{"id":131,"kind":1024,"name":"value","url":"interfaces/pwmcontroldata.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PwmControlData"},{"id":132,"kind":1024,"name":"period","url":"interfaces/pwmcontroldata.html#period","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"PwmControlData"},{"id":133,"kind":4,"name":"AD","url":"enums/ad.html","classes":"tsd-kind-enum"},{"id":134,"kind":16,"name":"Digital","url":"enums/ad.html#digital","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"AD"},{"id":135,"kind":16,"name":"Analogue","url":"enums/ad.html#analogue","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"AD"},{"id":136,"kind":4,"name":"IO","url":"enums/io.html","classes":"tsd-kind-enum"},{"id":137,"kind":16,"name":"Output","url":"enums/io.html#output","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"IO"},{"id":138,"kind":16,"name":"Input","url":"enums/io.html#input","classes":"tsd-kind-enum-member tsd-parent-kind-enum","parent":"IO"},{"id":139,"kind":256,"name":"IoPinEvents","url":"interfaces/iopinevents.html","classes":"tsd-kind-interface"},{"id":140,"kind":1024,"name":"pindatachanged","url":"interfaces/iopinevents.html#pindatachanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"IoPinEvents"},{"id":141,"kind":256,"name":"UartEvents","url":"interfaces/uartevents.html","classes":"tsd-kind-interface"},{"id":142,"kind":1024,"name":"receive","url":"interfaces/uartevents.html#receive","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"UartEvents"},{"id":143,"kind":1024,"name":"receiveText","url":"interfaces/uartevents.html#receivetext","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"UartEvents"},{"id":144,"kind":128,"name":"UartService","url":"classes/uartservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":145,"kind":2048,"name":"send","url":"classes/uartservice.html#send","classes":"tsd-kind-method tsd-parent-kind-class","parent":"UartService"},{"id":146,"kind":2048,"name":"sendText","url":"classes/uartservice.html#sendtext","classes":"tsd-kind-method tsd-parent-kind-class","parent":"UartService"},{"id":147,"kind":2048,"name":"addEventListener","url":"classes/uartservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":148,"kind":2048,"name":"removeEventListener","url":"classes/uartservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":149,"kind":2048,"name":"dispatchEvent","url":"classes/uartservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":150,"kind":2048,"name":"addListener","url":"classes/uartservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":151,"kind":2048,"name":"on","url":"classes/uartservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":152,"kind":2048,"name":"once","url":"classes/uartservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":153,"kind":2048,"name":"prependListener","url":"classes/uartservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":154,"kind":2048,"name":"prependOnceListener","url":"classes/uartservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":155,"kind":2048,"name":"removeListener","url":"classes/uartservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":156,"kind":2048,"name":"removeAllListeners","url":"classes/uartservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":157,"kind":2048,"name":"listeners","url":"classes/uartservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":158,"kind":2048,"name":"emit","url":"classes/uartservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":159,"kind":2048,"name":"eventNames","url":"classes/uartservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":160,"kind":2048,"name":"listenerCount","url":"classes/uartservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"UartService"},{"id":161,"kind":2048,"name":"setMaxListeners","url":"classes/uartservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"UartService"},{"id":162,"kind":2048,"name":"getMaxListeners","url":"classes/uartservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"UartService"},{"id":163,"kind":256,"name":"MicrobitEvent","url":"interfaces/microbitevent.html","classes":"tsd-kind-interface"},{"id":164,"kind":1024,"name":"type","url":"interfaces/microbitevent.html#type","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MicrobitEvent"},{"id":165,"kind":1024,"name":"value","url":"interfaces/microbitevent.html#value","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MicrobitEvent"},{"id":166,"kind":256,"name":"MicrobitEvents","url":"interfaces/microbitevents.html","classes":"tsd-kind-interface"},{"id":167,"kind":1024,"name":"microbitrequirementschanged","url":"interfaces/microbitevents.html#microbitrequirementschanged","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MicrobitEvents"},{"id":168,"kind":1024,"name":"microbitevent","url":"interfaces/microbitevents.html#microbitevent","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"MicrobitEvents"},{"id":169,"kind":128,"name":"EventService","url":"classes/eventservice.html","classes":"tsd-kind-class tsd-has-type-parameter"},{"id":170,"kind":2048,"name":"getMicrobitRequirements","url":"classes/eventservice.html#getmicrobitrequirements","classes":"tsd-kind-method tsd-parent-kind-class","parent":"EventService"},{"id":171,"kind":2048,"name":"setClientRequirements","url":"classes/eventservice.html#setclientrequirements","classes":"tsd-kind-method tsd-parent-kind-class","parent":"EventService"},{"id":172,"kind":2048,"name":"readMicrobitEvent","url":"classes/eventservice.html#readmicrobitevent","classes":"tsd-kind-method tsd-parent-kind-class","parent":"EventService"},{"id":173,"kind":2048,"name":"writeClientEvent","url":"classes/eventservice.html#writeclientevent","classes":"tsd-kind-method tsd-parent-kind-class","parent":"EventService"},{"id":174,"kind":2048,"name":"addEventListener","url":"classes/eventservice.html#addeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":175,"kind":2048,"name":"removeEventListener","url":"classes/eventservice.html#removeeventlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":176,"kind":2048,"name":"dispatchEvent","url":"classes/eventservice.html#dispatchevent","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":177,"kind":2048,"name":"addListener","url":"classes/eventservice.html#addlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":178,"kind":2048,"name":"on","url":"classes/eventservice.html#on","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":179,"kind":2048,"name":"once","url":"classes/eventservice.html#once","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":180,"kind":2048,"name":"prependListener","url":"classes/eventservice.html#prependlistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":181,"kind":2048,"name":"prependOnceListener","url":"classes/eventservice.html#prependoncelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":182,"kind":2048,"name":"removeListener","url":"classes/eventservice.html#removelistener","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":183,"kind":2048,"name":"removeAllListeners","url":"classes/eventservice.html#removealllisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":184,"kind":2048,"name":"listeners","url":"classes/eventservice.html#listeners","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":185,"kind":2048,"name":"emit","url":"classes/eventservice.html#emit","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":186,"kind":2048,"name":"eventNames","url":"classes/eventservice.html#eventnames","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":187,"kind":2048,"name":"listenerCount","url":"classes/eventservice.html#listenercount","classes":"tsd-kind-method tsd-parent-kind-class tsd-has-type-parameter tsd-is-inherited","parent":"EventService"},{"id":188,"kind":2048,"name":"setMaxListeners","url":"classes/eventservice.html#setmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"EventService"},{"id":189,"kind":2048,"name":"getMaxListeners","url":"classes/eventservice.html#getmaxlisteners","classes":"tsd-kind-method tsd-parent-kind-class tsd-is-inherited","parent":"EventService"},{"id":190,"kind":256,"name":"Services","url":"interfaces/services.html","classes":"tsd-kind-interface"},{"id":191,"kind":1024,"name":"deviceInformationService","url":"interfaces/services.html#deviceinformationservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":192,"kind":1024,"name":"buttonService","url":"interfaces/services.html#buttonservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":193,"kind":1024,"name":"ledService","url":"interfaces/services.html#ledservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":194,"kind":1024,"name":"temperatureService","url":"interfaces/services.html#temperatureservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":195,"kind":1024,"name":"accelerometerService","url":"interfaces/services.html#accelerometerservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":196,"kind":1024,"name":"magnetometerService","url":"interfaces/services.html#magnetometerservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":197,"kind":1024,"name":"uartService","url":"interfaces/services.html#uartservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":198,"kind":1024,"name":"eventService","url":"interfaces/services.html#eventservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":199,"kind":1024,"name":"dfuControlService","url":"interfaces/services.html#dfucontrolservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":200,"kind":1024,"name":"ioPinService","url":"interfaces/services.html#iopinservice","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"Services"},{"id":201,"kind":64,"name":"requestMicrobit","url":"globals.html#requestmicrobit","classes":"tsd-kind-function"},{"id":202,"kind":64,"name":"getServices","url":"globals.html#getservices","classes":"tsd-kind-function"}]}; |
@@ -15,2 +15,48 @@ # micro:bit Web Bluetooth | ||
## Device Setup | ||
Your micro:bit needs to be running a program which exposes the bluetooth service you wish to interact with. | ||
Pre-compiled programs exposing bluetooth services are available for testing purposes: | ||
https://github.com/thegecko/microbit-web-bluetooth/tree/master/hex | ||
|Service|[no-magnet-no-io](https://github.com/thegecko/microbit-web-bluetooth/blob/master/hex/ble-open-no-magnet-no-io.hex)|[no-magnet-no-uart](https://github.com/thegecko/microbit-web-bluetooth/blob/master/hex/ble-open-no-magnet-no-uart.hex)|[no-event-no-uart-no-dfu](https://github.com/thegecko/microbit-web-bluetooth/blob/master/hex/ble-open-no-event-no-uart-no-dfu.hex)|[no-event-no-io-no-temp-no-acc](https://github.com/thegecko/microbit-web-bluetooth/blob/master/hex/ble-open-no-event-no-io-no-temp-no-acc.hex)| | ||
|---|---|---|---|---| | ||
|Device Info|✓|✓|✓|✓| | ||
|Button|✓|✓|✓|✓| | ||
|LED|✓|✓|✓|✓| | ||
|Temperature|✓|✓|✓|-| | ||
|Accelerometer|✓|✓|✓|-| | ||
|Event|✓|✓|-|-| | ||
|DFU|✓|✓|-|✓| | ||
|UART|✓|-|-|✓| | ||
|Magnetometer|-|-|✓|✓| | ||
|IO Pin|-|✓|✓|-| | ||
The source for a sample program to do this is [available here](https://github.com/lancaster-university/microbit-samples/tree/master/source/examples/bluetooth-services). | ||
__Note:__ The configuration must mark `bluetooth` as being `open` in order for Web Bluetooth to work. e.g.: | ||
```json | ||
{ | ||
"microbit-dal": { | ||
"bluetooth": { | ||
"enabled": 1, | ||
"pairing_mode": 1, | ||
"private_addressing": 0, | ||
"open": 1, | ||
"whitelist": 1, | ||
"advertising_timeout": 0, | ||
"tx_power": 0, | ||
"dfu_service": 0, | ||
"event_service": 1, | ||
"device_info_service": 1, | ||
"security_level": "SECURITY_MODE_ENCRYPTION_NO_MITM" | ||
}, | ||
"gatt_table_size": "0x700" | ||
} | ||
} | ||
``` | ||
## Usage | ||
@@ -17,0 +63,0 @@ |
{ | ||
"name": "microbit-web-bluetooth", | ||
"version": "0.3.1-next.bbe94a4.0", | ||
"version": "0.4.1-next.c10a634.0", | ||
"description": "Web Bluetooth library for micro:bit", | ||
@@ -32,3 +32,3 @@ "homepage": "https://github.com/thegecko/microbit-web-bluetooth", | ||
"rollup-plugin-delete": "^0.2.2", | ||
"rollup-plugin-livereload": "^1.0.0", | ||
"rollup-plugin-livereload": "^1.0.1", | ||
"rollup-plugin-node-builtins": "^2.1.2", | ||
@@ -35,0 +35,0 @@ "rollup-plugin-serve": "^1.0.1", |
@@ -18,3 +18,2 @@ # micro:bit Web Bluetooth | ||
## Implementation Status | ||
- [x] micro:bit Discovery | ||
@@ -72,10 +71,10 @@ - [x] Service enumeration | ||
### IO Pin Service | ||
- [ ] Pin Data | ||
- [ ] Pin Data Changed Event | ||
- [ ] Pin AD Configuration | ||
- [ ] Pin IO Configuration | ||
- [ ] PWM Control | ||
- [x] Pin Data | ||
- [x] Pin Data Changed Event | ||
- [x] Pin AD Configuration | ||
- [x] Pin IO Configuration | ||
- [x] PWM Control | ||
### DFU Control Service | ||
- [ ] DFU Control | ||
- [ ] Partial Flashing | ||
- [x] Request DFU | ||
- [x] Request Flash Code |
@@ -46,2 +46,4 @@ /* | ||
eventService?: EventService; | ||
dfuControlService?: DfuControlService; | ||
ioPinService?: IoPinService; | ||
} | ||
@@ -120,2 +122,4 @@ | ||
const eventService = await builder.createService(EventService); | ||
const dfuControlService = await builder.createService(DfuControlService); | ||
const ioPinService = await builder.createService(IoPinService); | ||
@@ -131,3 +135,5 @@ return { | ||
eventService, | ||
dfuControlService, | ||
ioPinService | ||
}; | ||
}; |
@@ -123,4 +123,4 @@ /* | ||
public async getAccelerometerPeriod(): Promise<AccelerometerPeriod> { | ||
const value = await this.helper.getCharacteristicValue(AccelerometerCharacteristic.accelerometerPeriod); | ||
return value.getUint16(0, true) as AccelerometerPeriod; | ||
const view = await this.helper.getCharacteristicValue(AccelerometerCharacteristic.accelerometerPeriod); | ||
return view.getUint16(0, true) as AccelerometerPeriod; | ||
} | ||
@@ -127,0 +127,0 @@ |
@@ -115,4 +115,4 @@ /* | ||
public async readButtonAState(): Promise<ButtonState> { | ||
const value = await this.helper.getCharacteristicValue(ButtonCharacteristic.buttonAState); | ||
return value.getUint8(0); | ||
const view = await this.helper.getCharacteristicValue(ButtonCharacteristic.buttonAState); | ||
return view.getUint8(0); | ||
} | ||
@@ -124,4 +124,4 @@ | ||
public async readButtonBState(): Promise<ButtonState> { | ||
const value = await this.helper.getCharacteristicValue(ButtonCharacteristic.buttonBState); | ||
return value.getUint8(0); | ||
const view = await this.helper.getCharacteristicValue(ButtonCharacteristic.buttonBState); | ||
return view.getUint8(0); | ||
} | ||
@@ -128,0 +128,0 @@ |
@@ -63,2 +63,16 @@ /* | ||
} | ||
/** | ||
* Request device switches to DFU mode | ||
*/ | ||
public requestDfu(): Promise<void> { | ||
return this.helper.setCharacteristicValue(DfuCharacteristic.dfuControl, new Uint8Array([1])); | ||
} | ||
/** | ||
* Request flash code | ||
*/ | ||
public requestFlashCode(): Promise<void> { | ||
return this.helper.setCharacteristicValue(DfuCharacteristic.dfuControl, new Uint8Array([2])); | ||
} | ||
} |
@@ -113,4 +113,4 @@ /* | ||
public async getMicrobitRequirements(): Promise<MicrobitEvent> { | ||
const value = await this.helper.getCharacteristicValue(EventCharacteristic.microBitRequirements); | ||
return this.viewToMicrobitEvent(value); | ||
const view = await this.helper.getCharacteristicValue(EventCharacteristic.microBitRequirements); | ||
return this.viewToMicrobitEvent(view); | ||
} | ||
@@ -134,4 +134,4 @@ | ||
public async readMicrobitEvent(): Promise<MicrobitEvent> { | ||
const value = await this.helper.getCharacteristicValue(EventCharacteristic.microBitEvent); | ||
return this.viewToMicrobitEvent(value); | ||
const view = await this.helper.getCharacteristicValue(EventCharacteristic.microBitEvent); | ||
return this.viewToMicrobitEvent(view); | ||
} | ||
@@ -138,0 +138,0 @@ |
@@ -27,2 +27,3 @@ /* | ||
import { ServiceHelper } from "../service-helper"; | ||
import { EventDispatcher, TypedDispatcher } from "../event-dispatcher"; | ||
@@ -40,5 +41,71 @@ /** | ||
/** | ||
* Pin data | ||
*/ | ||
export interface PinData { | ||
/** | ||
* Pin number | ||
*/ | ||
pin: number; | ||
/** | ||
* Pin value | ||
*/ | ||
value: number; | ||
} | ||
/** | ||
* PWM control data | ||
*/ | ||
export interface PwmControlData { | ||
/** | ||
* Pin number | ||
*/ | ||
pin: number; | ||
/** | ||
* Pin value | ||
*/ | ||
value: number; | ||
/** | ||
* Period (in milliseconds) | ||
*/ | ||
period: number; | ||
} | ||
/** | ||
* Analogue/Digital Enum | ||
*/ | ||
export enum AD { | ||
Digital = 0, | ||
Analogue = 1 | ||
} | ||
/** | ||
* Input/Output Enum | ||
*/ | ||
export enum IO { | ||
Output = 0, | ||
Input = 1 | ||
} | ||
/** | ||
* Events raised by the magnetometer service | ||
*/ | ||
export interface IoPinEvents { | ||
/** | ||
* @hidden | ||
*/ | ||
newListener: keyof IoPinEvents; | ||
/** | ||
* @hidden | ||
*/ | ||
removeListener: keyof IoPinEvents; | ||
/** | ||
* Pin data changed event | ||
*/ | ||
pindatachanged: PinData[]; | ||
} | ||
/** | ||
* @hidden | ||
*/ | ||
export class IoPinService { | ||
export class IoPinService extends (EventDispatcher as new() => TypedDispatcher<IoPinEvents>) { | ||
@@ -54,3 +121,5 @@ /** | ||
public static async create(service: BluetoothRemoteGATTService): Promise<IoPinService> { | ||
return new IoPinService(service); | ||
const bluetoothService = new IoPinService(service); | ||
await bluetoothService.init(); | ||
return bluetoothService; | ||
} | ||
@@ -67,4 +136,128 @@ | ||
constructor(service: BluetoothRemoteGATTService) { | ||
this.helper = new ServiceHelper(service); | ||
super(); | ||
this.helper = new ServiceHelper(service, this); | ||
} | ||
private async init() { | ||
await this.helper.handleListener("pindatachanged", IoPinCharacteristic.pinData, this.pinDataChangedHandler.bind(this)); | ||
} | ||
/** | ||
* Read pin data | ||
*/ | ||
public async readPinData(): Promise<PinData[]> { | ||
const view = await this.helper.getCharacteristicValue(IoPinCharacteristic.pinData); | ||
return this.dataViewToPinData(view); | ||
} | ||
/** | ||
* Write pin data | ||
* @param data The pin data to write | ||
*/ | ||
public async writePinData(data: PinData[]): Promise<void> { | ||
const view = this.pinDataToDataView(data); | ||
return this.helper.setCharacteristicValue(IoPinCharacteristic.pinData, view); | ||
} | ||
/** | ||
* Get pin analogue/digital configuration | ||
*/ | ||
public async getAdConfiguration(): Promise<AD[]> { | ||
const view = await this.helper.getCharacteristicValue(IoPinCharacteristic.pinAdConfiguration); | ||
return this.dataViewToConfig(view); | ||
} | ||
/** | ||
* Set pin analogue/digital configuration | ||
* @param config The analogue/digital configuration to set | ||
*/ | ||
public async setAdConfiguration(config: AD[]): Promise<void> { | ||
const view = this.configToDataView(config); | ||
return this.helper.setCharacteristicValue(IoPinCharacteristic.pinAdConfiguration, view); | ||
} | ||
/** | ||
* Get pin input/output configuration | ||
*/ | ||
public async getIoConfiguration(): Promise<IO[]> { | ||
const view = await this.helper.getCharacteristicValue(IoPinCharacteristic.pinIoConfiguration); | ||
return this.dataViewToConfig(view); | ||
} | ||
/** | ||
* Set pin input/output configuration | ||
* @param config The input/output configuration to set | ||
*/ | ||
public async setIoConfiguration(config: IO[]): Promise<void> { | ||
const view = this.configToDataView(config); | ||
return this.helper.setCharacteristicValue(IoPinCharacteristic.pinIoConfiguration, view); | ||
} | ||
/** | ||
* Set pin PWM control | ||
* @param data The PWM control data to set | ||
*/ | ||
public async setPwmControl(data: PwmControlData): Promise<void> { | ||
const view = this.pwmControlDataToDataView(data); | ||
return this.helper.setCharacteristicValue(IoPinCharacteristic.pwmControl, view); | ||
} | ||
private pinDataChangedHandler(event: Event) { | ||
const view = (event.target as BluetoothRemoteGATTCharacteristic).value!; | ||
const value = this.dataViewToPinData(view); | ||
this.dispatchEvent("pindatachanged", value); | ||
} | ||
private dataViewToPinData(view: DataView): PinData[] { | ||
const data = []; | ||
for (let i = 0; i < view.byteLength; i += 2) { | ||
data.push({ | ||
pin: view.getUint8(i), | ||
value: view.getUint8(i + 1) | ||
}); | ||
} | ||
return data; | ||
} | ||
private pinDataToDataView(data: PinData[]): DataView { | ||
const view = new DataView(new ArrayBuffer(data.length * 2)); | ||
data.forEach((pinData, index) => { | ||
view.setUint8(index * 2, pinData.pin); | ||
view.setUint8(index * 2 + 1, pinData.value); | ||
}); | ||
return view; | ||
} | ||
private dataViewToConfig(view: DataView): number[] { | ||
const result: number[] = []; | ||
const value = (view.getUint16(0) << 8) + view.getUint8(2); | ||
for (let i = 0; i < 24; i++) { | ||
result.push(value >> i); | ||
} | ||
return result; | ||
} | ||
private configToDataView(config: number[]): DataView { | ||
const view = new DataView(new ArrayBuffer(3)); | ||
let value = 0; | ||
// tslint:disable-next-line:prefer-for-of | ||
for (let i = 0; i < config.length; i++) { | ||
value &= 1 << config[i]; | ||
} | ||
view.setUint16(0, value >> 8); | ||
view.setUint8(2, value & 0xff); | ||
return view; | ||
} | ||
private pwmControlDataToDataView(data: PwmControlData): DataView { | ||
const view = new DataView(new ArrayBuffer(7)); | ||
view.setUint8(0, data.pin); | ||
view.setUint16(1, data.value); | ||
view.setUint32(3, data.period); | ||
return view; | ||
} | ||
} |
@@ -104,4 +104,4 @@ /* | ||
public async getScrollingDelay(): Promise<number> { | ||
const value = await this.helper.getCharacteristicValue(LedCharacteristic.scrollingDelay); | ||
return value.getUint16(0, true); | ||
const view = await this.helper.getCharacteristicValue(LedCharacteristic.scrollingDelay); | ||
return view.getUint16(0, true); | ||
} | ||
@@ -108,0 +108,0 @@ |
@@ -175,4 +175,4 @@ /* | ||
public async getMagnetometerPeriod(): Promise<MagnetometerPeriod> { | ||
const value = await this.helper.getCharacteristicValue(MagnetometerCharacteristic.magnetometerPeriod); | ||
return value.getUint16(0, true) as MagnetometerPeriod; | ||
const view = await this.helper.getCharacteristicValue(MagnetometerCharacteristic.magnetometerPeriod); | ||
return view.getUint16(0, true) as MagnetometerPeriod; | ||
} | ||
@@ -179,0 +179,0 @@ |
@@ -92,4 +92,4 @@ /* | ||
public async readTemperature(): Promise<number> { | ||
const value = await this.helper.getCharacteristicValue(TemperatureCharacteristic.temperature); | ||
return value.getInt8(0); | ||
const view = await this.helper.getCharacteristicValue(TemperatureCharacteristic.temperature); | ||
return view.getInt8(0); | ||
} | ||
@@ -101,4 +101,4 @@ | ||
public async getTemperaturePeriod(): Promise<number> { | ||
const value = await this.helper.getCharacteristicValue(TemperatureCharacteristic.temperaturePeriod); | ||
return value.getUint16(0, true); | ||
const view = await this.helper.getCharacteristicValue(TemperatureCharacteristic.temperaturePeriod); | ||
return view.getUint16(0, true); | ||
} | ||
@@ -105,0 +105,0 @@ |
@@ -8,4 +8,6 @@ /// <reference types="web-bluetooth" /> | ||
import { MagnetometerService } from "./services/magnetometer"; | ||
import { IoPinService } from "./services/io-pin"; | ||
import { UartService } from "./services/uart"; | ||
import { EventService } from "./services/event"; | ||
import { DfuControlService } from "./services/dfu-control"; | ||
export interface Services { | ||
@@ -20,4 +22,6 @@ deviceInformationService?: DeviceInformationService; | ||
eventService?: EventService; | ||
dfuControlService?: DfuControlService; | ||
ioPinService?: IoPinService; | ||
} | ||
export declare const requestMicrobit: (bluetooth: Bluetooth) => Promise<BluetoothDevice | undefined>; | ||
export declare const getServices: (device: BluetoothDevice) => Promise<Services>; |
@@ -29,2 +29,10 @@ /// <reference types="web-bluetooth" /> | ||
constructor(service: BluetoothRemoteGATTService); | ||
/** | ||
* Request device switches to DFU mode | ||
*/ | ||
requestDfu(): Promise<void>; | ||
/** | ||
* Request flash code | ||
*/ | ||
requestFlashCode(): Promise<void>; | ||
} |
/// <reference types="web-bluetooth" /> | ||
import { ServiceHelper } from "../service-helper"; | ||
import { TypedDispatcher } from "../event-dispatcher"; | ||
/** | ||
@@ -13,5 +14,67 @@ * @hidden | ||
/** | ||
* Pin data | ||
*/ | ||
export interface PinData { | ||
/** | ||
* Pin number | ||
*/ | ||
pin: number; | ||
/** | ||
* Pin value | ||
*/ | ||
value: number; | ||
} | ||
/** | ||
* PWM control data | ||
*/ | ||
export interface PwmControlData { | ||
/** | ||
* Pin number | ||
*/ | ||
pin: number; | ||
/** | ||
* Pin value | ||
*/ | ||
value: number; | ||
/** | ||
* Period (in milliseconds) | ||
*/ | ||
period: number; | ||
} | ||
/** | ||
* Analogue/Digital Enum | ||
*/ | ||
export declare enum AD { | ||
Digital = 0, | ||
Analogue = 1 | ||
} | ||
/** | ||
* Input/Output Enum | ||
*/ | ||
export declare enum IO { | ||
Output = 0, | ||
Input = 1 | ||
} | ||
/** | ||
* Events raised by the magnetometer service | ||
*/ | ||
export interface IoPinEvents { | ||
/** | ||
* @hidden | ||
*/ | ||
newListener: keyof IoPinEvents; | ||
/** | ||
* @hidden | ||
*/ | ||
removeListener: keyof IoPinEvents; | ||
/** | ||
* Pin data changed event | ||
*/ | ||
pindatachanged: PinData[]; | ||
} | ||
declare const IoPinService_base: new () => TypedDispatcher<IoPinEvents>; | ||
/** | ||
* @hidden | ||
*/ | ||
export declare class IoPinService { | ||
export declare class IoPinService extends IoPinService_base { | ||
/** | ||
@@ -33,2 +96,42 @@ * @hidden | ||
constructor(service: BluetoothRemoteGATTService); | ||
private init; | ||
/** | ||
* Read pin data | ||
*/ | ||
readPinData(): Promise<PinData[]>; | ||
/** | ||
* Write pin data | ||
* @param data The pin data to write | ||
*/ | ||
writePinData(data: PinData[]): Promise<void>; | ||
/** | ||
* Get pin analogue/digital configuration | ||
*/ | ||
getAdConfiguration(): Promise<AD[]>; | ||
/** | ||
* Set pin analogue/digital configuration | ||
* @param config The analogue/digital configuration to set | ||
*/ | ||
setAdConfiguration(config: AD[]): Promise<void>; | ||
/** | ||
* Get pin input/output configuration | ||
*/ | ||
getIoConfiguration(): Promise<IO[]>; | ||
/** | ||
* Set pin input/output configuration | ||
* @param config The input/output configuration to set | ||
*/ | ||
setIoConfiguration(config: IO[]): Promise<void>; | ||
/** | ||
* Set pin PWM control | ||
* @param data The PWM control data to set | ||
*/ | ||
setPwmControl(data: PwmControlData): Promise<void>; | ||
private pinDataChangedHandler; | ||
private dataViewToPinData; | ||
private pinDataToDataView; | ||
private dataViewToConfig; | ||
private configToDataView; | ||
private pwmControlDataToDataView; | ||
} | ||
export {}; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1330922
75
4171
79