/**
   * treat the message and return the next message to send
   *
   * @param readMessage
   * @return BattleCommunicationObject the reponse or the next message
   */
  public BattleCommunicationObject handleInComingMessage(BattleCommunicationObject readMessage) {

    BattleCommunicationObject response = new BattleCommunicationObject();

    Log.e(TAG, "handleInComingMessage");

    // by default, we send back an "ack" to opponent...
    response.setAction(CommAction.RESPONSE_OK);
    // with the same ID..
    response.setUniqueId(readMessage.getUniqueId());

    switch (readMessage.getAction()) {
      case RESPONSE_OK:
        // we receive an "ack" from opponent, send next message if necessary
        Log.e(TAG, "this is an ACK for UID = " + readMessage.getUniqueId());
        sentMessageHasBeenReceived(readMessage.getUniqueId());
        return getNextMessageToSend();
      case INIT_BLUETOOTH:
        Log.e(TAG, "INIT_BLUETOOTH");
        currentConnectStatus = ConnectStatusEnum.CONNECTED;
        currentDataStatus = DataStatusEnum.HELLO;
        return null;
      case HELLO:
        // the other part sends an hello, they will next send the army
        break;
      case START_ARMY_LIST:
        currentDataStatus = DataStatusEnum.RECEIVING_ARMY;
        Log.e(TAG, "received START_ARMY_LIST");
        BattleSingleton.getInstance().startLoadingArmy2();
        break;
      case SEND_ARMY_STORE:
        Log.e(TAG, "received SEND_ARMY_STORE");
        ArmyStore army = readMessage.getArmyStore();
        BattleSingleton.getInstance().setArmy(army, BattleSingleton.PLAYER2);
        break;
      case ADD_ENTRY:
        Log.e(TAG, "received ADD_ENTRY");
        BattleSingleton.getInstance().addArmy2Entry(readMessage.getBattleEntry());
        break;
      case END_ARMY_LIST:
        Log.e(TAG, "received END_ARMY_LIST");
        BattleSingleton.getInstance().finishLoadingArmy2();
        currentDataStatus = DataStatusEnum.ARMY_RECEIVED;
        break;
      case SEND_ME_YOUR_LIST:
        Log.e(TAG, "received SEND_ME_YOUR_LIST");
        if (!queueBattleEntries.isEmpty()) {
          currentDataStatus = DataStatusEnum.ARMY_NOT_SENT;
          return getNextMessageToSend();
        } else {
          currentDataStatus = DataStatusEnum.WAITING;
          return null;
        }
      case MODIFY_DAMAGE_GRID:
        handleIncomingDamageFromBT(readMessage.getDamageGrid());
        break;
      case BLUETOOTH_STATUS_MESSAGE:
        //        	blueToothDisconnect();
        currentConnectStatus = ConnectStatusEnum.NOT_CONNECTED;
        currentDataStatus = DataStatusEnum.HELLO;
        return null;
      case PLAYER1_PLAY:
      case PLAYER2_PLAY:
      case CHRONO_PAUSE:
        handleIncomingChronoEvent(readMessage);
        break;
    }

    return response;
  }