1919import butterknife .Bind ;
2020import butterknife .ButterKnife ;
2121import uk .co .alt236 .bluetoothlelib .device .BluetoothLeDevice ;
22+ import uk .co .alt236 .bluetoothlelib .device .BluetoothService ;
2223import uk .co .alt236 .bluetoothlelib .device .adrecord .AdRecord ;
2324import uk .co .alt236 .bluetoothlelib .device .mfdata .IBeaconManufacturerData ;
2425import uk .co .alt236 .bluetoothlelib .resolvers .CompanyIdentifierResolver ;
@@ -56,6 +57,7 @@ private void appendDeviceInfo(final MergeAdapter adapter, final BluetoothLeDevic
5657 final TextView tvAddress = (TextView ) lt .findViewById (R .id .deviceAddress );
5758 final TextView tvClass = (TextView ) lt .findViewById (R .id .deviceClass );
5859 final TextView tvMajorClass = (TextView ) lt .findViewById (R .id .deviceMajorClass );
60+ final TextView tvServices = (TextView ) lt .findViewById (R .id .deviceServiceList );
5961 final TextView tvBondingState = (TextView ) lt .findViewById (R .id .deviceBondingState );
6062
6163 tvName .setText (device .getName ());
@@ -64,6 +66,24 @@ private void appendDeviceInfo(final MergeAdapter adapter, final BluetoothLeDevic
6466 tvMajorClass .setText (device .getBluetoothDeviceMajorClassName ());
6567 tvBondingState .setText (device .getBluetoothDeviceBondState ());
6668
69+ final String supportedServices ;
70+ if (device .getBluetoothDeviceKnownSupportedServices ().isEmpty ()){
71+ supportedServices = getString (R .string .no_known_services );
72+ } else {
73+ final StringBuilder sb = new StringBuilder ();
74+
75+ for (final BluetoothService service : device .getBluetoothDeviceKnownSupportedServices ()){
76+ if (sb .length () > 0 ){
77+ sb .append (", " );
78+ }
79+
80+ sb .append (service );
81+ }
82+ supportedServices = sb .toString ();
83+ }
84+
85+ tvServices .setText (supportedServices );
86+
6787 adapter .addView (lt );
6888 }
6989
0 commit comments