Bluetooth LE Signal Strength Linux

前端 未结 7 1840
谎友^
谎友^ 2020-12-05 00:50

Hello is there any way to get the signal strength of near by bluetooth le devises in linux? Or any good libraries for nodejs, php or mono (I do know some c++ or python but w

相关标签:
7条回答
  • 2020-12-05 01:55

    This works for c language, but has an error when casting the bytes that have the information about de rssi signal. https://github.com/glock45/intel-edison-playground/blob/master/scan.c

    this line 121:

    printf("%s - RSSI %d\n", addr, (**char**)info->data[info->length]);
    

    should be:

    printf("%s - RSSI %d\n", addr, (**int8_t**)info->data[info->length]);
    

    I found these by looking inside bluez-version/monitor/*.c, where btmon program is. You can see the data types and structs, hcidump.c is very useful and packets.c, and main.c too, but there are many to learn about the hci sockets.

    0 讨论(0)
提交回复
热议问题