I am using BLEPeripheral.h , MySensors.h library and nRF51822 evolution kit device,
I want functionality like if I press the key of an nRF51822 device should start to advertise otherwise connect to another device (nodeMCU and nRF24L01) which is act as a gateway.
Here MySensors.h is working fine but BLEPeripheral.h is not working means device is not advertising.
I tried both libraries separately it is working fine.
You have some libraries that you did not post links to. You are using them in some code you didn't post, running on hardware that you did not fully describe (with links). The code does something that you did not describe. You expect it to do something, but were not clear in describing what that was.
When you disrupt serial communications by using one of the hardware serial pins for some other purpose, you have NO way of knowing what the program is doing. So, you can draw NO conclusions about what is, or is not, happening. GET THAT LED OFF THE HARDWARE SERIAL PIN!
I changed the pin number to 19, still getting the same problem, I am getting your point but I don't know how to resolve the issue. thanks for your reply and your valuable time.