Lines Matching refs:jniHandle
159 sp<P2pServer> PeerToPeer::findServerLocked (tJNI_HANDLE jniHandle)
164 && (mServers[i]->mJniHandle == jniHandle) )
204 ** jniHandle: Connection handle.
210 bool PeerToPeer::registerServer (tJNI_HANDLE jniHandle, const char *serviceName)
213 ALOGD ("%s: enter; service name: %s JNI handle: %u", fn, serviceName, jniHandle);
223 pSrv->mJniHandle = jniHandle;
232 pSrv = mServers[ii] = new P2pServer(jniHandle, serviceName);
234 ALOGD ("%s: added new p2p server index: %d handle: %u name: %s", fn, ii, jniHandle, serviceName);
251 removeServer (jniHandle);
262 ** jniHandle: Connection handle.
267 void PeerToPeer::removeServer (tJNI_HANDLE jniHandle)
275 if ( (mServers[i] != NULL) && (mServers[i]->mJniHandle == jniHandle) )
278 fn, jniHandle, mServers[i]->mNfaP2pServerHandle, mServers[i]->mServiceName.c_str(), i);
284 ALOGE ("%s: unknown server jni handle: %u", fn, jniHandle);
472 bool PeerToPeer::deregisterServer (tJNI_HANDLE jniHandle)
475 ALOGD ("%s: enter; JNI handle: %u", fn, jniHandle);
480 if ((pSrv = findServerLocked (jniHandle)) == NULL)
482 ALOGE ("%s: unknown service handle: %u", fn, jniHandle);
500 removeServer (jniHandle);
512 ** jniHandle: Connection handle.
519 bool PeerToPeer::createClient (tJNI_HANDLE jniHandle, UINT16 miu, UINT8 rw)
523 ALOGD ("%s: enter: jni h: %u miu: %u rw: %u", fn, jniHandle, miu, rw);
533 mClients [i]->mClientConn->mJniHandle = jniHandle;
547 jniHandle: %u", fn, client.get(), jniHandle);
557 ALOGD ("%s: exit; new client jniHandle: %u NFA Handle: 0x%04x", fn, jniHandle, client->mClientConn->mNfaConnHandle);
562 ALOGE ("%s: FAILED; new client jniHandle: %u NFA Handle: 0x%04x", fn, jniHandle, client->mClientConn->mNfaConnHandle);
563 removeConn (jniHandle);
574 ** jniHandle: Connection handle.
579 void PeerToPeer::removeConn(tJNI_HANDLE jniHandle)
587 if ((mClients[ii] != NULL) && (mClients[ii]->mClientConn->mJniHandle == jniHandle))
593 ALOGD ("%s: deleted client handle: %u index: %u", fn, jniHandle, ii);
603 if (mServers[ii]->removeServerConnection(jniHandle)) {
609 ALOGE ("%s: could not find handle: %u", fn, jniHandle);
618 ** jniHandle: Connection handle.
624 bool PeerToPeer::connectConnOriented (tJNI_HANDLE jniHandle, const char* serviceName)
627 ALOGD ("%s: enter; h: %u service name=%s", fn, jniHandle, serviceName);
628 bool stat = createDataLinkConn (jniHandle, serviceName, 0);
629 ALOGD ("%s: exit; h: %u stat: %u", fn, jniHandle, stat);
639 ** jniHandle: Connection handle.
645 bool PeerToPeer::connectConnOriented (tJNI_HANDLE jniHandle, UINT8 destinationSap)
648 ALOGD ("%s: enter; h: %u dest sap: 0x%X", fn, jniHandle, destinationSap);
649 bool stat = createDataLinkConn (jniHandle, NULL, destinationSap);
650 ALOGD ("%s: exit; h: %u stat: %u", fn, jniHandle, stat);
660 ** jniHandle: Connection handle.
667 bool PeerToPeer::createDataLinkConn (tJNI_HANDLE jniHandle, const char* serviceName, UINT8 destinationSap)
674 if ((pClient = findClient (jniHandle)) == NULL)
676 ALOGE ("%s: can't find client, JNI handle: %u", fn, jniHandle);
702 removeConn (jniHandle);
710 removeConn (jniHandle);
746 ** jniHandle: Connection handle.
751 sp<P2pClient> PeerToPeer::findClient (tJNI_HANDLE jniHandle)
756 if ((mClients[i] != NULL) && (mClients[i]->mClientConn->mJniHandle == jniHandle))
829 ** jniHandle: Connection handle.
834 sp<NfaConn> PeerToPeer::findConnection (tJNI_HANDLE jniHandle)
841 && (mClients[ii]->mClientConn->mJniHandle == jniHandle) ) {
851 sp<NfaConn> conn = mServers[ii]->findServerConnection(jniHandle);
868 ** jniHandle: Handle of connection.
875 bool PeerToPeer::send (tJNI_HANDLE jniHandle, UINT8 *buffer, UINT16 bufferLen)
881 if ((pConn = findConnection (jniHandle)) == NULL)
883 ALOGE ("%s: can't find connection handle: %u", fn, jniHandle);
887 ALOGD_IF ((appl_trace_level>=BT_TRACE_LEVEL_DEBUG), "%s: send data; jniHandle: %u nfaHandle: 0x%04X",
907 ALOGD_IF ((appl_trace_level>=BT_TRACE_LEVEL_DEBUG), "%s: exit OK; JNI handle: %u NFA Handle: 0x%04x", fn, jniHandle, pConn->mNfaConnHandle);
910 fn, jniHandle, pConn->mNfaConnHandle, nfaStat);
921 ** jniHandle: Handle of connection.
929 bool PeerToPeer::receive (tJNI_HANDLE jniHandle, UINT8* buffer, UINT16 bufferLen, UINT16& actualLen)
932 ALOGD_IF ((appl_trace_level>=BT_TRACE_LEVEL_DEBUG), "%s: enter; jniHandle: %u bufferLen: %u", fn, jniHandle, bufferLen);
939 if ((pConn = findConnection (jniHandle)) == NULL)
941 ALOGE ("%s: can't find connection handle: %u", fn, jniHandle);
945 ALOGD_IF ((appl_trace_level>=BT_TRACE_LEVEL_DEBUG), "%s: jniHandle: %u nfaHandle: 0x%04X buf len=%u", fn, pConn->mJniHandle, pConn->mNfaConnHandle, bufferLen);
974 ** jniHandle: Handle of connection.
979 bool PeerToPeer::disconnectConnOriented (tJNI_HANDLE jniHandle)
986 ALOGD ("%s: enter; jni handle: %u", fn, jniHandle);
988 if ((pConn = findConnection(jniHandle)) == NULL)
990 ALOGE ("%s: can't find connection handle: %u", fn, jniHandle);
995 if ( ((pClient = findClient(jniHandle)) != NULL) && (pClient->mIsConnecting) )
1024 removeConn (jniHandle);
1027 ALOGD ("%s: exit; jni handle: %u", fn, jniHandle);
1037 ** jniHandle: Handle of the connection.
1042 jniHandle)
1047 if ((pConn = findConnection(jniHandle)) == NULL)
1049 ALOGE ("%s: can't find client jniHandle: %u", fn, jniHandle);
1052 ALOGD ("%s: jniHandle: %u MIU: %u", fn, jniHandle, pConn->mRemoteMaxInfoUnit);
1062 ** jniHandle: Handle of the connection.
1067 UINT8 PeerToPeer::getRemoteRecvWindow (tJNI_HANDLE jniHandle)
1070 ALOGD ("%s: client jni handle: %u", fn, jniHandle);
1073 if ((pConn = findConnection(jniHandle)) == NULL)
1608 P2pServer::P2pServer(PeerToPeer::tJNI_HANDLE jniHandle, const char* serviceName)
1610 mJniHandle (jniHandle)
1738 sp<NfaConn> P2pServer::allocateConnection (PeerToPeer::tJNI_HANDLE jniHandle)
1747 mServerConn[ii]->mJniHandle = jniHandle;
1791 sp<NfaConn> P2pServer::findServerConnection (PeerToPeer::tJNI_HANDLE jniHandle)
1798 if ( (mServerConn[jj] != NULL) && (mServerConn[jj]->mJniHandle == jniHandle) )
1816 bool P2pServer::removeServerConnection (PeerToPeer::tJNI_HANDLE jniHandle)
1823 if ( (mServerConn[jj] != NULL) && (mServerConn[jj]->mJniHandle == jniHandle) ) {