Lines Matching refs:conn

68 	HciConnection* conn = ConnectionByHandle(handle, hid);
69 if (conn != NULL)
72 conn = new (std::nothrow) HciConnection(hid);
73 if (conn == NULL)
76 // memset(conn, 0, sizeof(HciConnection));
78 conn->currentRxPacket = NULL;
79 conn->currentRxExpectedLength = 0;
82 bdaddrUtils::Copy(conn->destination, dst);
84 sockaddr_l2cap* destination = (sockaddr_l2cap*)&conn->address_dest;
89 conn->type = type;
90 conn->handle = handle;
91 conn->status = HCI_CONN_OPEN;
92 conn->mtu = L2CAP_MTU_MINIMUM; // TODO: give the mtu to the connection
96 sConnectionList.Add(conn);
100 return conn;
108 HciConnection* conn;
115 conn = iterator.Next();
116 if (conn->Hid == hid
117 && bdaddrUtils::Compare(conn->destination, destination)) {
120 if (conn->GetDoublyLinkedListLink()->next != NULL
121 || conn->GetDoublyLinkedListLink()->previous != NULL
122 || conn == sConnectionList.Head()) {
123 sConnectionList.Remove(conn);
126 delete conn;
139 HciConnection* conn;
145 conn = iterator.Next();
146 if (conn->Hid == hid && conn->handle == handle) {
149 if (conn->GetDoublyLinkedListLink()->next != NULL
150 || conn->GetDoublyLinkedListLink()->previous != NULL
151 || conn == sConnectionList.Head()) {
152 sConnectionList.Remove(conn);
155 delete conn;
168 HciConnection* conn;
174 conn = iterator.Next();
175 if (bdaddrUtils::Compare(conn->destination, destination)) {
176 return conn->Hid;
188 HciConnection* conn;
194 conn = iterator.Next();
195 if (conn->Hid == hid && conn->handle == handle) {
196 return conn;
213 HciConnection* conn = iterator.Next();
214 if (conn->Hid == hid
215 && bdaddrUtils::Compare(conn->destination, destination)) {
216 return conn;
225 allocate_command_ident(HciConnection* conn, void* pointer)
227 MutexLocker _(&conn->fLock);
229 uint8 ident = conn->fNextIdent + 1;
234 while (ident != conn->fNextIdent) {
235 if (conn->fInUseIdents.Find(ident) == conn->fInUseIdents.End()) {
236 conn->fInUseIdents.Insert(ident, pointer);
250 lookup_command_ident(HciConnection* conn, uint8 ident)
252 MutexLocker _(&conn->fLock);
254 auto iter = conn->fInUseIdents.Find(ident);
255 if (iter == conn->fInUseIdents.End())
263 free_command_ident(HciConnection* conn, uint8 ident)
265 MutexLocker _(&conn->fLock);
266 conn->fInUseIdents.Remove(ident);