Hi,
Suppose I have two services (let's say CUSTS1 and CUSTS2), I want to be able to hide one of them (or both) service from a
connected client with a flag. E.g., when this flag is on, only make CUSTS1 available to connected client. Is this possible?
I have tried "disabling" CUSTS1 by not calling prf_enable()->app_custs1_enable() during client connection but it doesn't seem
(客户端不断等服务工作discovery) -- client is LightBlue app.
Thank you in advance
Keywords:
Device:
Hi meriororen,
Can you please try thisin the enable request handlerto hide the service:
attmdb_svc_set_permission(custs1_env.shdl, PERM(SVC_HIDE, ENABLE));
and this to re-enable it
attmdb_svc_set_permission(custs1_env.shdl,PERM(SVC, ENABLE));
Thanks MT_dialog
If I hide the custs1 service with attmdb_svc_set_permission(custs1_env.shdl, PERM(SVC_HIDE, ENABLE)) , can I still access the characteristics of the service on my Android app if I already know the UUID ? Or will I have to unhide it in order to access any characteristics of the service ?
Hi
Any help here ?
You will have to unhide it.
Thanks, I'll try it once I get hiding to work :)
Hi MT_Dialog,
This is perfect! I never thought that it's been there all the time.
Thanks!
Hi meriororen,
Glad it suits you.
Thanks MT_dialog
Hi
I am using attmdb_svc_set_permission(custs1_env.shdl, PERM(SVC_HIDE, ENABLE)); like so :
---
void user_app_connection(uint8_t connection_idx, struct gapc_connection_req_ind const *param)
{
if (app_env[connection_idx].conidx != GAP_INVALID_CONIDX)
{
attmdb_svc_set_permission(custs1_env.shdl, PERM(SVC_HIDE, ENABLE));
---
This does not seem to work, the service isn't being hidden (I am using nRF Master Control Panel to check). What am I doing wrong ?