This repository was archived by the owner on Mar 17, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ util.inherits(TemperatureCharacteristic, bleno.Characteristic);
3030
3131TemperatureCharacteristic . prototype . onReadRequest = function ( offset , callback ) {
3232 var data = new Buffer ( 8 ) ;
33- data . writeDoubleLE ( this . _lastValue , 0 ) ;
33+ data . writeUInt8 ( this . _lastValue ) ;
3434 callback ( this . RESULT_SUCCESS , data ) ;
3535} ;
3636
@@ -68,7 +68,7 @@ TemperatureCharacteristic.prototype.valueChange = function(value) {
6868 console . log ( "Temperature change " + newValue ) ;
6969
7070 var data = new Buffer ( 8 ) ;
71- data . writeDoubleLE ( newValue , 0 ) ;
71+ data . writeUInt8 ( newValue ) ;
7272
7373 if ( this . _onChange ) {
7474 this . _onChange ( data ) ;
Original file line number Diff line number Diff line change 291291 let data = event . target . value ;
292292 // In Chrome 50+, a DataView is returned instead of an ArrayBuffer.
293293 data = data . buffer ? data : new DataView ( data ) ;
294- let temperature = data . getFloat64 ( 0 , /*littleEndian=*/ true ) ;
294+ let temperature = data . getUint8 ( 0 ) ;
295295 document . querySelector ( '#temp' ) . innerHTML = temperature . toFixed ( 0 ) ;
296296
297297 let date = ( new Date ( ) ) . toString ( ) . replace ( / ^ .* ( \d + : \d + : \d + ) .* $ / , ( match , p ) => p ) ;
You can’t perform that action at this time.
0 commit comments