Commit 6addc5e8 authored by Jake Read's avatar Jake Read

touches on a few

parent 250ff884
......@@ -16,13 +16,8 @@ This project serves the developement environment / api we use to write and repre
## For MW
- serial link OK, attach
- routes have route, test send
- thru route, append route
- thru link, to send.
- callback key subscribe fn's
- then: route change propogation?
- test with test: callback
- then draw something, and how does UI hook up, and when route changes ?
- how do users know to hookup, how to hookup ?
- then draw something, and how does UI hook up, and when route changes ?
- change /src to /modules or /units ?
......
......@@ -9,14 +9,14 @@ let Button = InOut.Button
const ATKRoute = require('./atkroute.js')
function Hardware(route){
function Hardware(){
var hardware = {
description:{
name: 'hardwareUnit',
alt: 'software representation of networked hardware object',
isHardware: true
},
route: ATKRoute(route)
route: ATKRoute('0,0')
}
hardware.state = State()
......@@ -24,10 +24,10 @@ function Hardware(route){
state.test = Button('test network', onNetworkTest)
state.message = 'click above to test network'
state.route = route
state.route = '0,0' // default
state.onChange('route', function(){
console.log("route change, need to git it thru")
hardware.route.route = state.route
})
function onNetworkTest(){
......
......@@ -15,7 +15,7 @@ function ATKBreadBoardServo() {
// '0,1' is the route to our piece of hardware
// 'onPacket' is the function that will be called
// when data arrives from that port
var atkbbs = Hardware('0,1')
var atkbbs = Hardware()
// change the name ...
atkbbs.description.name = 'ATKBBB-Servo'
......@@ -57,7 +57,9 @@ function ATKBreadBoardServo() {
}
// to get replies to certain packets, we can
// subscribe, where 141 (here) is the 'key'
// we're looking for on the network, and the
// msg is byte array we'll get back
atkbbs.route.subscribe(141, function(msg){
console.log('logging return', msg)
})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment