Wilson

Results 12 comments of Wilson

``` p.addEventListener('didUpdateValueForCharacteristic', _didUpdateValueForCharacteristic); p.setNotifyValueForCharacteristic(true, characteristic); function _didUpdateValueForCharacteristic(e) { Ti.API.info('didUpdateValueForCharacteristic'); Ti.API.info(e); } ``` every time the peripheral updates value, `_didUpdateValueForCharacteristic` will be called

woah, this is a lot, haha, maybe you tell me what are you trying to do and what doesn't work, so that i can pin point the problem and save...

yes you can, so I assume you can get the characteristic now? i think the problem of your code is the way you listen to `_didUpdateValueForCharacteristic`. try listen it here:...

you should be more specific, or I can't help you

1. For now the module hasn't expose uuid for service & characteristic 2. Try move `didDiscoverCharacteristicsForService` & `didUpdateValueForCharacteristic` listeners inside `didDiscoverServices callback` ``` centralManager.addEventListener('didConnectPeripheral', function(e) { connectedPeripheral = e.peripheral; connectedPeripheral.addEventListener('didDiscoverServices',...

@FizixRichard my fault, try this: ``` p.addEventListener('didDiscoverCharacteristicsForService', function(e) { var peripheral = e.peripheral; var characteristics = e.service.characteristics; characteristics.forEach(function(characteristic) { Ti.API.info('Characteristic ID:', characteristic.uuid); if (characteristic.uuid == IA_STATE_UUID) { Ti.API.info('Alert Level Characteristic...

Yea, I think I'll make a PR for that This is how I do it: ``` e.service.characteristics.forEach(function(characteristic) { p.writeValueForCharacteristicWithType(toBlob('hello world, I\'m ' + Ti.Platform.username), characteristic, BLE.CHARACTERISTIC_PROPERTY_WRITE_WITH_RESPONSE); }); function toBlob(str) {...

Did it go into 'Alert Level Characteristic Found' here?

are you using the latest version? 1.3.0

@focussing so what did you get from `ti.bluetooth` ? I never advertise 2 services from a peripheral before