About Inquiry_with_RSSI
Carlos Fernández Herranz
cfernandezh at udc.es
Tue Mar 28 11:56:41 UTC 2006
Sorry, here is the code:
char *end_inquiry="end_inquiry";
char *unreachable="unreachable";
//int timeout;
int numeric_bdaddr = 0;
char *nodo;
char respuesta[20];
int main(int argc, char *argv[]) {
// char *cmd, *btaddr;
// int continuar=1;
int socket;
int res;
char *handle=malloc(5**sizeof*(char));
*if* (argc!=3) exit(1);
nodo=malloc (10**sizeof*(char));
*if* ((find_hci_name (argv[1]))!=0) continuar=0;
*else* continuar=1;
*while* (continuar) {
// cmd = "inquiry";
/
/ *if*(strcmp(cmd,"inquiry")==0) {
socket=socket_open(nodo);
printf("\nWRITE_INQUIRY_MODE: %d \n", hci_write_inquiry_mode(socket, 0x01)); /********************************/
*if* (hci_inquiry(socket)!=OK) {
fprintf(stderr,"Inquiry failed\n");
}
printf("\nCLOSE SOCKET: %d\n", close(socket));
}
*else* *if* (strcmp(cmd,"link")==0) {
//DO LINK QUALITY
}
/// free(auxstr); /
}
free(nodo);
*return* (0);
} //* main *//
Thank you.
Iain Hibbert wrote:
>On Tue, 28 Mar 2006, Carlos Fernández Herranz wrote:
>
>
>
>>The problem is that the "write_inquiry_mode" command doesn't seem to
>>work, because I only receive " NG_HCI_EVENT_INQUIRY_RESULT" events
>>instead of "NG_HCI_EVENT_INQUIRY_RESULT_WITH_RSSI" ones.
>>
>>Could you tell me if I'm doing something wrong?:
>>
>>
>
>you dont show where you are actually calling the hci_write_inquiry_mode()
>function, did you actually do that?
>
>iain
>
More information about the freebsd-bluetooth
mailing list