Equip4j Components for Particles

EQUIP is a component based software platform developed by EQUATOR project and Equip4j is a Java implementation of EQUIP. We made some components on Equip4j to handle our ubiquitous sensor node "Particle". With these components, you can easily create new sensor application by combining our components and other existing components provided in Equip4j. Our Particle components consist as follows:
Please try it and have fun!
    1. On the component browser, select ParticleFactory component in "Capabilities" tab with left click, and then make a right click to show a pulldown menu.
    2. Select "Create Request" in the pulldown menu and press left click to create ParticleFactory.
CreateComponent
    1. Created ParticleFactory automatically starts to listen a UDP port (= 5555) to receives ClPackest from Particles via XBridge.
    2. If a ClPacket from a Particle is arrived, a ParticleInstance is created to represent the discovered Particle.
    3. In "Running Component" tab, you can see the properties of existing component . For instance, ParticleInstance has properties for Sender ID, Sequence number of th ClPacket, Sender location ID, ACL Payload, etc.
Finding Particles
MakeLink
MakeLink2
ParticleDemultiplexer
StringSplitter
Integer.parseInt(in1) * 256 + Integer.parseInt(in2) < 600 ? "Low Battery" : "Enough Battery"
  1. Create TextToSpeach component.
  2. Link "out" property in StringFunction to "text" property in TextToSpeach.
  3. Now, your PC speaks the status of the Particle's battery!

BatteryWarning
    1. Make a Particle to transmit the sensing value of the light sensor by using APSConfig tool.
    2. Attach USB camera that can be used by JMF(Java Media Framework) to your PC.
    3. Create PartilceFactory and find a ParticleInstance of the Particle.
    4. Create ParticleDemultiplexer and pass ACL payload to it from ParticleInstace (Make a link between "aclpayload" properties in both components).
    5. Create StringSplitter and pass a ACL tuple of "SLI" (light sensor) to it from ParticleDemultiplexer (Make a link from a "acltupleN" property that contains "SLI" string in ParticleDemultiplexer to "inputstring" property in StringSplitter).
    6. Create StringFunction and pass #3 and #4 tokens to it from StringSplitter (Make two link from "token3" and "token4" properties in StringSplitter to "in1" and "in2" properties in StringSplitter, respectively).
    7. Input following Java code to "StringFunction" window. In this example, the sensing value of "SLI" is represented by unsigned 2bytes value and "in1"(from "token3") represents the upper byte and "in2" (from "token4") represents the lower byte. This Java code calculates the actual sensing value of "SLI" and compares it with a threshold to determine whether it becomes blight or not. "1000" is a sample of the threshold.
Integer.parseInt(in1) * 256 + Integer.parseInt(in2) > 1000 ? "1" : "0"
  1. Create Camera component.
  2. Make a link from "out" property in StringFunction to "captureState" in Camera component.
  3. Now, your PC takes a picture by USB camera when it turns from dark to blight. The pictures are stored at the URL indicated by "url" property in Camera component and you can see them by using a web browser.
Surveillance