This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom bluetooth profile structure help

I've been thinking recently about how to structure the custom profile for some hardware I'm developing, which has a a few sensor components and a button onboard.

What I'd like to have in terms of functionality is this:

  • Read data from 4 different sensors
  • Set up the ability for each sensor to create a smartphone alert
  • Configure the sensor thresholds (or range) which trigger the alerts
  • Configure the sensor sample rates
  • activate/deactivate sensors if not used to save power

I'm not totally sure what way to go about structuring this, despite having read through the tutorials on custom characteristics and services.

I think there may be two options, but please let me know if there is a better way to go about it:

  1. Separate into services based on action: A data service, a configuration service, and an alert service
  • Data service: holds characteristics containing data from each sensor
  • Config service: Holds configuration characteristics that can be set for each sensor
  • Alert service: Holds alert notification characteristics to generate alerts preset by config service
  1. Services based on sensor
  • A service for each sensor, containing a data characteristic, a config charaacteristic, and an alert notification characteristic

Which, if either, of these is the best approach? are there other ways? and are there things I'm not considering?

Related