Bluetooth Low Energy (BLE): Sending Current Time Service from GATT Server to Client

Viewed 479

Basically, I'm building an app that needs to Notify peripheral about the Current Time Service which is being sent from a smartphone.

The problem is that my peripheral, which I initially believed served as a GATT Server, doesn't have the 1805 UUID nor any characteristics associated with it after I scanned it with the Nordic's nRF Connect app. I do see other services on the peripheral, but they don't interest me.

Nonetheless, I created in the nRF app a GATT server with their predefined CTS GATT server, which allowed me to update my peripheral's time after bonding. The GATT server could update the time with both WRITE and NOTIFY. Does it mean I was wrong to assume my peripheral was a Server whereas it could be a Client instead? I know these ble devices can sometimes serve as both server and client. So I'm no longer sure which one serves as the client or server.

But if my phone serves as the Central/Server, not a client, I should only be able to broadcast/advertise to the client. I can't write or notify from the Server. So this would mean that my peripheral client was programmed to read the 1805 UUID service from the Phone (Server)? Except the peripheral doesn't scan or connect to the Central/Server (my phone) on its own, which means my Phone needs to serve as both Client for conecction and Central for CTS Service, which introduces unnecessary complications imo. It seems like a bad design from the get go, at least this is what I'd condludednso far, unless I'm wrong here.

Wouldn't it be a lot easier to just update the profile of the peripheral device instead by adding 1805 service and characteristic/s for the Current Time Service? Also I'm not even sure in what format should I parse the date. I used hex for CTS in nRF Connect app.

Is this even possible to do it with a library like this one:

https://github.com/randdusing/cordova-plugin-bluetoothle

It does provide a way of creating a Service. It would be a lot easier if I could just write/notify to peripheral if it had the necessary 1805 service by default.

Could anyone experienced with BLE technology verify my thought process here? Am I on a good track, or am I in the erong here.

0 Answers
Related