1414import android .view .View ;
1515import android .widget .ProgressBar ;
1616
17- import com .github .douglasjunior .bluetoothclassiclibrary .BluetoothClassicService ;
1817import com .github .douglasjunior .bluetoothclassiclibrary .BluetoothConfiguration ;
1918import com .github .douglasjunior .bluetoothclassiclibrary .BluetoothDeviceDecorator ;
2019import com .github .douglasjunior .bluetoothclassiclibrary .BluetoothService ;
2120import com .github .douglasjunior .bluetoothclassiclibrary .BluetoothStatus ;
21+ import com .github .douglasjunior .bluetoothlowenergylibrary .BluetoothLeService ;
2222
2323import java .util .Arrays ;
2424import java .util .UUID ;
@@ -31,8 +31,8 @@ public class MainActivity extends AppCompatActivity implements BluetoothService.
3131 * Change for the UUID that you want.
3232 */
3333 private static final UUID UUID_DEVICE = UUID .fromString ("00001101-0000-1000-8000-00805f9b34fb" );
34- private static final UUID UUID_SERVICE = UUID .fromString ("35111C00001101-0000-1000-8000-00805F9B34FB " );
35- private static final UUID UUID_CHARACTERISTIC = UUID .fromString ("35111C00001101-0000-1000-8000-00805F9B34FB " );
34+ private static final UUID UUID_SERVICE = UUID .fromString ("e7810a71-73ae-499d-8c15-faa9aef0c3f2 " );
35+ private static final UUID UUID_CHARACTERISTIC = UUID .fromString ("bef8d6c9-9c21-4c9e-b632-bd58c1009f9f " );
3636
3737 private ProgressBar pgBar ;
3838 private Menu mMenu ;
@@ -69,15 +69,15 @@ protected void onCreate(Bundle savedInstanceState) {
6969
7070 BluetoothConfiguration config = new BluetoothConfiguration ();
7171 config .context = getApplicationContext ();
72- config .bluetoothServiceClass = BluetoothClassicService .class ; // or BluetoothClassicService.class
72+ config .bluetoothServiceClass = BluetoothLeService .class ; // BluetoothClassicService.class or BluetoothLeService .class
7373 config .bufferSize = 1024 ;
7474 config .characterDelimiter = '\n' ;
7575 config .deviceName = "Bluetooth Sample" ;
7676 config .transport = BluetoothDevice .TRANSPORT_LE ; // Only for dual-mode devices
7777 //config.uuid = null; // When using BluetoothLeService.class set null to show all devices on scan.
78- config .uuid = UUID_DEVICE ;
79- // config.uuidService = UUID_SERVICE; // For BLE
80- // config.uuidCharacteristic = UUID_CHARACTERISTIC; // For BLE
78+ // config.uuid = UUID_DEVICE;
79+ config .uuidService = UUID_SERVICE ; // For BLE
80+ config .uuidCharacteristic = UUID_CHARACTERISTIC ; // For BLE
8181 config .callListenersInMainThread = true ;
8282 BluetoothService .init (config );
8383
0 commit comments