Created
July 11, 2018 07:00
-
-
Save TakehikoShimojima/4a9b7f39f8f555ff610a7e7ea06bfb27 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-01"); // デバイスを初期化 | |
| BLEServer *pServer = BLEDevice::createServer(); // サーバーを生成 | |
| pServer->setCallbacks(new MyServerCallbacks()); // コールバック関数を設定 | |
| BLEService *pService = pServer->createService(SENSOR_UUID); // サービスを生成 | |
| // キャラクタリスティクスを生成 | |
| pService->createCharacteristic(LATESTDATA_UUID, BLECharacteristic::PROPERTY_READ) | |
| ->setCallbacks(new dataCb()); // コールバック関数を設定 | |
| pService->start(); // サービスを起動 | |
| pServer->getAdvertising()->start(); // アドバタイズを起動 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment