Last active
July 12, 2018 01:49
-
-
Save TakehikoShimojima/254b65ca82bbe3674aaef62fc40973fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BLEDevice::init("AmbientEnv-02"); // デバイスを初期化 | |
| BLEServer *pServer = BLEDevice::createServer(); // サーバーを生成 | |
| BLEAdvertising *pAdvertising = pServer->getAdvertising(); // アドバタイズオブジェクトを取得 | |
| setAdvData(pAdvertising); // アドバタイジングデーターをセット | |
| pAdvertising->start(); // アドバタイズ起動 | |
| Serial.println("Advertizing started..."); | |
| delay(T_PERIOD * 1000); // T_PERIOD秒アドバタイズする | |
| pAdvertising->stop(); // アドバタイズ停止 | |
| seq++; // シーケンス番号を更新 | |
| Serial.printf("enter deep sleep\n"); | |
| esp_deep_sleep(1000000LL * S_PERIOD); // S_PERIOD秒Deep Sleepする | |
| Serial.printf("in deep sleep\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment