Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aceffd8d authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Automerger Merge Worker
Browse files

csip: Force CSIP implementation to behave incorrectly am: 78b38488

parents da84302f 78b38488
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -376,6 +376,7 @@ class CsisClientImpl : public CsisClient {
      if (next_dev) {
      if (next_dev) {
        auto next_csis_inst = next_dev->GetCsisInstanceByGroupId(group_id);
        auto next_csis_inst = next_dev->GetCsisInstanceByGroupId(group_id);
        LOG_ASSERT(csis_instance) << " csis_instance does not exist!";
        LOG_ASSERT(csis_instance) << " csis_instance does not exist!";
#if CSIP_UPPER_TESTER_FORCE_TO_SEND_LOCK == FALSE
        if (next_csis_inst->GetLockState() ==
        if (next_csis_inst->GetLockState() ==
            CsisLockState::CSIS_STATE_LOCKED) {
            CsisLockState::CSIS_STATE_LOCKED) {
          /* Somebody else managed to lock it.
          /* Somebody else managed to lock it.
@@ -384,6 +385,7 @@ class CsisClientImpl : public CsisClient {
          HandleCsisLockProcedureError(csis_group, next_dev);
          HandleCsisLockProcedureError(csis_group, next_dev);
          return;
          return;
        }
        }
#endif
        SetLock(next_dev, next_csis_inst, CsisLockState::CSIS_STATE_LOCKED);
        SetLock(next_dev, next_csis_inst, CsisLockState::CSIS_STATE_LOCKED);
      }
      }
    }
    }
@@ -479,6 +481,7 @@ class CsisClientImpl : public CsisClient {
      return;
      return;
    }
    }


#if CSIP_UPPER_TESTER_FORCE_TO_SEND_LOCK == FALSE
    if (lock && !csis_group->IsAvailableForCsisLockOperation()) {
    if (lock && !csis_group->IsAvailableForCsisLockOperation()) {
      DLOG(INFO) << __func__ << " Group " << group_id << " locked by other";
      DLOG(INFO) << __func__ << " Group " << group_id << " locked by other";
      NotifyGroupStatus(group_id, false,
      NotifyGroupStatus(group_id, false,
@@ -486,6 +489,7 @@ class CsisClientImpl : public CsisClient {
                        std::move(cb));
                        std::move(cb));
      return;
      return;
    }
    }
#endif


    csis_group->SetTargetLockState(new_lock_state, std::move(cb));
    csis_group->SetTargetLockState(new_lock_state, std::move(cb));


+12 −0
Original line number Original line Diff line number Diff line
@@ -560,6 +560,18 @@
#ifndef GATT_UPPER_TESTER_MULT_VARIABLE_LENGTH_READ
#ifndef GATT_UPPER_TESTER_MULT_VARIABLE_LENGTH_READ
#define GATT_UPPER_TESTER_MULT_VARIABLE_LENGTH_READ FALSE
#define GATT_UPPER_TESTER_MULT_VARIABLE_LENGTH_READ FALSE
#endif
#endif

/******************************************************************************
 *
 * CSIP
 *
 *****************************************************************************/

/* Used to trigger invalid behaviour of CSIP test case PTS */
#ifndef CSIP_UPPER_TESTER_FORCE_TO_SEND_LOCK
#define CSIP_UPPER_TESTER_FORCE_TO_SEND_LOCK FALSE
#endif

/******************************************************************************
/******************************************************************************
 *
 *
 * SMP
 * SMP