Please have a look at the ArduinoBLE reference. The setEventHandler is only supported on the peripheral not a central device.
https://www.arduino.cc/en/Reference/ArduinoBLEBLECharacteristicsetEventHandler
As gerrikoio stated for notification to work you need to:
- declare characteristic on the peripheral with BLENotify
- the central subscribe to the characteristic
- the central check the valueUpdated()
- central call readValue()
Note, BLE is not symmetrical. This is reflected in the function/methods names. When a central writes a characteristic, the value is written on the peripheral. When a peripheral writes a characteristic, the value is updated on the peripheral.
When a central describes to a characteristic, it can choose to read the value when it is updated by the peripheral. The central will get the notification automatically but not the updated value itself. The central needs to read the characteristic. For instance, it could chose to only read the characteristic every hour even if the value is updated every second. This will save battery life and allow a longer lifetime.