Blame view

src/zyapi/CommonApi.java 925 Bytes
5acca6a8   杜方   畅游通核销app: 1.补漏上次未上传
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  package zyapi;
  
  
  public class CommonApi {
  	private static CommonApi mMe = null;
  	
  	public CommonApi() {
  	}
  	
  	// gpio
  	public native int setGpioMode(int pin, int mode);  
  	public native int setGpioDir(int pin, int dir);
  	public native int setGpioPullEnable(int pin, int enable);
  	public native int setGpioPullSelect(int pin, int select);
  	public native int setGpioOut(int pin, int out);
  	public native int getGpioIn(int pin);
  	//serialport  
  	public native int openCom(String port, int baudrate, int bits, char event, int stop);
  	public native int openComEx(String port, int baudrate, int bits, char event, int stop, int flags);
  	public native int writeCom(int fd, byte[] buf, int sizes);
  	public native int readCom(int fd, byte[] buf, int sizes);
  	public native int readComEx(int fd, byte[] buf, int sizes, int sec, int usec);
  	public native void closeCom(int fd);
  	
  	static {  
  		System.loadLibrary("zyapi_common");
  	}
  	
  }