Notifications/what is significant

Discuss mobile apps for Texas Instruments products.
Posts: 1
Joined: 06:14, 28 Dec 2014

Notifications/what is significant

Postby zook » 00:10, 03 Jan 2015


Firstly, my thanks to the developers at evothings - I think it's awesome!
I'm having some difficulty trying to set the change of characteristics I need to be notified for.
In particular I need ios and android phones to be notified when gyroscopes and accelerometers in the sensor tag pass set limits.
I'm having trouble setting said limits.
I've been playing with java, obj-c/swift and javascript (which is probably just adding to the confusion!)
Any pointers as to where to look next would be great.

Code: Select all

/* java  */

        public void onCharacteristicChanged(BluetoothGatt gatt,
                                            BluetoothGattCharacteristic characteristic) //todo
            broadcastUpdate(ACTION_DATA_AVAILABLE, characteristic);

    private void broadcastUpdate(final String action)
        final Intent intent = new Intent(action);

    private void broadcastUpdate(final String action,
                                 final BluetoothGattCharacteristic characteristic) //todo
        final Intent intent = new Intent(action);

        final byte[] data = characteristic.getValue();

        if (data != null && data.length > 0) //todo
            final StringBuilder stringBuilder = new StringBuilder(data.length);
            for (byte byteChar : data)
                stringBuilder.append(String.format("%02X ", byteChar));
            intent.putExtra(EXTRA_DATA, new String(data) + "\n" + stringBuilder.toString());

/* js */

    instance.accelerometerCallback = function(fun, interval)
            instance.accelerometerFun = fun
            instance.accelerometerConfig = 1 // on
            instance.accelerometerInterval = interval

            return instance

/*  ios */

+(bool) isCharacteristicNotifiable:(CBPeripheral *)peripheral sCBUUID:(CBUUID *)sCBUUID cCBUUID:(CBUUID *) cCBUUID {
    for ( CBService *service in ) {
        if ([service.UUID isEqual:sCBUUID]) {
            for (CBCharacteristic *characteristic in service.characteristics ) {
                if ([characteristic.UUID isEqual:cCBUUID])
                    if ( & CBCharacteristicPropertyNotify) return YES;
                    else return NO;
    return NO;

User avatar
Posts: 256
Joined: 20:49, 18 Nov 2013

Re: Notifications/what is significant

Postby micke » 16:38, 05 Jan 2015

Hi Zook,

Have you looked at the "TI SensorTag Sensors" example that comes with Evothings Studio? ... nsors.html

This example shows how to read all sensors. You could strip it down to use only the sensors you need. Then build a native Cordova app for the final version to publish.

If you use Nexus 7, be aware of this issue: ... issues/106

Let me know how it goes.

Best, Mikael

Return to “Texas Instruments”

Who is online

Users browsing this forum: No registered users and 5 guests