Implement 'getMode'

This commit is contained in:
jacobperron 2016-03-28 22:31:23 -07:00
parent 75dd293bfd
commit fbef2e2c88
3 changed files with 14 additions and 3 deletions

View file

@ -687,6 +687,16 @@ namespace create {
}
}
create::CreateMode Create::getMode() const {
if (data->isValidPacketID(ID_OI_MODE)) {
return (create::CreateMode) GET_DATA(ID_OI_MODE);
}
else {
CERR("[create::Create] ", "Querying Mode not supported!");
return create::MODE_UNAVAILABLE;
}
}
const Pose& Create::getPose() const {
return pose;
}

View file

@ -25,6 +25,7 @@ namespace create {
ADD_PACKET(ID_CHARGE , 2, "battery_charge");
ADD_PACKET(ID_CAPACITY, 2, "battery_capacity");
ADD_PACKET(ID_VIRTUAL_WALL, 1, "virtual_wall");
ADD_PACKET(ID_OI_MODE, 1, "oi_mode");
if (model == CREATE_1) {
ADD_PACKET(ID_DISTANCE, 2, "distance");
@ -42,7 +43,6 @@ namespace create {
//ADD_PACKET(ID_UNUSED_2, 1, "unused 2");
//ADD_PACKET(ID_UNUSED_3, 2, "unused 3");
//ADD_PACKET(ID_CHARGE_SOURCE, 1, "charger_available");
//ADD_PACKET(ID_IO_MODE, 1, "oi_mode");
//ADD_PACKET(ID_SONG_NUM, 1, "song_number");
//ADD_PACKET(ID_PLAYING, 1, "song_playing");
//ADD_PACKET(ID_NUM_STREAM_PACKETS, 1, "oi_stream_num_packets");