Exemple #1
0
        public SdkWrapper.SdkReponses SendCommand(Action command)
        {
            var serverResponse = SdkWrapper.SdkReponses.FAIL;

            try
            {
                if (_client == null)
                {
                    throw new Exception("Client is null");
                }
                serverResponse = _client.SendMessage(command);
                _response      = _client.ServerResponse;
            }
            catch (Exception ex)
            {
                if (command.Type == Action.ActionTypes.CommandMode)
                {
                    //drone is probably already in command mode. Continue
                    return(SdkWrapper.SdkReponses.OK);
                }
                _lastException = ex;
                return(SdkWrapper.SdkReponses.FAIL);
            }
            return(serverResponse);
        }