• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2010 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.nfc;
18 
19 /**
20  * LlcpClientSocket represents a LLCP Connection-Oriented client to be used in a
21  * connection-oriented communication
22  */
23 public class NativeLlcpSocket {
24 
25     private int mHandle;
26 
27     private int mSap;
28 
29     private int mLocalMiu;
30 
31     private int mLocalRw;
32 
NativeLlcpSocket()33     public NativeLlcpSocket(){
34 
35     }
36 
NativeLlcpSocket(int sap, int miu, int rw)37     public NativeLlcpSocket(int sap, int miu, int rw){
38         mSap = sap;
39         mLocalMiu = miu;
40         mLocalRw = rw;
41     }
42 
doConnect(int nSap)43     public native boolean doConnect(int nSap);
44 
doConnectBy(String sn)45     public native boolean doConnectBy(String sn);
46 
doClose()47     public native boolean doClose();
48 
doSend(byte[] data)49     public native boolean doSend(byte[] data);
50 
doReceive(byte[] recvBuff)51     public native int doReceive(byte[] recvBuff);
52 
doGetRemoteSocketMiu()53     public native int doGetRemoteSocketMiu();
54 
doGetRemoteSocketRw()55     public native int doGetRemoteSocketRw();
56 
getSap()57     public int getSap(){
58         return mSap;
59     }
60 
getMiu()61     public int getMiu(){
62         return mLocalMiu;
63     }
64 
getRw()65     public int getRw(){
66         return mLocalRw;
67     }
68 
getHandle()69     public int getHandle(){
70         return mHandle;
71     }
72 
73 }
74