EricssonResearch / calvin-base

Calvin is an application environment that lets things talk to things, among other things.
Apache License 2.0
282 stars 91 forks source link

Expose constants defined in calvinsys to Calvin scripts #12

Open fswensson opened 8 years ago

fswensson commented 8 years ago

It would be nice to be able to use constants defined in an object in calvinsys from an Calvin script.

Example: calvinsys/io/gpio_handler defines the constants PULLUP and PULLDOWN for enabling internal pull up/down resistors, these are then accessible from an Calvin script:

gpio : io.GPIOReader(pull=calvinsys.io.gpio_handler.PULLUP)

persquare commented 8 years ago

What about @io.gpio_handler.PULLUP using @ to signify an "address" to a value? Could be used as is, or in via a define PULLUP = @io.gpio_handler.PULLUP.

fswensson commented 8 years ago

Looks good!