RemoteCharacteristic->writeValue stuck at Semaphore taking ...

lightingghost
Posts: 3
Joined: Thu Aug 20, 2020 8:28 pm

RemoteCharacteristic->writeValue stuck at Semaphore taking ...

Postby lightingghost » Sun Aug 23, 2020 6:33 am

Source Code

Code: Select all

void notifyCallback(
  BLERemoteCharacteristic* pBLERemoteCharacteristic,
  uint8_t* pData,
  size_t length,
  bool isNotify) {

    log_d("Notify callback for characteristic %s",
          pBLERemoteCharacteristic->getUUID().toString().c_str());
    if (pBLERemoteCharacteristic->getUUID().toString() != heightCharUUID.toString()) {
      return;
    }

    PMotionData motion = (PMotionData) pData;
    log_i("Height: %d, Speed: %d", motion->height, motion->speed);

    curPosition = motion->height;
    moveTo(targetPosition);
}

int16_t readHeight() {
  if (pHeightCharacteristic == nullptr) return -1;
  // std::string val = pHeightCharacteristic->readValue(); 
  std::string val2 = pHeightCharacteristic->readValue(); 

  PMotionData motion = (PMotionData) val2.c_str();

  log_i("Height: %d, Speed: %d", motion->height, motion->speed);
  return motion->height;
}

void moveUp() {
  if (pMotionCharacteristic == nullptr) {
    return;
  }
  log_d("Move Up.");
  pMotionCharacteristic->writeValue(commandUp, 2);
}

void moveDown() {
  if (pMotionCharacteristic == nullptr) {
    return;
  }
  log_d("Move Down.");
  pMotionCharacteristic->writeValue(commandDown, 2);
}

void stop() {
  if (pMotionCharacteristic == nullptr) {
    return;
  }
  log_d("Stop.");
  pMotionCharacteristic->writeValue(commandStop, 2);
}

bool targetReached() {

  if ((abs(curPosition - minPosition) < tolerance 
       && movingDirection == DOWN) || 
      (abs(curPosition - maxPosition) < tolerance
       && movingDirection == UP)
     ){
        log_i("Max/Min position reached."); 
        return true;
  }
  if (targetPosition != -1) {
    log_d("Current %d, target %d, diff %d, tol %d", 
          curPosition, 
          targetPosition, 
          abs(curPosition - targetPosition), 
          tolerance);
    return abs(curPosition - targetPosition) < tolerance;
  }

  log_i("Target position not set.");
  return true;

}

void moveTo(uint16_t targetPos) {
  log_i("Move to %d", targetPos);
  targetPosition = targetPos;
  if (targetReached()) {
    log_i("Target reached!");
    targetPosition = -1;
    movingDirection = STOP;
    stop();
    return;
  }

  if (targetPosition < curPosition) {
    movingDirection = DOWN;
    moveDown();
    return;
  } 
  if (targetPosition > curPosition) {
    movingDirection = UP;
    moveUp();
    return;
  }

}

class MyClientCallback : public BLEClientCallbacks {
  void onConnect(BLEClient* pclient) {
    connected = true;
    digitalWrite(ledPin, HIGH);
  }

  void onDisconnect(BLEClient* pclient) {
    connected = false;
    digitalWrite(ledPin, LOW);
  }
};

bool connectToServer() {
    log_i("Forming a connection to %s", deskAddress.toString().c_str());
    
    BLEClient*  pClient  = BLEDevice::createClient();
    log_i("Created client");

    pClient->setClientCallbacks(new MyClientCallback());

    pClient->connect(deskAddress, BLE_ADDR_TYPE_RANDOM);
    delay(1000);
    log_i("Connected to server");

    // Obtain a reference to the service we are after in the remote BLE server.
    BLERemoteService* pHeightService = pClient->getService(heightServiceUUID);
    BLERemoteService* pMotionService = pClient->getService(motionServiceUUID);
    if (pHeightService == nullptr | pMotionService == nullptr) {
      Serial.print("Failed to find our service UUID: ");
      Serial.println(heightServiceUUID.toString().c_str());
      pClient->disconnect();
      return false;
    }
    log_i("Found height service");


    // Obtain a reference to the characteristic in the service of the remote BLE server.
    pHeightCharacteristic = pHeightService->getCharacteristic(heightCharUUID);
    pMotionCharacteristic = pMotionService->getCharacteristic(motionCharUUID);
    if (pHeightCharacteristic == nullptr) {
      Serial.print("Failed to find our characteristic UUID: ");
      Serial.println(heightCharUUID.toString().c_str());
      pClient->disconnect();
      return false;
    }
    log_i("Found height characteristic");

    if(pHeightCharacteristic->canNotify()){
      log_i("Set height characteristic notify");
      pHeightCharacteristic->registerForNotify(notifyCallback);
    }

    log_i("Motion characteristic can write: %d, can write wo response: %d",
      pMotionCharacteristic->canWrite(),
      pMotionCharacteristic->canWriteNoResponse());

    if (pHeightCharacteristic->canRead()) {
      log_i("Can read Height");
      int16_t height = readHeight();
      Serial.print("Height: ");
      Serial.println(height);
    }

    connected = true;
    return true;
}

