SteveTerrell Active Member Licensed User Longtime User Dec 15, 2015 #1 Hi, I am using a Texas SensorTag(mk 2) with Android 6 and latest B4A. The BLE demo program works well and is a great starting point, thanks. The optical sensor service appears to be : f000aa70-0451-4000-b000-000000000000 and there are 3 Characteristics DataAA71*R/N2LightLSB:LightMSB ConfigurationAA72*R/W1Write 0x01 to enable data collection, 0x00 to disable. PeriodAA73*R/W1Resolution 10 ms. Range 100 ms (0x0A) to 2.55 sec (0xFF). Default is 800 milliseconds (0x50). Click to expand... I can enable the optical sensor with a WriteData to AA72. Code: manager.WriteData("f000aa70-0451-4000-b000-000000000000","f000aa72-0451-4000-b000-000000000000",Array As Byte(1)) When I use ReadData2 to get the sensor value (its in aa71) using Code: manager.ReadData2("f000aa70-0451-4000-b000-000000000000","f000aa71-0451-4000-b000-000000000000") I get a Map back in Manager_DataAvailable with all three characteristics (aa71, aa72 and aa73) and their values. Does anyone know if this is this as it should be? I expected just the requested Characteristic (aa71) back. Steve
Hi, I am using a Texas SensorTag(mk 2) with Android 6 and latest B4A. The BLE demo program works well and is a great starting point, thanks. The optical sensor service appears to be : f000aa70-0451-4000-b000-000000000000 and there are 3 Characteristics DataAA71*R/N2LightLSB:LightMSB ConfigurationAA72*R/W1Write 0x01 to enable data collection, 0x00 to disable. PeriodAA73*R/W1Resolution 10 ms. Range 100 ms (0x0A) to 2.55 sec (0xFF). Default is 800 milliseconds (0x50). Click to expand... I can enable the optical sensor with a WriteData to AA72. Code: manager.WriteData("f000aa70-0451-4000-b000-000000000000","f000aa72-0451-4000-b000-000000000000",Array As Byte(1)) When I use ReadData2 to get the sensor value (its in aa71) using Code: manager.ReadData2("f000aa70-0451-4000-b000-000000000000","f000aa71-0451-4000-b000-000000000000") I get a Map back in Manager_DataAvailable with all three characteristics (aa71, aa72 and aa73) and their values. Does anyone know if this is this as it should be? I expected just the requested Characteristic (aa71) back. Steve
Erel B4X founder Staff member Licensed User Longtime User Dec 15, 2015 #2 Yes, this is the expected result. It returns the current known values of all the characteristics. It only actually read the value of the given characteristic. Upvote 0
Yes, this is the expected result. It returns the current known values of all the characteristics. It only actually read the value of the given characteristic.
SteveTerrell Active Member Licensed User Longtime User Dec 15, 2015 #3 Thanks, useful information. Steve Upvote 0