Effect of 1.

1.2 READ/NOTIFY/INDICATE/WRITE after connection

2. Use

2.2 the use of

2.2.2 SCAN

// Enable bluetooth mbleadmin.openble (); // Start the search, Set the search callback mBleAdmin. StartScanAllDevice (new ScanCallback () {@ Override public void onDeviceFound (final List < BluetoothDevice >  devices) { Log.e("Found", " " + devices.size()); RunOnUiThread (new Runnable () {@ Override public void the run () {/ / display device to the main thread mRecyclerAdapter. SetDevices (devices); }}); }});Copy the code

2.2.4 the Read

//Enable READ operation
mBleAdmin.processDeviceService(new BleDeviceService(
        mCurrentDeviceAddress, //Connected address of bluetooth to enable read operation
        characteristic.getUuid(), //The eigenvalue of the read operation
        BleDeviceService.OperateType.Read));//Set OperationType to READ
Copy the code

2.2.6 Write/Indicate

mWrite.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mBleAdmin.processDeviceService(new BleDeviceService(
                        mCurrentDeviceAddress,//Address of connected Bluetooth that enables Write
                        UUID.fromString(SampleGattAttributes.INSOLE_WRITE),//Write UUID characteristic value
                        BleDeviceService.OperateType.Write.//OperationType
                        mEditData.getText().toString().getBytes()));//Byte [] value to be written}});Copy the code

Reference 3.

BleBus

FastBle