-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[documentation] How to use this Lib #59
Comments
Thanks for asking this question @16L-YT . Today we have no global library that includes all services, you have to pick and choose which one you want to use in your add_subdirectory(mbed-os-experimental-ble-services/services/CurrentTime)
add_subdirectory(mbed-os-experimental-ble-services/services/LinkLoss) Then in the target_link_libraries(${APP_TARGET}
PRIVATE
mbed-os
mbed-events
mbed-ble
ble-service-link-loss
ble-service-current-time
) If I understand correctly your issue, there is two enhancement that can be made:
Is that correct ? |
Yes that is correct. The steps you mentioned are good to be included in the README. Feel free to close this issue anytime. |
Does one absolutely need Mbed OS CLI to try this lib or even Mbed Studio can handle that if i put the CMakeLists.txt files into the directories mentioned by @16L-YT ? I ask because CLI freaks me out all the time and prefer not using that. |
@idea--list In Mbed Studio, you can use this library just like any other library:
Now, you can include any of the services in you main application as follows: // Include Current Time service
#include "ble-service-current-time/CurrentTimeService.h"
// Include Device Information service
#include "ble-service-device-information/DeviceInformationService.h"
// Include Link Loss service
#include "ble-service-link-loss/LinkLossService.h" However, you may have found that Mbed Studio will produce an error if you include a
The reason seems to be due to the IDE's desire to look for the
@pan- Perhaps we should add this fix to the BLE_GattServer_ExperimentalServices example. @16L-YT @idea--list Thanks for your questions and feedback. |
@noonfom It compiles&runs on my Artemis Thing Plus. Using nRF Connect on my phone i can connect to the board and see those characteristics... but here stops all the goodness. I can update manually the value of "Alert Level" characteristic but it never gets updated automatically as i get farther from the board and the RSSI changes. This makes no sense at all. Digging into the implementation i find this in
Maybe i get it wrong but i guess this event should do the opposite and start monitoring RSSI and update the value of "Alert Level" on each timeout and i should be able to read that value by tapping the downward arrow inside nRF Connect. While i also find this:
I get a feeling the logic is messed up quite a bit as stop_alert() should be called when the peers disconnect and all the other stuff makes sense to be called when the connection is established. As for "Current Time" characteristic: i can read the value hardcoded within source code via nRF connect, however i can not write a new value to this characteristic thus can not change the timestamp on the board despite the characteristic should be writeable. Again this makes me wonder as most embedded devices do not even have an RTC hardware, if they have, that tends to drift much more than time on a mobile phone (GSM-network keeps the local time accurate on phones). Mbed's software based RTC gets cleared when power is lost. So again would make sense if the phone could inject time into the embedded device via "Current Time" service, but the current implementation does not do that. At least i tried to write the current UNIX timestamp in any possible data type nRF Connect offers but none of them seem to work. |
@idea--list The Link Loss Service (LLS) is a standard Bluetooth service defined in LLS_v1.0.1. It was implemented in #14 entirely in accordance with its specification, which does not specify how the Alert Level should be updated. The only requirement is that the Alert Level Characteristic have read/write properties. Admittedly, the BLE_GattServer_ExperimentalServices example only scratches the surface of what is possible with the service. The idea of updating the Alert Level in relation to changes in the RSSI is interesting and could be implemented at the application level. The specification states that the alert should continue until one of the following events occur:
The first and third requirements are satisfied in On the Current Time Service, you should be able to write a new value to the Current Time Characteristic. Here's an example: Example: Sat, 17 July 2021 12:34:56.
|
@noonfom Thanks for clarifying the data format of the CurrentTime characteristic, i could not have guessed that. Was not expecting this format as inside
Thus i was expecting i shall input UNIXTIMESTAMP format into nRF Connect to update the current time on the board. IMHO that would make more sense than the format used now as most webservices expose UNIXTIMESTAMP for machines. |
By the way recently i read the spec of the LinkLossService, but that really does not make much sense for me. As i tried the implementation and went out of reach the characteristic value on my central device (phone with nRF Connect) did not change. Not even if i got back into range. I guess the value of ...but how could we send an alert to a remote system if the value does not change on the central device, which may provide the connection to a remote surveillance system? IMHO also the name I think Mbed's implementation could extend the original spec sheet (or implement a more useful non-standard service) by adding 2 different RSSI threshold characteristics (both sides should be able to change those) and then the peripheral device running the GattServer should set |
Is your feature request related to a problem? Please describe.
It is not straight forward how to use this Lib. I need to check if the following steps I followed (I managed to include in my project correctly) are correct. Also I was wondering why there is no CMakeLists.txt in the parent directory of this Lib and for services library.
Describe the solution you'd like
mbed deploy
in order to download the library.mbed-os-experimental-ble-services
directory:mbed-os-experimental-ble-services\services
:Describe alternatives you've considered
N/A
Additional context
N/A
The text was updated successfully, but these errors were encountered: