Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //legacy.js
- nobleBindings.write = function(peripheralUuid, serviceUuid, characteristicUuid, data, withoutResponse) {
- this.sendCBMsg(isLessThan10_8_5 ? 30 : 51, {
- kCBMsgArgPeripheralHandle: this._peripherals[peripheralUuid].handle,
- kCBMsgArgCharacteristicHandle: this._peripherals[peripheralUuid].services[serviceUuid].characteristics[characteristicUuid].handle,
- kCBMsgArgCharacteristicValueHandle: this._peripherals[peripheralUuid].services[serviceUuid].characteristics[characteristicUuid].valueHandle,
- kCBMsgArgData: data,
- kCBMsgArgType: (withoutResponse ? 1 : 0)
- });
- if (withoutResponse) {
- this.emit('write', peripheralUuid, serviceUuid, characteristicUuid);
- }
- };
- //mavericks.js
- nobleBindings.write = function(deviceUuid, serviceUuid, characteristicUuid, data, withoutResponse) {
- this.sendCBMsg(65, {
- kCBMsgArgDeviceUUID: this._peripherals[deviceUuid].uuid,
- kCBMsgArgCharacteristicHandle: this._peripherals[deviceUuid].services[serviceUuid].characteristics[characteristicUuid].handle,
- kCBMsgArgCharacteristicValueHandle: this._peripherals[deviceUuid].services[serviceUuid].characteristics[characteristicUuid].valueHandle,
- kCBMsgArgData: data,
- kCBMsgArgType: (withoutResponse ? 1 : 0)
- });
- if (withoutResponse) {
- this.emit('write', deviceUuid, serviceUuid, characteristicUuid);
- }
- };
- //yosemite.js --> We didn´t do anything here I think...
- nobleBindings.write = function(deviceUuid, serviceUuid, characteristicUuid, data, withoutResponse) {
- this.sendCBMsg(66, {
- kCBMsgArgDeviceUUID: this._peripherals[deviceUuid].uuid,
- kCBMsgArgCharacteristicHandle: this._peripherals[deviceUuid].services[serviceUuid].characteristics[characteristicUuid].handle,
- kCBMsgArgCharacteristicValueHandle: this._peripherals[deviceUuid].services[serviceUuid].characteristics[characteristicUuid].valueHandle,
- kCBMsgArgData: data,
- kCBMsgArgType: (withoutResponse ? 1 : 0)
- });
- if (withoutResponse) {
- this.emit('write', deviceUuid, serviceUuid, characteristicUuid);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement