Limitation of creating GATT service in single task?

6 posts / 0 new
Last post
hardy.chen
Offline
Last seen:1 year 10 months ago
加入:2015-03-13 04:20
Limitation of creating GATT service in single task?

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.
我on't find any documentation for such limitation. Could you confirm this finding?

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

Device:
Joacimwe
Offline
Last seen:1 year 5 months ago
Guru
加入:2014-01-14 06:45
Even though not intended,

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?

hardy.chen
Offline
Last seen:1 year 10 months ago
加入:2015-03-13 04:20
Hi Joacimwe,

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.

Joacimwe
Offline
Last seen:1 year 5 months ago
Guru
加入:2014-01-14 06:45
That's strange. You can

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.?

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi hardy.chen,

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

hardy.chen
Offline
Last seen:1 year 10 months ago
加入:2015-03-13 04:20
Hi All,

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.

Topic locked