Skip to content

ESP32-C3 ANCS #1033

@demsr

Description

@demsr

Hello,

i'm trying to connect my esp32-c3 to an iphone to subscribe to the Apple Notification Center Service, but information is scarce and i found this snipped of code in this repo but i don't know how to adapt it to use it with NimBLE.

I'm currently not able to make the ESP32 show up in the iPhones BT device list

void _setServiceSolicitation(BLEAdvertisementData *a, BLEUUID uuid)
    {
      char cdata[2];
      switch(uuid.bitSize()) {
        case 16: {
          // [Len] [0x14] [UUID16] data
          cdata[0] = 3;
          cdata[1] = ESP_BLE_AD_TYPE_SOL_SRV_UUID;  // 0x14
          a->addData(std::string(cdata, 2) + std::string((char *)&uuid.getNative()->uuid.uuid16,2));
          break;
        }
    
        case 128: {
          // [Len] [0x15] [UUID128] data
          cdata[0] = 17;
          cdata[1] = ESP_BLE_AD_TYPE_128SOL_SRV_UUID;  // 0x15
          a->addData(std::string(cdata, 2) + std::string((char *)uuid.getNative()->uuid.uuid128,16));
          break;
        }
    
        default:
          return;
      }
    }

This does not seem to do the trick

...
NimBLEAdvertisementData oAdvertisingData = NimBLEAdvertisementData();
oAdvertisingData.setFlags(0x01);
oAdvertisingData.addData(uuid.getValue(), 16);
...

I'm thankful for any hints or tips

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions