Pinoccio / library-pinoccio

Arduino library for Pinoccio
Other
28 stars 24 forks source link

Add mesh.setchannel #187

Closed jingman closed 10 years ago

jingman commented 10 years ago

This adds a function, mesh.setchannel for setting the mesh channel without having to also pass a pan id and address, as are required with mesh.config.

Usage: mesh.setchannel(26) will set the mesh channel to 26.

Important: You'll want all the Scouts in your Troop to change to this new channel as well, so the practical usage should be command.all("mesh.setchannel",26).

Closes: #187

amcjen commented 10 years ago

looks solid to me! only caveat is that if a scout doesn't get the message, then it'll be offline until the sending scout can switch back to that channel to communicate again.

jingman commented 10 years ago

Indeed. Well hey, great power, great responsibility!

matthijskooijman commented 10 years ago

Like I already said on Slack:

Code looks good, except that I think this introduces some duplicate code. the channel argument from meshConfig should probably removed and mesh.config van just call the new function

also, there is a lot of unrelated whitespace change that clutters the diff, please configure your editor to not do that (and preferably also remove the changes from this commit).

Furthermore, you should add a Closes: #187 to the commit message so that ticket is automatically closed when merging.

jingman commented 10 years ago

Thanks @matthijskooijman, I've made the edits you suggested - they're in d783a6088e7e8e063a9430b3ce2e67b62e2e6457

quartzjer commented 10 years ago

Looks good to me!