Switchbot and Wio Terminal

And from the original BLE_client i get this:

07:13:54.074 -> BLE Advertised Device found: Name: , Address: 30:32:90:2e:39:c8
07:13:54.074 -> BATT Device found: Name: , Address: 30:32:90:2e:39:c8
07:13:54.144 -> new BLEAdvertisedDevice
07:13:54.144 -> new BLEAdvertisedDevice done
07:13:54.144 -> Forming a connection to 30:32:90:2e:39:c8
07:13:54.144 -> - Created client
07:13:54.179 -> BLE Advertised Device found: Name: , Address: 2f:fb:ad:af:cb:79
07:13:54.247 -> BLE Advertised Device found: Name: , Address: fc:f9:35:d8:ea:44, serviceUUID: , serviceUUID:
07:13:56.452 -> - Connected to server
07:13:59.696 -> ScanCallback: GAP_MSG_LE_CONN_UPDATE_IND: conn_id 0, conn_interval_max 0x18, conn_interval_min 0x6, conn_latency 0x0,supervision_timeout 0x190
07:13:59.696 ->
cba20d00-224d-11e6-9fb8-0002a5d5c51b
07:14:11.509 -> Failed to find our service UUID: cba20d00-224d-11e6-9fb8-0002a5d5c51b
07:14:11.544 -> We have failed to connect to the server; there is nothin more we will do.
07:14:11.544 -> …


From the examples Seeed Adruino BLE BLE_client

/**
   A BLE client example that is rich in capabilities.
   There is a lot new capabilities implemented.
   author unknown
   updated by chegewara
*/

#include "BLEDevice.h"
#include "Seeed_erpcUnified.h"
#include <BLEScan.h>
#include <BLEAdvertisedDevice.h>

// The remote service we wish to connect to.
static BLEUUID serviceUUID("CBA20D00-224D-11E6-9FB8-0002A5D5C51B");
// The characteristic of the remote service we are interested in.
static BLEUUID    charUUID("CBA20002-224D-11E6-9FB8-0002A5D5C51B");

static boolean doConnect = true;
static boolean connected = true;
static boolean doScan = true;
static BLERemoteCharacteristic* pRemoteCharacteristic;
static BLEAdvertisedDevice* myDevice;
uint8_t bd_addr[6] = {0x30, 0x32, 0x90, 0x2e, 0x39, 0xc8}; //reversed
//uint8_t bd_addr[6] = {0xc8, 0x39, 0x2e, 0x90, 0x32, 0x30};
BLEAddress BattServer(bd_addr);

static uint8_t cmdPress[3] = {0x57, 0x01, 0x00};

static void notifyCallback(
  BLERemoteCharacteristic* pBLERemoteCharacteristic,
  uint8_t* pData,
  size_t length,
  bool isNotify) {
  Serial.print("Notify callback for characteristic ");
  Serial.print(pBLERemoteCharacteristic->getUUID().toString().c_str());
  Serial.print(" of data length ");
  Serial.println(length);
  Serial.print("data: ");
  Serial.print(*(uint8_t *)pData);
}

class MyClientCallback : public BLEClientCallbacks {
    void onConnect(BLEClient* pclient) {
    }
    void onDisconnect(BLEClient* pclient) {
      connected = false;
      Serial.println("onDisconnect");
    }
};

bool connectToServer() {
  Serial.print("Forming a connection to ");
  Serial.println(myDevice->getAddress().toString().c_str());

  BLEClient*  pClient  = BLEDevice::createClient();
  Serial.println(" - Created client");

  pClient->setClientCallbacks(new MyClientCallback());


  // Connect to the remove BLE Server.
  pClient->connect(myDevice);  // if you pass BLEAdvertisedDevice instead of address, it will be recognized type of peer device address (public or private)
  Serial.println(" - Connected to server");

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

  // Obtain a reference to the characteristic in the service of the remote BLE server.
  pRemoteCharacteristic = pRemoteService->getCharacteristic(charUUID);
  if (pRemoteCharacteristic == nullptr) {
    Serial.print("Failed to find our characteristic UUID: ");
    Serial.println(charUUID.toString().c_str());
    pClient->disconnect();
    return false;
  }
  Serial.println(" - Found our characteristic");

  // Read the value of the characteristic.
  if (pRemoteCharacteristic->canRead()) {
    Serial.println(" -  can  read  start");
    std::string value = pRemoteCharacteristic->readValue();
    Serial.print("The characteristic value was: ");
    Serial.println(value.c_str());
  }

  if (pRemoteCharacteristic->canNotify())
    //            cmd to send ------->>>>>>>>>          pRemoteCharacteristic->writeValue(cmdPress, sizeof(cmdPress), false);
    pRemoteCharacteristic->registerForNotify(notifyCallback);

  connected = true;
  return true;
}
/**
   Scan for BLE servers and find the first one that advertises the service we are looking for.
*/
class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
    /**
        Called for each advertising BLE server.
    */
    void onResult(BLEAdvertisedDevice advertisedDevice) {
      Serial.print("BLE Advertised Device found: ");
      Serial.println(advertisedDevice.toString().c_str());

      // We have found a device, let us now see if it contains the service we are looking for.
      if (memcmp(advertisedDevice.getAddress().getNative(), BattServer.getNative(), 6) == 0) {
        Serial.print("BATT Device found: ");
        Serial.println(advertisedDevice.toString().c_str());
        BLEDevice::getScan()->stop();
        Serial.println("new BLEAdvertisedDevice");
        myDevice = new BLEAdvertisedDevice(advertisedDevice);
        Serial.println("new BLEAdvertisedDevice done");
        doConnect = true;
        doScan = true;
      } // onResult
    }
}; // MyAdvertisedDeviceCallbacks


void setup() {
  Serial.begin(115200);
  while (!Serial) {};
  delay(2000);
  Serial.println("Starting Arduino BLE Client application...");
  BLEDevice::init("");

  // Retrieve a Scanner and set the callback we want to use to be informed when we
  // have detected a new device.  Specify that we want active scanning and start the
  // scan to run for 5 seconds.
  BLEScan* pBLEScan = BLEDevice::getScan();
  pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
  pBLEScan->setInterval(1349);
  pBLEScan->setWindow(449);
  pBLEScan->setActiveScan(true);
  pBLEScan->start(5, false);
} // End of setup.


// This is the Arduino main loop function.
void loop() {

  // If the flag "doConnect" is true then we have scanned for and found the desired
  // BLE Server with which we wish to connect.  Now we connect to it.  Once we are
  // connected we set the connected flag to be true.
  if (doConnect == true) {
    if (connectToServer()) {
      Serial.println("We are now connected to the BLE Server.");
    } else {
      Serial.println("We have failed to connect to the server; there is nothin more we will do.");
      
    }
    doConnect = false;
  }
  Serial.printf(".");
  delay(1000);
} // End of loop