Interface BabelDemo

All Known Implementing Classes:
BabelAccelerometerLCDDemo, BabelAnyGestureMatrixDemo, BabelArrowGestureMatrixDemo, BabelCardinalGestureMatrixDemo, BabelChainableLedsHSBDemo, BabelChainableLedsRGBDemo, BabelControlableLedChainDemo, BabelEncoderMatrixDemo, BabelLcdDemo, BabelLoRaDemo, BabelMatrixDemo, BabelMatrixDemo2, BabelSimpleChainableLedsHSBDemo, BabelSimpleChainableLedsRGBDemo, BabelZigBeeDemo

public interface BabelDemo
The common contract every demo in this project implements.

A demo is both a Babel GenericProtocol (so it can register handlers, send requests, and react to replies/timers/notifications) and a BabelDemo (so Main can construct it and kick it off uniformly). Main selects exactly one demo by command-line name and calls execute() on it; from there the demo bootstraps its own Babel runtime.

Every concrete demo reuses the same protocol identity below. That is safe here because only one demo ever runs per JVM (see Main), so there is no risk of two protocols claiming id PROTO_ID at once. The same id also doubles as the sourceProto tag the radio demos stamp onto outgoing packets so a receiver can recognise its own traffic.

Demos in package pt.unl.fct.di.tardis.babel.iot.demos are derived from work originally developed at NOVA FCT for the TaRDIS project; the LoRa / ZigBee demos under pt.paradigmshift.iot.demos were authored by ParadigmShift, Lda. (see this repository's README "Credits" section).

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final short
    Shared Babel protocol id used by every demo (one demo runs per process, so reuse is safe).
    static final String
    Human-readable protocol name passed to GenericProtocol's constructor by every demo.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Builds and starts this demo's Babel runtime: obtain Babel.getInstance(), load config, instantiate and register the control/radio protocols the demo needs plus the demo itself, init(...) each in dependency order, and finally Babel.start() the event loop.
  • Field Details

    • PROTO_NAME

      static final String PROTO_NAME
      Human-readable protocol name passed to GenericProtocol's constructor by every demo.
      See Also:
    • PROTO_ID

      static final short PROTO_ID
      Shared Babel protocol id used by every demo (one demo runs per process, so reuse is safe).
      See Also:
  • Method Details

    • execute

      void execute() throws Exception
      Builds and starts this demo's Babel runtime: obtain Babel.getInstance(), load config, instantiate and register the control/radio protocols the demo needs plus the demo itself, init(...) each in dependency order, and finally Babel.start() the event loop. Main calls this once.
      Throws:
      Exception