This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:iot-open:practical:hardware:sut:stm32:iot_5 [2024/05/04 08:34] – [Start] ktokarz | en:iot-open:practical:hardware:sut:stm32:iot_5 [2024/05/04 08:41] (current) – [Steps] ktokarz | ||
---|---|---|---|
Line 24: | Line 24: | ||
==== Start ==== | ==== Start ==== | ||
- | We need to implement both parts of the software to be able to observe the results (steps 1-4). **The Task 1** we implement in steps 1 and 2. **The Task 2** we implement in step 3. | + | We need to implement both parts of the software to be able to observe the results (steps 1-3). **The Task 1** we implement in steps 1 and 2. **The Task 2** we implement in step 3. |
==== Steps ==== | ==== Steps ==== | ||
We can go through the lab in a few steps. In the beginning, we will write a simple program which advertises the device with the default parameters set in the BLE library. As the payload of the advertising frame, we will use the Eddystone format to send the chosen URL address. | We can go through the lab in a few steps. In the beginning, we will write a simple program which advertises the device with the default parameters set in the BLE library. As the payload of the advertising frame, we will use the Eddystone format to send the chosen URL address. | ||
Line 206: | Line 206: | ||
if (peripheral) { | if (peripheral) { | ||
lcd.clear(); | lcd.clear(); | ||
- | if (peripheral.localName() == "SUT BLE device") { | + | if (peripheral.localName() == "STM32 Beacon") { |
// display remote name | // display remote name | ||
Line 216: | Line 216: | ||
lcd.print(REMOTE_SERVICE_UUID); | lcd.print(REMOTE_SERVICE_UUID); | ||
} | } | ||
- | } | ||
- | else // restart scanning | ||
- | { | ||
- | int ret = 1; | ||
- | do | ||
- | { | ||
- | ret = BLE.scanForUuid(REMOTE_SERVICE_UUID); | ||
- | if (ret == 0) | ||
- | { | ||
- | BLE.end(); | ||
- | BLE.begin(); | ||
- | } | ||
- | } while(ret == 0); | ||
} | } | ||
} | } |