-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathLink.java
61 lines (53 loc) · 1.28 KB
/
Link.java
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package io.github.pseudoresonance.pixy2api.links;
import io.github.pseudoresonance.pixy2api.Pixy2.Checksum;
/**
* Java Port of Pixy2 Arduino Library
*
* Link interface for connecting to Pixy2
*
* https://github.com/PseudoResonance/Pixy2JavaAPI
*
* @author PseudoResonance (Josh Otake)
*/
public interface Link {
/**
* Opens link
*
* @param arg Link argument
*
* @return Returns state
*/
public int open(int arg);
/**
* Closes link
*/
public void close();
/**
* Receives and reads specified length of bytes over link
*
* @param buffer Byte buffer to return value
* @param length Length of value to read
* @param cs Checksum
*
* @return Length of value read
*/
public int receive(byte[] buffer, int length, Checksum cs);
/**
* Receives and reads specified length of bytes over link
*
* @param buffer Byte buffer to return value
* @param length Length of value to read
*
* @return Length of value read
*/
public int receive(byte[] buffer, int length);
/**
* Writes and sends buffer over link
*
* @param buffer Byte buffer to send
* @param length Length of value to send
*
* @return Length of value sent
*/
public int send(byte[] buffer, int length);
}