ESP32, Bluetooth, ble_ibeacon
0. 참고 사이트
- esp-idf\examples\bluetooth\ble_ibeacon
- https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/ble_ibeacon
1. 모듈
2. 보드 연결
3. 소스 설명
- esp_ibeacon_api.h
/* Because current ESP IDF version doesn't support scan and adv simultaneously, |
UUID, Major, Minor 값
#define ESP_UUID {0xFD, 0xA5, 0x06, 0x93, 0xA4, 0xE2, 0x4F, 0xB1, 0xAF, 0xCF, 0xC6, 0xEB, 0x07, 0x64, 0x78, 0x25} #define ESP_MAJOR 10167 |
- esp_ibeacon_api.c
bool esp_ble_is_ibeacon_packet (uint8_t *adv_data, uint8_t adv_data_len){ |
4. 소스
5. 결과 확인
- ESP32 Reveiver Mode
I (0) cpu_start: App cpu up.
I (401) heap_init: Initializing. RAM available for dynamic allocation:
I (407) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (413) heap_init: At 3FFCCC88 len 00013378 (76 KiB): DRAM
I (420) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (426) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (432) heap_init: At 40090DF4 len 0000F20C (60 KiB): IRAM
I (439) cpu_start: Pro cpu start user code
I (121) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (166) BTDM_INIT: BT controller compile version [00f6998]
I (166) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (466) phy: phy_version: 3910, c0c45a3, May 21 2018, 18:07:06, 0, 0
I (506) IBEACON_DEMO: register callback
I (506) IBEACON_DEMO: esp_gap_cb: 0x2
I (506) IBEACON_DEMO: ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT
I (516) IBEACON_DEMO: esp_gap_cb: 0x7
I (516) IBEACON_DEMO: ESP_GAP_BLE_SCAN_START_COMPLETE_EVT
I (20696) IBEACON_DEMO: esp_gap_cb: 0x3
I (20696) IBEACON_DEMO: ESP_GAP_BLE_SCAN_RESULT_EVT: 0x0
I (20696) IBEACON_DEMO: ----------iBeacon Found----------
I (20696) IBEACON_DEMO: Device address:: 84 0d 8e 17 12 6a
I (20706) IBEACON_DEMO: Proximity UUID:: fd a5 06 93 a4 e2 4f b1 af cf c6 eb 07 64 78 25
I (20716) IBEACON_DEMO: Major: 0x27b7 (10167)
I (20716) IBEACON_DEMO: Minor: 0xf206 (61958)
I (20726) IBEACON_DEMO: Measured power (RSSI at a 1m distance):-59 dbm
I (20736) IBEACON_DEMO: RSSI of packet:-54 dbm
I (20746) IBEACON_DEMO: esp_gap_cb: 0x3
I (20746) IBEACON_DEMO: ESP_GAP_BLE_SCAN_RESULT_EVT: 0x0
- ESP32 Sendor Mode
아이폰에서 테스트를 진행하였으며
Locate Beacon App을 사용하였습니다.
Sendor 입장이기 때문에 아래 로그 이외에 실시간 로그는 없습니다.
App에서 UUID, MAJOR, MINOR 값을 지정해야
beacon 기능을 테스트할 수 있습니다.
I (0) cpu_start: App cpu up. |
'ESP32' 카테고리의 다른 글
ESP32, 리눅스 개발 환경 설정 (0) | 2018.08.20 |
---|---|
ESP32, Wi-Fi, wifi_scan (1) | 2018.08.20 |
ESP32, UART, uart_nonblocking_select (0) | 2018.08.19 |
ESP32, UART, uart_queue_events (0) | 2018.08.19 |
ESP32, I2C, SSD1306 OLED (0) | 2018.08.17 |