Package 

Class LynxDiscoveryCommand


  • 
    public class LynxDiscoveryCommand
    extends LynxStandardCommand<LynxAck>
                        

    Performs discovery respecting half-duplex aspect of EIA485 communications link. This message is sent to the broadcast address 0xFF. If this message arrives via USB, the Controller Module knows it is USB-connected (a Parent) and may have children on its 485 bus. The Parent issues its own Discovery Response and then takes ownership of the 485 bus. The Parent sends Discovery packets directly to all possible Child addresses (1 ~ 254) in sequence, waiting 2 msec (1kHz system clock guarantees that to be between 1 ~ 2 msec) between each. Any connected Child should respond to the Discovery packet effectively immediately, taking brief control over the child bus to do so. Discovery completes in about 500msec. Once discovered, a Child requires a Keep Alive addressed directly to it (rather than a broadcast message) within the usual KA interval to lock in the child status. If no Keep Alive is received by the Child in time, it reverts to ready-to-discover mode. The discovery packet is sent from the host to the broadcast address (255). Note that the message number of a broadcast message is completely ignored by receivers, as it cannot be guaranteed to be a non-duplicate across all receivers. Note that sending a LynxDiscoveryCommand can in theory result in up to 254 response messages; thus the 'finished' processing of LynxDiscoveryCommands will be special. First, an incoming LynxDiscoveryResponse should be processed unilaterally; the original LynxDiscoveryCommand will NOT have a response expected (nor will it be ackable). Second, after sending a LynxDiscoveryCommand we will wait for a sufficient time to receive all possible responses before ever sending any further messages.

    • Method Summary

      Modifier and Type Method Description
      int getDestModuleAddress()
      void send()
      LynxAck sendReceive()
      boolean isAckable()
      void acquireNetworkLock()
      void releaseNetworkLock()
      static int getStandardCommandNumber()
      int getCommandNumber()
      Array<byte> toPayloadByteArray()
      void fromPayloadByteArray(Array<byte> rgb)
      boolean isDangerous()
      • Methods inherited from class com.qualcomm.hardware.lynx.commands.standard.LynxStandardCommand

        isStandardCommandNumber, isStandardPacketId, isStandardResponseNumber
      • Methods inherited from class com.qualcomm.hardware.lynx.commands.LynxCommand

        getResponseClass
      • Methods inherited from class com.qualcomm.hardware.lynx.commands.LynxRespondable

        getNackReceived, hasBeenAcknowledged, isAckOrResponseReceived, isNackReceived, isResponseExpected, onAckReceived, onNackReceived, onPretendTransmit, onResponseReceived, pretendFinish, sendReceive
      • Methods inherited from class com.qualcomm.hardware.lynx.commands.LynxMessage

        forgetSerialization, getMessageNumber, getModule, getModuleAddress, getNanotimeLastTransmit, getPayloadTimeWindow, getReferenceNumber, getSerialization, hasBeenTransmitted, invokeStaticNullaryMethod, isAck, isNack, isResponse, loadFromSerialization, noteHasBeenTransmitted, resetModulePingTimer, setMessageNumber, setModule, setNanotimeLastTransmit, setPayloadTimeWindow, setReferenceNumber, setSerialization
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait