Class Rf433rx

java.lang.Object
jpigpio.packet.Rf433rx

public class Rf433rx
extends java.lang.Object
Class implementing RF 433 MHz communication receiver (e.g. XD-RF-5V). It implements NotificationReceiver which is decoding pulses based on preset Protocol (you can tweak signalling by creating your own Protocol). NotificationListener is plugged to PigpioSocket NotificationRouter, receiving every notification received from pigpiod daemon. Received datagrams can be accessed via method get()

Work is based on Robert Tidey LightwaveRF code https://github.com/roberttidey/LightwaveRF
  • Constructor Summary

    Constructors 
    Constructor Description
    Rf433rx​(JPigpio pi, int rxGpio, Protocol protocol)  
  • Method Summary

    Modifier and Type Method Description
    int available()
    Returns number of packets available for pickup
    int byteErrorCount()
    Simple statistics of byte errors detected while receiving datagrams.
    int datagramErrorCount()
    Simple statistics returning number of errors in datagrams.
    byte[] get()
    Get one packet from available packets.
    void setCallback​(NotificationListener notificationListener)  
    void terminate()
    Terminate receiving thread, cancel further notifications from pigpiod.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setCallback

      public void setCallback​(NotificationListener notificationListener) throws PigpioException
      Throws:
      PigpioException
    • get

      public byte[] get() throws java.lang.IndexOutOfBoundsException
      Get one packet from available packets. Check if there are packets available before calling this method.
      Returns:
      Datagram. IMPORTANT: Datagram contains nibbles 4bit) stored in bytes.
      Throws:
      java.lang.IndexOutOfBoundsException - if there is no datagram available
    • available

      public int available()
      Returns number of packets available for pickup
      Returns:
      Number of datagrams available.
    • terminate

      public void terminate() throws PigpioException
      Terminate receiving thread, cancel further notifications from pigpiod.
      Throws:
      PigpioException - on pigpiod error
    • byteErrorCount

      public int byteErrorCount()
      Simple statistics of byte errors detected while receiving datagrams. High number of errors might mean low signal strength or too long datagrams.
      Returns:
      byte error count
    • datagramErrorCount

      public int datagramErrorCount()
      Simple statistics returning number of errors in datagrams.
      Returns:
      number of errors in datagrams.