bool debouncedButtonPressed(int buttonPin) {
  static uint8_t buttonState = HIGH;
  static uint8_t lastReading = HIGH;
  static uint32_t lastDebounceTime = 0;

  uint8_t reading = digitalRead(buttonPin);

  if (reading != lastReading) {
    lastDebounceTime = millis();
  }
  
  if ((millis() - lastDebounceTime) > debounceDelay) {
    if (reading != buttonState) {
      buttonState = reading;

      if (buttonState == HIGH) {
        return true;
      }
    }
  }
  lastReading = reading;
  return false;
}


void setup() {
  Serial.begin(115200);
  BLEDevice::init("");
  pinMode(ledPin, OUTPUT);
  pinMode(buttonPin, INPUT_PULLDOWN);
  digitalWrite(ledPin, LOW);
} // End of setup.


// This is the Arduino main loop function.
void loop() {
  // read the state of the pushbutton value:
  if (debouncedButtonPressed(buttonPin)) {
    log_i("Button Pressed");
    if (connected) {
      digitalWrite(ledPin, HIGH);
      moveTo(4000);
    } else {
      if(connectToServer()) {
        digitalWrite(ledPin, HIGH);
        moveTo(4000);
      }
    }
  }
  
  delay(20); 
} 
Basically, it is initiated with a moveUp call including writeValue to to the motion characteristic. When the server returns its current position in notifyCallback, moveUp (and writeValue) is called again. However, in the second writeValue call, it stucks at semaphore take. Then the board hang there and won't taken any button input.

The logic has been tested to work on an iphone.

log

Code: Select all

