Author Topic: Cannot write to lilypad simblee with my android app  (Read 670 times)

dyay108

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Cannot write to lilypad simblee with my android app
« on: April 21, 2016, 06:54:16 AM »
this is the code i'm using to write to the characteristic, but setValue returns false.

Code: [Select]
public boolean writeCharacteristic(BluetoothGattCharacteristic characteristic) {
        if (mBluetoothAdapter == null || mBluetoothGatt == null) {
            Log.w(TAG, "BluetoothAdapter not initialized");
            return false;
        }
        characteristic.setValue(new byte[]{0x02});
        Log.i(TAG, "characteristic " + characteristic.getUuid().toString());
        //Log.i(TAG, "characteristic " + mBluetoothGatt.getServices().get(2).getCharacteristics().get(1).getPermissions());
        boolean status = mBluetoothGatt.writeCharacteristic(mBluetoothGatt.getServices().get(2).getCharacteristics().get(1));
        return status;

    }

code on lilypad:

Code: [Select]
void SimbleeBLE_onReceive(char *data, int len){
    int i = ht.length()+1;
    char hang[i];
    ht.toCharArray(hang,i);
    SimbleeBLE.send(hang,i);
    }
« Last Edit: April 21, 2016, 07:50:14 AM by dyay108 »

dyay108

  • RFduino Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Cannot write to lilypad simblee with my android app
« Reply #1 on: April 25, 2016, 03:26:24 PM »
anyone?

 

anything