50ButtonsEach / fliclib-windows

Windows fliclib
23 stars 4 forks source link

Event Notification Callback not called #13

Closed noeldev closed 3 years ago

noeldev commented 3 years ago

Hello,

I am trying to support a single Flic 1 button as an external trigger in an application that I developed for a customer but I am encountering an issue: while I am able to successfully register events for notifications, the callback function is never called whether I press once, twice or many times the Flic button.

My customer has some requirements that prevent me from using any 3rd party executables so I have to rely on the standard Windows Bluetooth API.

The Flic 1 button is successfully paired and connected in Settings > Devices > Bluetooth & other devices as f023dRL3.

Here is a link to the source code of my test program and please find below an example of the output.

Any help would be much appreciated.

Thanks,

-Noël flicdump.txt

Emill commented 3 years ago

Hi. Flic 1 uses a custom cryptographic protocol and it's not enough to simply register for notifications on the GATT characteristics.

If you would like to develop a custom implementation I suggest you to use Flic 2 instead, which we have released our protocol specification for here: https://github.com/50ButtonsEach/flic2-documentation/wiki/Flic-2-Protocol-Specification.

If you would like to use Flic 2 in a much simpler way with Windows, it can be configured to use HID instead (through our app, where you also select what keyboard key it should mimic). That way you need no software at all on the Windows machine, since it can be paired directly in Bluetooth settings.

noeldev commented 3 years ago

Hello,

Thanks for your prompt reply and information about Flic 2.

I have to detect both single and double clicks to support two different actions in the applications so I'm not sure whether HID would allow this or not? Anyway, where can I found your Windows application?

Thanks,

Emill commented 3 years ago

For now HID is easiest configured by our Android or iOS app. This puts the Flic 2 in HID mode. You can then connect it to a Windows computer as a HID device.

You can assign different key codes to click and double click (and hold). This should make it possible to support two different actions.

noeldev commented 3 years ago

I gave your application a try with the sample Flic 1 that I have and even though V1 is not supported, I saw how the application allows to configure the Click, Double-Click and Hold actions. I will now talk to my customer and see which way I have to go. Thanks for your support.