Interface BabelDemo
- All Known Implementing Classes:
BabelAccelerometerLCDDemo,BabelAnyGestureMatrixDemo,BabelArrowGestureMatrixDemo,BabelCardinalGestureMatrixDemo,BabelChainableLedsHSBDemo,BabelChainableLedsRGBDemo,BabelControlableLedChainDemo,BabelEncoderMatrixDemo,BabelLcdDemo,BabelLoRaDemo,BabelMatrixDemo,BabelMatrixDemo2,BabelSimpleChainableLedsHSBDemo,BabelSimpleChainableLedsRGBDemo,BabelZigBeeDemo
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
FieldsModifier and TypeFieldDescriptionstatic final shortShared Babel protocol id used by every demo (one demo runs per process, so reuse is safe).static final StringHuman-readable protocol name passed toGenericProtocol's constructor by every demo. -
Method Summary
Modifier and TypeMethodDescriptionvoidexecute()Builds and starts this demo's Babel runtime: obtainBabel.getInstance(), load config, instantiate and register the control/radio protocols the demo needs plus the demo itself,init(...)each in dependency order, and finallyBabel.start()the event loop.
-
Field Details
-
PROTO_NAME
Human-readable protocol name passed toGenericProtocol's constructor by every demo.- See Also:
-
PROTO_ID
static final short PROTO_IDShared Babel protocol id used by every demo (one demo runs per process, so reuse is safe).- See Also:
-
-
Method Details
-
execute
Builds and starts this demo's Babel runtime: obtainBabel.getInstance(), load config, instantiate and register the control/radio protocols the demo needs plus the demo itself,init(...)each in dependency order, and finallyBabel.start()the event loop.Maincalls this once.- Throws:
Exception
-