0

I'm developing an Android application for read/write data for a BLE device. The specification of the device has mentioned one service UUID and two feature UUIDs. Service UUID: 0xFFF0 TX UUID: 0xFFF6, RX UUID: 0xFFF7

And bunch of command formats as follows.

For example, for Get time:

Command format: 0x41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 CRC

When running a serviceDiscovery() there are some additional UUIDs are appeared. But there's no use of them.

Is there any special way to run commands like this in Android?

I'm quite new to Android development. So, can someone help me to overcome this situation?

Tharanga
  • 2,689
  • 1
  • 21
  • 18
  • running a command means writin the data to write characteristics – Vladyslav Matviienko Jun 17 '19 at 18:25
  • @VladyslavMatviienko thanks. should we use `0x41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00` as a single string and convert it to `byte` and write? I'm little bit confuse about setting up the command with this handle `0x41`, message `00 00 00 00 00 00 00 00 00 00 00 00 00 00 00` and `CRC` here. can you provide a simple sample code for me? It would be greatly appreciated. – Tharanga Jun 18 '19 at 00:56
  • you likely need to write those bytes: `0x41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00`, not put this as string, and then get it's bytes. – Vladyslav Matviienko Jun 18 '19 at 05:09
  • @VladyslavMatviienko yes I put it as a byte like `byte[] messageBytes = new byte[]{0x41, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00, 00};` and then WRITE is successful. But this command suppose to return DATE/TIME value in same format as above. How do we receive the return value? – Tharanga Jun 18 '19 at 06:05
  • By reading from read characteristics. – Vladyslav Matviienko Jun 18 '19 at 06:13
  • With the bluetooth there are no *commands*, you just *read* and *write* data. – Vladyslav Matviienko Jun 18 '19 at 06:14
  • Hi @Tharanga Did you manage to solve it? – Bharat Paudyal Feb 18 '22 at 12:49

0 Answers0