This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is there an example of a service with many characteristics ?

Hi,

I need to have a custom service which allows configuration of multiple parameters (perhaps 50 or more - which control registers in external peripherals)

I've looked at the examples and existing services to see if there is anything similar, but all I can find is code where each characteristic has its own, rather large, setup function.

Is there an example of having an array of characteristics? (They don't even need to be named, they could just be numbered)

BTW. I had initially thought that I would just duplicate the UART service and put it on a private UUID, but I think the maximum data size for a single write or read from a service would not be large enough to hold 50 or more bytes if config data, and having the ability to read or write individual characteristics is more flexible.

Thanks.

Parents
  • Hi Bjorn

    Thanks for the suggestion. I hadn't considered that the discovery would take a long time.

    I may use my original idea of using a modified version of the UART service, and have 2 separate WRITE (with response) characteristics. One characteristic would be the SET function, were parameter / data pairs of data are sent in the buffer,which set the register config for the peripherals (and some things to like advertising period etc)

    And another characteristic which performs the GET function, Write (with response), which receives just the parameter list, and responds with just the data for those parameters

    Just to complicate things further, I need to be able to prevent unauthorised modification of the parameters, so that anyone running Light Blue etc can't change random settings on the device.

    So I may need some sort of access enabling service as well.

Reply
  • Hi Bjorn

    Thanks for the suggestion. I hadn't considered that the discovery would take a long time.

    I may use my original idea of using a modified version of the UART service, and have 2 separate WRITE (with response) characteristics. One characteristic would be the SET function, were parameter / data pairs of data are sent in the buffer,which set the register config for the peripherals (and some things to like advertising period etc)

    And another characteristic which performs the GET function, Write (with response), which receives just the parameter list, and responds with just the data for those parameters

    Just to complicate things further, I need to be able to prevent unauthorised modification of the parameters, so that anyone running Light Blue etc can't change random settings on the device.

    So I may need some sort of access enabling service as well.

Children
No Data
Related