Please Help me this function doesn't fire from the periperical?

Please post your complete program in one posting.

Your code looks similar to the LED peripheral example code of the ArduinoBLE.h library.

What is the central/server? What is sending the value to the peripheral. Is it a phone? Android or iphone? What app?

To start with, I would certainly get the library example code working with a phone running nrfConnect.