Ejemplo n.º 1
0
void ApiV3::parseCommand(Command &command)
{
    if (command.data->length() >= 2)
    {
        switch (command.data->at(1))
        {
        case cmd_connection:
            parseConnectCommand(command);
            break;
        case cmd_get:
            answerGetRequest(command);
            break;
        case cmd_set:
            setValue(command);
            break;
        case cmd_mouse:
            parseMouseCommand(command);
            break;
        case cmd_keyboard:
            parseKeyboardCommand(command);
            break;
        case cmd_open:
            parseOpenCommand(command);
            break;
        default:
            Logger::Instance()->add("Unknown command " + Converter::Instance()->commandToString(command));
            break;
        }
    }
}
Ejemplo n.º 2
0
void ApiV2::parseRemoteCommand(Command &command)
{
    if (command.data->length() >= 2)
    {
        switch (command.data->at(1)) {
        case cmd_mouse:
            parseMouseCommand(command);
            break;
        case cmd_pointer:
            parsePointerCommand(command);
            break;
        case cmd_media:
            parseMediaCommand(command);
            break;
        case cmd_request:
            parseRequest(command);
            break;
        case cmd_laser:
            parseLaserCommand(command);
            break;
        case cmd_custom:
            parseCustomCommand(command);
            break;
        default:
            //Logger::Instance()->add("Unkown remote command");
            break;
        }
    }
}