Well, the SmartDasboard's entire communication interface is run via NetworkTables, so you have to work with those. On the SmartDashboard end, you probably want to make some sort of extension, with those options possibly as properties for the extension. Then, when these properties change, you change a value in a NetworkTable, then retrieve it on the robot end with a get<Type>(<key>).
That was a terribly generic description, so let's spice it up with an
example! Let's say you have a SmartDashboard extension (what it does doesn't matter for the scope of this example), and it has a property called "speed". On the extension's end, you have 2 ways to do this, and each has a corresponding way of accessing it on the robot.
The first way:
Code:
// SmartDashboard end
NetworkTable table = Robot.getTable();
table.beginTransaction();
table.putDouble("speed",SpeedProperty.getValue()),
table.endTransaction();
// Robot end
double speed = NetworkTable.getTable("SmartDashboard").getDouble("speed");
Note that on the SmartDashboard end, you could replace Robot.getTable() with NetworkTable.getTable("SmartDashboard") and it would do the exact same thing.
Now for the second method (which is really the same thing, just put together slightly differently):
Code:
// SmartDashboard
NetworkTable table = NetworkTable.getTable("Super awesome extension of awesome coolness XTREME!"); // note the custom table name
table.beginTransaction();
table.putDouble("speed",SpeedProperty.getValue()),
table.endTransaction();
// Robot
double speed = NetworkTable.getTable("Super awesome extension of awesome coolness XTREME!").getDouble("speed"); // if the table name is the same on both ends, it will work as though it's really just one table.
Just keep in mind the basic rules of NetworkTables: surround all puts with begin/endTransaction bits, and don't expect instant transfer.
Happy SmartDashboarding!