     ledcWriteNote(0,NOTE_D,8);              // 送信中の音
     delay(200);                             // 送信待ち時間
     ledcWrite(0, 0);
-    pAdvertising->stop();
     esp_deep_sleep(SLEEP_P);                // Deep Sleepモードへ移行
 }
-
-void setBleAdvData(byte *data, int data_n){
-    BLEAdvertisementData oAdvertisementData = BLEAdvertisementData();
-    BLEAdvertisementData oScanResponseData = BLEAdvertisementData();
-    oAdvertisementData.setName(BLE_DEVICE);
-    oAdvertisementData.setFlags(0x06);      // LE General Discoverable Mode | BR_EDR_NOT_SUPPORTED
-    
-    std::string strServiceData = "";
-    strServiceData += (char)(data_n+3);     // Len
-    strServiceData += (char)0xFF;           // Manufacturer specific data
-    strServiceData += (char)0x01;           // Company Identifier(2 Octet)
-    strServiceData += (char)0x00;
-    for(int i=0;i<data_n;i++) strServiceData += (char)(data[i]);
-
-    oAdvertisementData.addData(strServiceData);
-    pAdvertising->setAdvertisementData(oAdvertisementData);
-    pAdvertising->setScanResponseData(oScanResponseData);
-
-    Serial.print("data            = ");
-    int len=strServiceData.size();
-    if(len != (int)(strServiceData[0]) + 1 || len < 2) Serial.println("ERROR: BLE length");
-    for(int i=2;i<len;i++) Serial.printf("%02x ",(char)(strServiceData[i]));
-    Serial.println();
-    Serial.print("data length     = ");
-    Serial.println(len - 2);
-}

    Serial.begin(115200);                   // 動作確認のためのシリアル出力開始
    Serial.println("IoT SensorShield EVK"); // 「IoT SensorShield EVK」を表示
    int wake = TimerWakeUp_init();
    BLEDevice::init(BLE_DEVICE);            // Create the BLE Device
    Wire.begin();
    bm1383aglv.init();                      // 気圧センサの初期化
    kx224.init();                           // 加速度センサの初期化


乾電池などで動作するIoTセンサです

                                          Copyright (c) 2016-2019 Wataru KUNINO
*******************************************************************************/
#include <WiFi.h>                           // ESP32用WiFiライブラリ
#include <WiFiUdp.h>                        // UDP通信を行うライブラリ
#include "esp_sleep.h"                      // ESP32用Deep Sleep ライブラリ
#define PIN_EN 2                            // GPIO 2 にLEDを接続
#define PIN_BUZZER 12                       // GPIO 12 にスピーカを接続
