Andrea Vicari
/
BLELedScanner
Write a proximity-aware Mbed-based LED scanner!
Diff: source/main.cpp
- Revision:
- 4:28c05d426fc1
- Parent:
- 3:f6bf91b5f492
- Child:
- 5:2d307782cb69
--- a/source/main.cpp Fri Nov 30 12:25:14 2018 +0000 +++ b/source/main.cpp Fri Nov 30 12:32:04 2018 +0000 @@ -51,12 +51,12 @@ const uint8_t* value = params->advertisingData + i + 2; const uint8_t value_length = record_length - 1; - printf("Device discovered: %d \n", &value); +// printf("Device discovered: %d \n", &value); if(type == GapAdvertisingData::COMPLETE_LOCAL_NAME) { if ((value_length == sizeof(PEER_NAME)) && (memcmp(value, PEER_NAME, value_length) == 0)) { - printf("Distance from %d is %d\n", &PEER_NAME, params->peerAddr[4]); - int distance = params->peerAddr[4]; + printf("Distance from %d is %d\n", &PEER_NAME, params->rssi); + int uint8_t = params->rssi; if (distance > -100 && distance < 20) { led1 = 1;