Module: drivers/gateways/virtual

This driver can be used by custom applications (user interface / other applications) to store custom data in variables. Those variables can be logged like any other address. These variables can store number, strings, javascript JSON objects, javascript date, regular expressions, etc..

Address parameters

Each address has a "remanent" parameter that defines if the values are stored on the system disk or not. Sometimes it is important to store the last value if the system reboots.

Address format

The virtual addresses are similar to php variables. It is a string prefixed with the dollar sign.

 //regex used to validate virtual addresses:
 /^\$[a-zA-Z_$0-9]+$/


Use cases


gateways.writeValue('$test', 'this is a string')

gateways.writeValue('$test', {'key':'this is an object'})

gateways.readValue($test, function(err,value){ 
	
})
gateways.getLastValue('$test', function(err,value){ ... })

gateways.writeValue('$test', 0)

gateways.on('newValue $test', function(err,value){	//receives new values..

	console.log(value)
})