[I][DeskController.ino:258] loop(): Button Pressed
[I][DeskController.ino:166] connectToServer(): Forming a connection to e2:70:5c:5b:d3:26
[V][BLEDevice.cpp:60] createClient(): >> createClient
[V][BLEDevice.cpp:66] createClient(): << createClient
[I][DeskController.ino:169] connectToServer(): Created client
[V][BLEClient.cpp:96] connect(): >> connect(e2:70:5c:5b:d3:26)
[I][BLEDevice.cpp:593] addPeerDevice(): add conn_id: 0, GATT role: client
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: RegEvt (0x3ffdd44c), owner: <N/A> for connect
[D][FreeRTOS.cpp:199] take(): Semaphore taken:  name: RegEvt (0x3ffdd44c), owner: connect
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: RegEvt (0x3ffdd44c), owner: connect for connect
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 0
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 0
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 0
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][FreeRTOS.cpp:143] give(): Semaphore giving: name: RegEvt (0x3ffdd44c), owner: connect
[V][FreeRTOS.cpp:77] wait(): << wait: Semaphore released: name: RegEvt (0x3ffdd44c), owner: <N/A>
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: OpenEvt (0x3ffdddc0), owner: <N/A> for connect
[D][FreeRTOS.cpp:199] take(): Semaphore taken:  name: OpenEvt (0x3ffdddc0), owner: connect
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: OpenEvt (0x3ffdddc0), owner: connect for connect
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 40
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 40
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 40
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLEDevice.cpp:577] updatePeerDevice(): update conn_id: 4, GATT role: client
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 2
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 2
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 2
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][FreeRTOS.cpp:143] give(): Semaphore giving: name: OpenEvt (0x3ffdddc0), owner: connect
[V][FreeRTOS.cpp:77] wait(): << wait: Semaphore released: name: OpenEvt (0x3ffdddc0), owner: <N/A>
[V][BLEClient.cpp:129] connect(): << connect(), rc=1
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 18
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 18
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 18
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[I][DeskController.ino:175] connectToServer(): Connected to server
[V][BLEClient.cpp:377] getService(): >> getService: uuid: 99fa0020-338a-1024-8a49-009c0215f78a
[V][BLEClient.cpp:413] getServices(): >> getServices
[V][BLEClient.cpp:71] clearServices(): >> clearServices
[V][BLEClient.cpp:78] clearServices(): << clearServices
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: SearchCmplEvt (0x3ffdde20), owner: <N/A> for getServices
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][FreeRTOS.cpp:199] take(): Semaphore taken:  name: SearchCmplEvt (0x3ffdde20), owner: getServices
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: SearchCmplEvt (0x3ffdde20), owner: getServices for getServices
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLERemoteService.cpp:26] BLERemoteService(): >> BLERemoteService()
[V][BLERemoteService.cpp:34] BLERemoteService(): << BLERemoteService()
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLERemoteService.cpp:26] BLERemoteService(): >> BLERemoteService()
[V][BLERemoteService.cpp:34] BLERemoteService(): << BLERemoteService()
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLERemoteService.cpp:26] BLERemoteService(): >> BLERemoteService()
[V][BLERemoteService.cpp:34] BLERemoteService(): << BLERemoteService()
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLERemoteService.cpp:26] BLERemoteService(): >> BLERemoteService()
[V][BLERemoteService.cpp:34] BLERemoteService(): << BLERemoteService()
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLERemoteService.cpp:26] BLERemoteService(): >> BLERemoteService()
[V][BLERemoteService.cpp:34] BLERemoteService(): << BLERemoteService()
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 7
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLERemoteService.cpp:26] BLERemoteService(): >> BLERemoteService()
[V][BLERemoteService.cpp:34] BLERemoteService(): << BLERemoteService()
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 6
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 6
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 6
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][FreeRTOS.cpp:143] give(): Semaphore giving: name: SearchCmplEvt (0x3ffdde20), owner: getServices
[V][FreeRTOS.cpp:77] wait(): << wait: Semaphore released: name: SearchCmplEvt (0x3ffdde20), owner: <N/A>
[V][BLEClient.cpp:430] getServices(): << getServices
[V][BLEClient.cpp:390] getService(): << getService: found the service with uuid: 99fa0020-338a-1024-8a49-009c0215f78a
[V][BLEClient.cpp:377] getService(): >> getService: uuid: 99fa0001-338a-1024-8a49-009c0215f78a
[V][BLEClient.cpp:390] getService(): << getService: found the service with uuid: 99fa0001-338a-1024-8a49-009c0215f78a
[I][DeskController.ino:186] connectToServer(): Found height service
[V][BLERemoteService.cpp:162] retrieveCharacteristics(): >> getCharacteristics() for service: 99fa0020-338a-1024-8a49-009c0215f78a
[D][BLERemoteService.cpp:193] retrieveCharacteristics(): Found a characteristic: Handle: 26, UUID: 99fa0021-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:36] BLERemoteCharacteristic(): >> BLERemoteCharacteristic: handle: 26 0x26, uuid: 99fa0021-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:250] retrieveDescriptors(): >> retrieveDescriptors() for characteristic: 99fa0021-338a-1024-8a49-009c0215f78a
[D][BLERemoteCharacteristic.cpp:280] retrieveDescriptors(): Found a descriptor: Handle: 27, UUID: 00002902-0000-1000-8000-00805f9b34fb
[V][BLERemoteCharacteristic.cpp:294] retrieveDescriptors(): << retrieveDescriptors(): Found 1 descriptors.
[V][BLERemoteCharacteristic.cpp:45] BLERemoteCharacteristic(): << BLERemoteCharacteristic
[D][BLERemoteService.cpp:193] retrieveCharacteristics(): Found a characteristic: Handle: 29, UUID: 99fa0029-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:36] BLERemoteCharacteristic(): >> BLERemoteCharacteristic: handle: 29 0x29, uuid: 99fa0029-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:250] retrieveDescriptors(): >> retrieveDescriptors() for characteristic: 99fa0029-338a-1024-8a49-009c0215f78a
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[V][BLERemoteCharacteristic.cpp:294] retrieveDescriptors(): << retrieveDescriptors(): Found 0 descriptors.
[V][BLERemoteCharacteristic.cpp:45] BLERemoteCharacteristic(): << BLERemoteCharacteristic
[D][BLERemoteService.cpp:193] retrieveCharacteristics(): Found a characteristic: Handle: 31, UUID: 99fa002a-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:36] BLERemoteCharacteristic(): >> BLERemoteCharacteristic: handle: 31 0x31, uuid: 99fa002a-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:250] retrieveDescriptors(): >> retrieveDescriptors() for characteristic: 99fa002a-338a-1024-8a49-009c0215f78a
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[V][BLERemoteCharacteristic.cpp:294] retrieveDescriptors(): << retrieveDescriptors(): Found 0 descriptors.
[V][BLERemoteCharacteristic.cpp:45] BLERemoteCharacteristic(): << BLERemoteCharacteristic
[V][BLERemoteService.cpp:209] retrieveCharacteristics(): << getCharacteristics()
[V][BLERemoteService.cpp:162] retrieveCharacteristics(): >> getCharacteristics() for service: 99fa0001-338a-1024-8a49-009c0215f78a
[D][BLERemoteService.cpp:193] retrieveCharacteristics(): Found a characteristic: Handle: 16, UUID: 99fa0002-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:36] BLERemoteCharacteristic(): >> BLERemoteCharacteristic: handle: 16 0x16, uuid: 99fa0002-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:250] retrieveDescriptors(): >> retrieveDescriptors() for characteristic: 99fa0002-338a-1024-8a49-009c0215f78a
[E][BLERemoteCharacteristic.cpp:274] retrieveDescriptors(): esp_ble_gattc_get_all_descr: Unknown
[V][BLERemoteCharacteristic.cpp:294] retrieveDescriptors(): << retrieveDescriptors(): Found 0 descriptors.
[V][BLERemoteCharacteristic.cpp:45] BLERemoteCharacteristic(): << BLERemoteCharacteristic
[D][BLERemoteService.cpp:193] retrieveCharacteristics(): Found a characteristic: Handle: 18, UUID: 99fa0003-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:36] BLERemoteCharacteristic(): >> BLERemoteCharacteristic: handle: 18 0x18, uuid: 99fa0003-338a-1024-8a49-009c0215f78a
[V][BLERemoteCharacteristic.cpp:250] retrieveDescriptors(): >> retrieveDescriptors() for characteristic: 99fa0003-338a-1024-8a49-009c0215f78a
[D][BLERemoteCharacteristic.cpp:280] retrieveDescriptors(): Found a descriptor: Handle: 19, UUID: 00002902-0000-1000-8000-00805f9b34fb
[V][BLERemoteCharacteristic.cpp:294] retrieveDescriptors(): << retrieveDescriptors(): Found 1 descriptors.
[V][BLERemoteCharacteristic.cpp:45] BLERemoteCharacteristic(): << BLERemoteCharacteristic
[V][BLERemoteService.cpp:209] retrieveCharacteristics(): << getCharacteristics()
[I][DeskController.ino:198] connectToServer(): Found height characteristic
[I][DeskController.ino:201] connectToServer(): Set height characteristic notify
[V][BLERemoteCharacteristic.cpp:438] registerForNotify(): >> registerForNotify(): Characteristic: uuid: 99fa0021-338a-1024-8a49-009c0215f78a, handle: 26 0x001a, props: broadcast: 0, read: 1, write_nr: 0, write: 0, notify: 1, indicate: 0, auth: 0
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: RegForNotifyEvt (0x3ffdfd70), owner: <N/A> for registerForNotify
[D][FreeRTOS.cpp:199] take(): Semaphore taken:  name: RegForNotifyEvt (0x3ffdfd70), owner: registerForNotify
[V][BLERemoteCharacteristic.cpp:323] getDescriptor(): >> getDescriptor: uuid: 00002902-0000-1000-8000-00805f9b34fb
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 38
[V][BLERemoteCharacteristic.cpp:327] getDescriptor(): << getDescriptor: found
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLERemoteDescriptor.cpp:132] writeValue(): >> writeValue: handle: 27, uuid: 00002902-0000-1000-8000-00805f9b34fb
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 38
[V][BLERemoteDescriptor.cpp:151] writeValue(): << writeValue
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: RegForNotifyEvt (0x3ffdfd70), owner: registerForNotify for registerForNotify
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 38
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][FreeRTOS.cpp:143] give(): Semaphore giving: name: RegForNotifyEvt (0x3ffdfd70), owner: registerForNotify
[V][FreeRTOS.cpp:77] wait(): << wait: Semaphore released: name: RegForNotifyEvt (0x3ffdfd70), owner: <N/A>
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 8 0x08
[V][BLERemoteCharacteristic.cpp:478] registerForNotify(): << registerForNotify()
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[I][DeskController.ino:207] connectToServer(): Motion characteristic can write: 1, can write wo response: 1
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[I][DeskController.ino:210] connectToServer(): Can read Height
[I][BLEDevice.cpp:253] gapEventHandler(): ESP_GAP_BLE_AUTH_CMPL_EVT
[V][BLERemoteCharacteristic.cpp:398] readValue(): >> readValue(): uuid: 99fa0021-338a-1024-8a49-009c0215f78a, handle: 26 0x1a
[D][BLEClient.cpp:458] handleGAPEvent(): BLEClient ... handling GAP event!
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: ReadCharEvt (0x3ffdfd10), owner: <N/A> for readValue
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 9
[D][FreeRTOS.cpp:199] take(): Semaphore taken:  name: ReadCharEvt (0x3ffdfd10), owner: readValue
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: ReadCharEvt (0x3ffdfd10), owner: readValue for readValue
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 9
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 9
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:1817] gapEventToString(): gapEventToString: Unknown event type 20 0x14
[V][BLEUtils.cpp:1049] dumpGapEvent(): Received a GAP event: Unknown event type
[V][BLEUtils.cpp:1264] dumpGapEvent(): *** dumpGapEvent: Logger not coded ***
[D][BLEClient.cpp:458] handleGAPEvent(): BLEClient ... handling GAP event!
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 3
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 3
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 3
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][FreeRTOS.cpp:143] give(): Semaphore giving: name: ReadCharEvt (0x3ffdfd10), owner: readValue
[V][FreeRTOS.cpp:77] wait(): << wait: Semaphore released: name: ReadCharEvt (0x3ffdfd10), owner: <N/A>
[V][BLERemoteCharacteristic.cpp:426] readValue(): << readValue(): length: 4, content: o
[I][DeskController.ino:77] readHeight(): Height: 1647, Speed: 0
[I][DeskController.ino:130] moveTo(): Move to 4000
[D][DeskController.ino:120] targetReached(): Current 0, target 4000, diff 4000, tol 10
[D][DeskController.ino:85] moveUp(): Move Up.
[V][BLERemoteCharacteristic.cpp:549] writeValue(): >> writeValue(), length: 2
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: WriteCharEvt (0x3ffe0d70), owner: <N/A> for writeValue
[D][FreeRTOS.cpp:199] take(): Semaphore taken:  name: WriteCharEvt (0x3ffe0d70), owner: writeValue
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: WriteCharEvt (0x3ffe0d70), owner: writeValue for writeValue
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 4
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 4
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 4
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][FreeRTOS.cpp:143] give(): Semaphore giving: name: WriteCharEvt (0x3ffe0d70), owner: writeValue
[V][FreeRTOS.cpp:77] wait(): << wait: Semaphore released: name: WriteCharEvt (0x3ffe0d70), owner: <N/A>
[V][BLERemoteCharacteristic.cpp:576] writeValue(): << writeValue
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 10
[D][BLEDevice.cpp:148] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 10
[V][BLEUtils.cpp:1283] dumpGattClientEvent(): GATT Event: Unknown
[V][BLEUtils.cpp:951] gattClientEventTypeToString(): Unknown GATT Client event type: 10
[D][BLEClient.cpp:158] gattClientEventHandler(): gattClientEventHandler [esp_gatt_if: 4] ... Unknown
[D][BLERemoteCharacteristic.cpp:163] gattClientEventHandler(): Invoking callback for notification on characteristic Characteristic: uuid: 99fa0021-338a-1024-8a49-009c0215f78a, handle: 26 0x001a, props: broadcast: 0, read: 1, write_nr: 0, write: 0, notify: 1, indicate: 0, auth: 0
[D][DeskController.ino:58] notifyCallback(): Notify callback for characteristic 99fa0021-338a-1024-8a49-009c0215f78a
[I][DeskController.ino:64] notifyCallback(): Height: 1648, Speed: 704
[I][DeskController.ino:130] moveTo(): Move to 4000
[D][DeskController.ino:120] targetReached(): Current 1648, target 4000, diff 2352, tol 10
[D][DeskController.ino:85] moveUp(): Move Up.
[V][BLERemoteCharacteristic.cpp:549] writeValue(): >> writeValue(), length: 2
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: WriteCharEvt (0x3ffe0d70), owner: <N/A> for writeValue
[D][FreeRTOS.cpp:199] take(): Semaphore taken:  name: WriteCharEvt (0x3ffe0d70), owner: writeValue
[V][FreeRTOS.cpp:63] wait(): >> wait: Semaphore waiting: name: WriteCharEvt (0x3ffe0d70), owner: writeValue for writeValue
[I][DeskController.ino:258] loop(): Button Pressed
[I][DeskController.ino:130] moveTo(): Move to 4000
[D][DeskController.ino:120] targetReached(): Current 1648, target 4000, diff 2352, tol 10
[D][DeskController.ino:85] moveUp(): Move Up.
[V][BLERemoteCharacteristic.cpp:549] writeValue(): >> writeValue(), length: 2
[D][FreeRTOS.cpp:189] take(): Semaphore taking: name: WriteCharEvt (0x3ffe0d70), owner: writeValue for writeValue


Any help will be appreciated.

Who is online

Users browsing this forum: LukeMet and 72 guests