eddystone-characteristics.js
function TxPowerModeCharateristic(opts) {
	TxPowerModeCharateristic.super_.call(this, objectAssign({
		uuid: 'ee0c2087-8786-40ba-ab96-99b91ac981d8',
		properties: ['read', 'write'],
		sizeof: 1
	}, opts));

	this.removeAllListeners('beforeWrite');

	this.on('beforeWrite', function(data, res) {
		var err = Results.Success;
		var value = this.fromBuffer(data);
		if (data.length !== 1) {
			err = Results.InvalidAttributeLength;
		} else if (value < TxPowerMode.Lowest || value > TxPowerMode.High) {
			err = Results.WriteNotPermitted;
		}

		res(err);
	});
}
function TxPowerModeCharateristic(opts) {
	TxPowerModeCharateristic.super_.call(this, objectAssign({
		uuid: 'ee0c2087-8786-40ba-ab96-99b91ac981d8',
		properties: ['read', 'write'],
		sizeof: 1
	}, opts));

	this.removeAllListeners('beforeWrite');

	this.on('beforeWrite', function(data, res) {
		var err = Results.Success;
		var value = this.fromBuffer(data);
		if (data.length !== 1) {
			err = Results.InvalidAttributeLength;
		} else if (value < TxPowerMode.Lowest || value > TxPowerMode.High) {
			err = Results.WriteNotPermitted;
		}

		res(err);
	});
}
function TxPowerModeCharateristic ( opts ) { TxPowerModeCharateristic . super_ . call ( this , objectAssign ( { uuid : 'ee0c2087-8786-40ba-ab96-99b91ac981d8' , properties : [ 'read' , 'write' ] , sizeof : 1 } , opts ) ) ; this . removeAllListeners ( 'beforeWrite' ) ; this . on ( 'beforeWrite' , function ( data , res ) { var err = Results . Success ; var value = this . fromBuffer ( data ) ; if ( data . length !== 1 ) { err = Results . InvalidAttributeLength ; } else if ( value < TxPowerMode . Lowest || value > TxPowerMode . High ) { err = Results . WriteNotPermitted ; } res ( err ) ; } ) ; }
tx power mode characteristic
tx power mode characteristic