I´m currently developing an BLE application
, based on the Gatt sample project provided by Google.
What I want to realize is to send a notification from my Android
device(smartphone) to another BLE
device(e.g. TI CC2540). There are many discussion about how to receive a notification on the Internet.
However, I can't find out any discussions about sending a notification. So is there any method to sending a notification through Android device? Thank you in advance.
Technically, there is a difference between the Central/Peripheral classification, which belongs to the GAP, and the Client/Server one, which belongs to the GATT. A Central (one that scans and connects) is usually a Client, and the Peripheral (one that advertises) is usually a Server, but not necessarily.
The smartphone is the Central (it can be Peripheral as of Android 5.0 but I doubt that's the case for you), and usually it's the Client because it connects to GATT Servers located on Peripherals such as your sensor (or whatever you are building).
So, if you want to send a Notification from your device you need 2 things:
This may not be necessary, as @istirbu pointed out. If your application is already up-and-running, your smartphone Central is a Client. The equivalent of a Notification at Client-side is the Write Command (without response). So use that.