-1

I use the BLED112 and want to make it act like a HID keyboard.

The BLED112 receives the keystroke from the Mobile. For example, "p". Then the dongle act like a keyboard so we can see the "p" is written on Notepad of PC.

Sending data from Mobile to dongle is not matter. I have already done.

My problem is to send the keystroke event to the PC so the dongle works like a keyboard.

I want an example or the full guide.

Thanks.

WedaPashi
  • 3,561
  • 26
  • 42
  • *"..to send the keystroke event to the PC so the dongle works like a keyboard"*, as in you type from mobile connected over BLE with a BLED112? So, you type "apple" on mobile and your notepad should display "apple". Is that you are trying to achieve? – WedaPashi Nov 30 '20 at 10:38
  • If Yes, ask yourself this question -- "How does my notepad application know that the BLED112 has received some keystrokes?" – WedaPashi Nov 30 '20 at 10:39
  • Thanks for your reply. Yes. "How does my notepad application know that the BLED112 has received some keystrokes?" – Ashya Davydov Nov 30 '20 at 12:01
  • [This](https://learn.microsoft.com/en-us/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-start-an-application-and-send-it-keystrokes) article shows the way to send an application some keystrokes. You can save keystrokes received from BLED112 into a file and use the example code in the article to get them in notepad by reading the file. – WedaPashi Nov 30 '20 at 12:59
  • Thanks. But I don't want any third party application or method. Could you offer me another solution? – Ashya Davydov Nov 30 '20 at 18:33
  • Third party? The link I have shared is a microsoft documentation. And if I am mistaken and you are referring to notepad as a third party application then you have write your own application/program to read the file. – WedaPashi Dec 01 '20 at 05:15

1 Answers1

0

BLED112 is a Bluetooth Low Energy dongle provided by Bluegiga (Now acquired by Silicon labs). If you have studied the BLED112 user manual and bluegiga API reference documents, you'd understand that there can be two possible ways to read/write data via BLED112:

  • Use bgscript
  • use the bglib library into your C/C++ application

BLED112 is enumerated as a virual com port. I don't recall the name of the windows application that comes with BLED112 but it sounded like BLEGUI or something. This application uses the APIs to handle connections, read and write events. In a nutshell, you need to implement the same thing that this application does. For that, you can leverage the logs it spits on the console. This log will help you with all the commands you need to send and all the response that you need to handle. Then, you need to make your application communicate with the virtual com port over which these commands will be send and responses will be received at. Once you establish this, you'd be able to display your keystrokes.

It is a substantial work if you haven't worked with BLE. But like people say, there aren't free lunches!

WedaPashi
  • 3,561
  • 26
  • 42
  • I have already studied bgscript and bgapi. But I don't want any application on PC. I need: Just plug in the BLED112 to the PC and then it works like keyboard. Is it possible? – Ashya Davydov Dec 01 '20 at 05:51
  • @AshyaDavydov: No it is not possible unless you write your own application like I suggested in the answer. – WedaPashi Dec 01 '20 at 11:03
  • But I see the dongle production using BLED112, and it doesn't need anything else. I just plug in it to the PC and then use it as a keyboard. – Ashya Davydov Dec 01 '20 at 14:42