NativeLlcpServiceSocket.java revision 7efbf69a37134ccbd86a1f6b4121f16b4a80eaae
1f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly/* 2f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * Copyright (C) 2010 The Android Open Source Project 3f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * 4f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * Licensed under the Apache License, Version 2.0 (the "License"); 5f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * you may not use this file except in compliance with the License. 6f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * You may obtain a copy of the License at 7f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * 8f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * http://www.apache.org/licenses/LICENSE-2.0 9f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * 10f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * Unless required by applicable law or agreed to in writing, software 11f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * distributed under the License is distributed on an "AS IS" BASIS, 12f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * See the License for the specific language governing permissions and 14f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * limitations under the License. 15f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly */ 16f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 17f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pellypackage com.android.nfc; 18f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 19f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly/** 20f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * LlcpServiceSocket represents a LLCP Service to be used in a 21f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly * Connection-oriented communication 22f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly */ 23f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pellypublic class NativeLlcpServiceSocket { 24f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly private int mHandle; 25f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly private int mLocalMiu; 26f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly private int mLocalRw; 27f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly private int mLocalLinearBufferLength; 28f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly private int mSap; 29f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly private String mServiceName; 30f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 317efbf69a37134ccbd86a1f6b4121f16b4a80eaaeNick Pelly public NativeLlcpServiceSocket(){ } 32f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 3393915e1c6fe6d5d16fcebeda610782bf5812c9b4Nick Pelly public native NativeLlcpSocket doAccept(int miu, int rw, int linearBufferLength); 34f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 35f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly public native boolean doClose(); 36f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 37f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly public int getHandle(){ 38f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly return mHandle; 39f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly } 40f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 41f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly public int getRw(){ 42f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly return mLocalRw; 43f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly } 44f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 45f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly public int getMiu(){ 46f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly return mLocalMiu; 47f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly } 48f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly 49f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly public int getLinearBufferLength(){ 50f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly return mLocalLinearBufferLength; 51f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly } 52f067256d9556b1e01143f9ae2fd824fa5dc03138Nick Pelly} 53