Custom services not showing up on Android app

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
AWCHEN01
 
Posts: 1
Joined: Tue Jan 31, 2023 7:24 pm

Custom services not showing up on Android app

Post by AWCHEN01 »

Hi,

I have the Adafruit Feather M0 Bluefruit LE.

I'm encountering the same issue as these two posts:
viewtopic.php?t=122349
viewtopic.php?f=22&t=155690

I created a Custom Service with a custom UUID as follows in my setup function:

Code: Select all

// Add the Custom Service definition 
  Serial.println(F("Adding Custom Service definition  "));
  success = ble.sendCommandWithIntReply( F("AT+GATTADDSERVICE=UUID128=dc-5d-81-73-dc-73-4f-11-b0-54-57-14-55-15-b3-b2"), &hrmServiceId);
  if (! success) {
    error(F("Could not add Custom service"));
  }
  
I adapted the sample BluetoothLeGatt application provided by Android to list out all service UUIDs found. Relevant code is as follows:

Code: Select all

@Override
        public void onServicesDiscovered(BluetoothGatt gatt, int status) {
            if (status == BluetoothGatt.GATT_SUCCESS) {
                broadcastUpdate(ACTION_GATT_SERVICES_DISCOVERED);

                List<BluetoothGattService> gattServices = getSupportedGattServices();
                for (BluetoothGattService gattService : gattServices) {
                    Log.i(TAG, "Service UUID Found: " + gattService.getUuid().toString());
                }

            } else {
                Log.w(TAG, "onServicesDiscovered received: " + status);
            }

        }
        
The Logcat output lists the following UUIDs that were found:

Code: Select all

2023-01-31 18:15:37.677 30616-30678/com.example.android.bluetoothlegatt I/BluetoothLeService: Service UUID Found: 00001800-0000-1000-8000-00805f9b34fb
2023-01-31 18:15:37.678 30616-30678/com.example.android.bluetoothlegatt I/BluetoothLeService: Service UUID Found: 00001801-0000-1000-8000-00805f9b34fb
2023-01-31 18:15:37.678 30616-30678/com.example.android.bluetoothlegatt I/BluetoothLeService: Service UUID Found: 00001530-1212-efde-1523-785feabcd123
2023-01-31 18:15:37.678 30616-30678/com.example.android.bluetoothlegatt I/BluetoothLeService: Service UUID Found: 0000180a-0000-1000-8000-00805f9b34fb
2023-01-31 18:15:37.678 30616-30678/com.example.android.bluetoothlegatt I/BluetoothLeService: Service UUID Found: 6e400001-b5a3-f393-e0a9-e50e24dcca9e
2023-01-31 18:15:37.678 30616-30678/com.example.android.bluetoothlegatt I/BluetoothLeService: Service UUID Found: ee0c2080-8786-40ba-ab96-99b91ac981d8
My Custom service UUID is never discovered.

I've tested it on two separate microcontrollers-- same issue comes up both times.


Any suggestions on what is going on?

Locked
Please be positive and constructive with your questions and comments.

Return to “Wireless: WiFi and Bluetooth”