Skip to main content

Limitation of creating GATT service in single task?

5 years ago

Limitation of creating GATT service in single task?

Posted byhardy.chen0 points 5 replies
0 upvotes

Hi Dialog team,

Don't know if any limitation on 'attmdb_add_service', but I found that the device is not working while I tried to create 2 primary service in one single task.
我没有找到任何documentation for such limitation. Could you confirm this finding?

I'm developing my application based on DA14580_BEACON_3.40.6.

5 years ago

Joacimwe 5分

Even though not intended, there is no limitation doing so. The task id which is passed to attmdb_add_service is simply which task write requests received from client etc. are being sent to.

Maybe you could tell what you're trying to achieve and what exactly does not work? Is the code crashing?

5 years ago

hardy.chen 0 points

Hi Joacimwe,

Yes, I did tried to add 2 primary service in TASK_APP, and it turned out not working normally (at least that not advertising at beginning, not sure whether it was crash or not). If I move all characteristic declaration to one single primary service, then it worked normally, so I doubt of the limitation of creating service in one task.

5 years ago

Joacimwe 5分

That's strange. You can definitely add multiple services directly in TASK_APP, even if this is not recommended. Are you sure you start advertising correctly? Are you sure you are calculating the correct nb_att_16, nb_att_32, nb_att_128, total size etc.?

5 years ago

MT_dialog -30 points

Hi hardy.chen,

Joacimwe is right, although it has not been tested to be used this way, i dont see any reason why this should not work you just need to be very carefull. Add the first service and then add the attributes then add the second service and place the corresponding attributes of the second service.

Thanks MT_dialog

5 years ago

hardy.chen 0 points

Hi All,

Sorry for late back to this topic.
I finally verified the creation of multiple service in TASK_APP, it's truly working for this purpose.
The failure of my attempt was the wrong size being reserved(allocated) with call 'attmdb_add_service', just my mistake by ignorance of mixing up 2 different variables.

So, thanks and now it's working well in my application.