Package jpigpio
Class SocketLock
java.lang.Object
jpigpio.SocketLock
public class SocketLock
extends java.lang.Object
Created by Jozef on 19.04.2016.
-
Constructor Summary
Constructors Constructor Description SocketLock(java.lang.String host, int port)
-
Method Summary
-
Constructor Details
-
SocketLock
public SocketLock(java.lang.String host, int port) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Details
-
reconnect
public void reconnect() throws java.io.IOException- Throws:
java.io.IOException
-
terminate
public void terminate() throws java.io.IOException- Throws:
java.io.IOException
-
sendCmd
public int sendCmd(int cmd, int p1, int p2) throws java.io.IOException- Throws:
java.io.IOException
-
sendCmd
public int sendCmd(int cmd, int p1, int p2, int p3, byte[] ext) throws java.io.IOExceptionSend extended command to pigpiod and return result code- Parameters:
cmd
- Command to sendp1
- Command parameter 1p2
- Command parameter 2p3
- Command parameter 3 (usually length of extended data - see paramater ext)ext
- Array of bytes containing extended data- Returns:
- Command result code
- Throws:
java.io.IOException
- in case of network connection error
-
readBytes
public void readBytes(byte[] data) throws java.io.IOExceptionRead all remaining bytes coming from pigpiod- Parameters:
data
- Array to store read bytes.- Throws:
java.io.IOException
- if unbale to read from network
-