Interface Link

  • All Known Implementing Classes:
    I2CLink, SPILink, UARTLink

    public interface Link
    Java Port of Pixy2 Arduino Library Link interface for connecting to Pixy2 https://github.com/PseudoResonance/Pixy2JavaAPI
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes link
      int open​(int arg)
      Opens link
      int receive​(byte[] buffer, int length)
      Receives and reads specified length of bytes over link
      int receive​(byte[] buffer, int length, Pixy2.Checksum cs)
      Receives and reads specified length of bytes over link
      int send​(byte[] buffer, int length)
      Writes and sends buffer over link
    • Method Detail

      • open

        int open​(int arg)
        Opens link
        Parameters:
        arg - Link argument
        Returns:
        Returns state
      • close

        void close()
        Closes link
      • receive

        int receive​(byte[] buffer,
                    int length,
                    Pixy2.Checksum cs)
        Receives and reads specified length of bytes over link
        Parameters:
        buffer - Byte buffer to return value
        length - Length of value to read
        cs - Checksum
        Returns:
        Length of value read
      • receive

        int receive​(byte[] buffer,
                    int length)
        Receives and reads specified length of bytes over link
        Parameters:
        buffer - Byte buffer to return value
        length - Length of value to read
        Returns:
        Length of value read
      • send

        int send​(byte[] buffer,
                 int length)
        Writes and sends buffer over link
        Parameters:
        buffer - Byte buffer to send
        length - Length of value to send
        Returns:
        Length of value sent