Android Question BLE smart watch: bleKeyboard.press(KEY_MEDIA_VOLUME_UP) equivalent code?

In ESP32 BLE Keyboard library, I can take photo from mobile if I send following command:

C-like:
#include <BleKeyboard.h>
digitalWrite(OUTPUT_PIN, peak);
    //To click photo 
    if(peak){
      bleKeyboard.press(KEY_MEDIA_VOLUME_UP);
      bleKeyboard.release(KEY_MEDIA_VOLUME_UP);
    }

I have a 'Noise' BLE 'Smart watch'. Is it possible to send BLE write signal equivalent to
bleKeyboard.press(KEY_MEDIA_VOLUME_UP);
bleKeyboard.release(KEY_MEDIA_VOLUME_UP);
If yes, show how to do it?
 
Are you able to connect to the watch with the BLE example?
Thank you I was able to connect to nrf app and it shows the uuids. Unfortunately, the BLE example doesn't install. I get this error:
--------- beginning of main
Using CollectorTypeCMC GC.
Not starting debugger since process cannot load the jdwp agent.
android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Linux.open(Native Method)
at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8310)
at android.system.Os.open(Os.java:494)
at android.os.perfdebug.PerfDebugMonitorImpl.monitorVersionControl(PerfDebugMonitorImpl.java:204)
at android.os.perfdebug.PerfDebugMonitorImpl.prepareMonitor(PerfDebugMonitorImpl.java:185)
at android.app.ActivityThread.main(ActivityThread.java:8397)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:560)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
Load libmiui_runtime
Compat change id reported: 171979766; UID 10462; state: ENABLED
Configuring clns-4 for other apk /data/app/~~dEYl9GfZEQb8dNRY6aeqaQ==/b4a.example-5h6ttW7IzUGb2pOaxkn7xg==/base.apk. target_sdk_version=31, uses_libraries=, library_path=/data/app/~~dEYl9GfZEQb8dNRY6aeqaQ==/b4a.example-5h6ttW7IzUGb2pOaxkn7xg==/lib/arm64, permitted_path=/data:/mnt/expand:/data/user/0/b4a.example
24688-ScoutStateMachinecreated
Connecting to perf service.
ANGLE Developer option for 'b4a.example' set to: 'default'
ANGLE GameManagerService for b4a.example: false
Neither updatable production driver nor prerelease driver is supported.
initialize for b4a.example , ForceDarkOrigin
JNI_OnLoad success
setConfig density:2.750000, mainRule:0, secondaryRule:0, tertiaryRule:0
No Network Security Config specified, using platform default
No Network Security Config specified, using platform default
MiuiMultiWindowAdapter::getFreeformVideoWhiteListInSystem::LIST_ABOUT_SUPPORT_LANDSCAPE_VIDEO = [com.hunantv.imgo.activity, com.tencent.qqlive, com.qiyi.video, com.hunantv.imgo.activity.inter, com.tencent.qqlivei18n, com.iqiyi.i18n, tv.danmaku.bili]
Access denied finding property "ro.vendor.df.effect.conflict"
common created.
Starting remote logger. Port: 35352
tagSocket(93) with statsTag=0xffffffff, statsUid=-1
false
false
getWindowModeFromSystem windowmode is 1
getCustomizedIconW 168
Compat change id reported: 210923482; UID 10462; state: DISABLED
Compat change id reported: 37756858; UID 10462; state: ENABLED
 
Upvote 0
Unfortunately, the 'Noise' BLE smartwatch likely doesn't support sending keyboard commands like a BLE keyboard would. It's designed for specific functions like notifications and fitness tracking. You might need a different device or approach to achieve volume control via BLE. Keep exploring options, and you'll find a solution that fits your needs!
Ok. There is a button on menu which when clicked activates the camera click on the mobile. Can this camera button BLE command be intercepted?
 
Upvote 0
Further test shows that none of the code (even default) gets connected . I start installing in debug mode. As soon as the app is installed in mobile, the debug stops so obviously when the app opens, there is no UI atall since it is still waiting to connect to debug. How to prevent debug stopping?
 
Upvote 0
Thank you I was able to connect to nrf app and it shows the uuids. Unfortunately, the BLE example doesn't install. I get this error:
For any one facing the same problem, please switch off your WiFi extender. I found that after switching off my WiFi extender, the debug worked. Even if you are not connected to the WiFi extender SSID, I guess some ip conflict occurs, so debug doesn't work.
 
Upvote 0
Top