demo howto - modrpc/info GitHub Wiki

Directories

  • The etc directory contains two files: device.dat and syslib.dat.
    • device.dat contains "device-address" table. update this file using correct IP address of dev0 and dev1
    • syslib.dat contains system event, reactor, event-reactor associations -- do not edit this files; these define the basic system functionality such as function call and property_get/set.
  • The test/demo/dev0 directory contains data files for BUTTON-device
    • dev0.dat defines reactors, timers, etc. for device 0.
  • The test/demo/dev1 directory contains data files for LED-device
    • dev1.dat contains reactors, etc for device 1.
  • The mvsh directory contains a simple shell program

BUTTON-LED DEMO

  • LED-device
    • Copy entire mvcode directory to dev0
    • edit etc/device.dat to contain correct IP address
    • cd test/demo/dev1
    • do "run.sh"
  • BUTTON-device
    • Copy entire mvcode directory to dev0
    • edit etc/device.dat to contain correct IP address
    • cd test/demo/dev0
    • edit reactor.dat so that PIN number is correctly set
    • do "run.sh"

Using MVSH

  • MVSH is a shell which can access services of other devices.
  • Currently only two commands are supported
  // displays the value of property "prop0" of device "dev1"
  # prop_get dev1:prop0

  // updates the value of property "prop0" of device "dev1" to 1234
  // NOTE: currently parser does not properly support full JSON-format 
  // values but eventually, one can assign any JSON-format value (say, 
  // string, list, etc.) to "prop0"; a property can have integer value 
  // at one point and string value at another point
  # prop_set dev1:prop0 1234

  // later, reading the "prop0" again will display 1234
  prop_get dev1:prop0
  • Be sure to run inside mvsh/ directory, which contains symlink to "etc" -- it will read etc/device.dat during initialization.
⚠️ **GitHub.com Fallback** ⚠️