int BLECharacteristicImp::getAttributeCount()
{
    int counter = link_list_size(&_descriptors_header) + 2; // Declaration and descriptor
    // Notification/Indecation
    if (_gatt_chrc.properties & (BT_GATT_CHRC_NOTIFY | BT_GATT_CHRC_INDICATE))
    {
        counter++;
    }
    return counter;
}
Example #2
0
void rem_listener(acceptor_t a,SOCK l)
{
	if(a)
	{
		struct epoll_event ev;int32_t ret;
		TEMP_FAILURE_RETRY(ret = epoll_ctl(a->poller_fd,EPOLL_CTL_DEL,GetSocketByHandle(l)->fd,&ev));
		if(ret == 0)
		{
			int32_t count = link_list_size(a->st_listens);
			while(count>0)
			{
				struct st_listen *_st = LINK_LIST_POP(struct st_listen *,a->st_listens);
				if(_st->sock == l)
				{
					ReleaseSocket(l);
					free(_st);
					break;
				}
				else
					LINK_LIST_PUSH_BACK(a->st_listens,_st);
				--count;
			};
		}
	}
int BLECharacteristicImp::descriptorCount() const
{
    int counter = link_list_size(&_descriptors_header);
    return counter;
}
Example #4
0
void mq_push(mq_t m,struct list_node *msg)
{
	struct per_thread_struct *pts = mq_push_local(m,msg);
	if(link_list_size(pts->local_push_q) >= m->push_size)
		mq_sync_push(m,pts);			
}