NordicSemiconductor / Android-nRF-Connect

Documentation and issue tracker for nRF Connect for Android.
1.32k stars 312 forks source link

Macros #180

Closed rileycoyote87 closed 2 years ago

rileycoyote87 commented 2 years ago

I'm trying to understand the macros feature. Am I correct in assuming that it allows you to record a set of operations that happen on the device? For example, turning on and off a bluetooth light bulb? Does it allow you to record the commands another app is sending to the bluetooth device? So in the lightbulb example, using the native app to send the commands, and then using macros to record those commands and replay them to the lightbulb.

I'm asking because I would like to be able to record the control an app uses to control a camera gimbal, and then replay those controls back to the gimbal.

Describe the solution you'd like A clear and concise description of what you want to happen.

Additional context

philips77 commented 2 years ago

No, that can't be done. Only the client (BluetoothGatt) object) that sends data knows what does it send. nRF Connect can only record write operations that are initiated from the UI in the app. Similarly, responses to read operations also go only to the client that initiated the read procedure. However, as notifications don't have a clear target, all clients that enable them using setCharacteristicNotifications(..) will receive them. So nRF Connect can record notifications and indications sent from the device even if the cccd was written by a different app. So you may get a response from a 💡, but not the request sent. You can get the request by using a sniffer or taking hci snoop logs from Developer Settings in Android and resent then from nRF Connect.