eclipse / mita

mita
Eclipse Public License 2.0
55 stars 20 forks source link

BLE characteristic are initialized with weird number and can't modify them until we connect #85

Open xAlban opened 6 years ago

xAlban commented 6 years ago

When I initialize some BLE characteristic, the values of each are some weird numbers :

Mita code :

setup bluetooth : BLE { deviceName = "XDK_BLE"; advertisingInterval = 2000; var yellow = bool_characteristic(0x0001); var orange = bool_characteristic(0x0002); var red = bool_characteristic(0x0003); }

I print yellow, orange and red after initialization and I get this :

capture d ecran 2018-05-24 a 10 44 44

Even if I try to change those values with write() they don't change unless I connect with my phone on the XDK.

wegendt-bosch commented 6 years ago

@priyashiyadav:

csweichel commented 6 years ago

would it make sense to add a default argument to the signal? E.g.

setup bluetooth : BLE {
    deviceName = "XDK_BLE";
    advertisingInterval = 2000;
    var yellow = bool_characteristic(0x0001, default=true);
    var orange = bool_characteristic(0x0002, default=false);
    var red = bool_characteristic(0x0003, default=true);
}
priyashiyadav commented 6 years ago

@32leaves how will default argument help ?

wegendt-bosch commented 6 years ago

These values would be used to initialize the BLE storage variables. Maybe „init“ would be a better name?