Skip to content

Commit

Permalink
Merge pull request #130 from mdwoolley/master
Browse files Browse the repository at this point in the history
Include devices known but not paired. Interpret Texas Instruments Sensor Tags service UUIDs.
  • Loading branch information
pelegri committed Aug 9, 2013
2 parents 92b0162 + 6b67764 commit 8eee9c0
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions bluetoothgatt/src/BluetoothGatt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ void BluetoothGatt::refreshDevices()
int device_type = 0;

// Retrieve and show all paired devices.
remote_device_array = bt_disc_retrieve_devices(BT_DISCOVERY_PREKNOWN, 0);
remote_device_array = bt_disc_retrieve_devices(BT_DISCOVERY_ALL, 0);
if (remote_device_array) {
for (int i = 0; 0 != (next_remote_device = remote_device_array[i]); ++i) {
device_type = bt_rdev_get_type(next_remote_device);
Expand Down Expand Up @@ -411,7 +411,38 @@ void BluetoothGatt::viewServices(int which)
} else {
map["uuid"] = services_array[i];
}
map["name"] = Util::parse_service_uuid( services_array[i] );
int got_svc_name=0;
if ( strcmp(services_array[i],"0xF000AA00-0451-4000-B000-000000000000") == 0) {
map["name"] = "TI IR Temperature Service";
got_svc_name = 1;
}
if ( strcmp(services_array[i],"0xF000AA10-0451-4000-B000-000000000000") == 0) {
map["name"] = "TI Accelerometer Service";
got_svc_name = 1;
}
if ( strcmp(services_array[i],"0xF000AA20-0451-4000-B000-000000000000") == 0) {
map["name"] = "TI Humidity Service";
got_svc_name = 1;
}
if ( strcmp(services_array[i],"0xF000AA30-0451-4000-B000-000000000000") == 0) {
map["name"] = "TI Magnetometer Service";
got_svc_name = 1;
}
if ( strcmp(services_array[i],"0xF000AA40-0451-4000-B000-000000000000") == 0) {
map["name"] = "TI Barometer Service";
got_svc_name = 1;
}
if ( strcmp(services_array[i],"0xF000AA50-0451-4000-B000-000000000000") == 0) {
map["name"] = "TI Gyroscope Service";
got_svc_name = 1;
}
if ( strcmp(services_array[i],"0xF000AA60-0451-4000-B000-000000000000") == 0) {
map["name"] = "TI Test Service";
got_svc_name = 1;
}
if (got_svc_name == 0) {
map["name"] = Util::parse_service_uuid( services_array[i] );
}
map["connected"] = false;
m_services->append(map);

Expand Down

0 comments on commit 8eee9c0

Please sign in to comment.