HID Functionality in Nano RP2040 Connect?

Hello all,

I am hoping to create a bluetooth mouse HID device using Nano RP2040 Connect. It doesn't seem there is any HID API built-in to ArduinoCore-mbed or any example on how to do it.

I was able to make it appear as a bluetooth device to my windows 10 computer using ArduinoBLE library but I can't figure out how make it appear as HID Mouse device and then pair. I can't seem to find the pairing process. Is there the functionality to do HID Mouse as of now or it's under development?

The code which i tried:

#include <ArduinoBLE.h>

BLEService hidService("1812");  
BLECharCharacteristic bootModeProtocol("2A42", BLERead | BLEWriteWithoutResponse);
BLECharacteristic bootMouseReport("2A33", BLERead | BLENotify,3);
BLECharacteristic hidInformation("2A4A",BLERead, 4 );
BLECharacteristic reportMap("2A4B", BLERead,50);
BLECharCharacteristic controlPoint("2A4C",BLEWriteWithoutResponse);
BLECharacteristic mouseReport("2A4D", BLERead | BLENotify, 3);

BLEService batteryService("180F");
BLECharCharacteristic batteryLevel("2A19", BLERead);

//Device Information Service
BLEService deviceInformation("180A");
BLECharacteristic pnpID("2A50", BLERead, 7);

void setup() {

  Serial.begin(9600);
  if (!BLE.begin()) {
    Serial.println("Starting BLE failed!");
  }

  //Set advertised local name and service UUID:

  BLE.setLocalName("HID-Mouse");

  BLE.setAdvertisedService(hidService);

 hidService.addCharacteristic(bootMouseReport);

  hidService.addCharacteristic(bootModeProtocol);
  hidService.addCharacteristic(hidInformation);
  hidService.addCharacteristic(reportMap);
  hidService.addCharacteristic(controlPoint);
  hidService.addCharacteristic(mouseReport);


  //Battery service and characteristic
  BLE.setAdvertisedService(batteryService);
  batteryService.addCharacteristic(batteryLevel);

  //Device Information
  //hidService.addCharacteristic(deviceInformation);
  hidService.addCharacteristic(pnpID);
  BLE.addService(hidService);


  BLE.advertise();

}

I would appreciate any help.

Thanks

Welcome to the forum.

The ArduinoBLE library does not support pairing. Pairing is an optional feature in BLE and not required for most applications.

I have seen mbedOS examples for HID devices but do not know what effort is required to get these working on the Arduino Nano RP2040 Connect.

Try Google "mbedOS HID over GATT"