From 1ede732a9b2e592248c5c13fec2f111953f4a706 Mon Sep 17 00:00:00 2001 From: Jerome Jutteau Date: Tue, 2 Apr 2013 00:39:34 +0200 Subject: digital/io-hub/src/apbirthday: add candles arm manipulation commands to proto --- digital/io-hub/src/apbirthday/robot.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'digital/io-hub/src/apbirthday') diff --git a/digital/io-hub/src/apbirthday/robot.cc b/digital/io-hub/src/apbirthday/robot.cc index 900a4fda..2e795c03 100644 --- a/digital/io-hub/src/apbirthday/robot.cc +++ b/digital/io-hub/src/apbirthday/robot.cc @@ -269,6 +269,20 @@ Robot::proto_handle (ucoo::Proto &proto, char cmd, const uint8_t *args, int size stats_pressure_cpt_ = stats_pressure_ = args[0]; stats_proto_ = &proto; break; + case c ('b', 2): + // Candles arm manipulation. + // - 1B: manipulate arm (0) or punchers (1) + // - 1B: action: + // * deploy arm (0) + // * undeploy arm (1) + // * candle value + if (args[0] == 0 && args[1] == 0) + FSM_HANDLE (AI, ai_candle_deploy); + else if (args[0] == 0 && args[1] == 1) + FSM_HANDLE (AI, ai_candle_deploy); + else + candles.blow (args[1]); + break; default: proto.send ('?'); return; -- cgit v1.2.3