gap_inquiry.c (f5875de52c2368de57990d41b456c83e57f8f0ee) gap_inquiry.c (b7f1ee76fc01b4587d4b3491e7884299bad22f99)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 92 unchanged lines hidden (view full) ---

101
102static void do_next_remote_name_request(void){
103 int i;
104 for (i=0;i<deviceCount;i++) {
105 // remote name request
106 if (devices[i].state == REMOTE_NAME_REQUEST){
107 devices[i].state = REMOTE_NAME_INQUIRED;
108 printf("Get remote name of %s...\n", bd_addr_to_str(devices[i].address));
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 92 unchanged lines hidden (view full) ---

101
102static void do_next_remote_name_request(void){
103 int i;
104 for (i=0;i<deviceCount;i++) {
105 // remote name request
106 if (devices[i].state == REMOTE_NAME_REQUEST){
107 devices[i].state = REMOTE_NAME_INQUIRED;
108 printf("Get remote name of %s...\n", bd_addr_to_str(devices[i].address));
109 hci_send_cmd(&hci_remote_name_request, devices[i].address,
110 devices[i].pageScanRepetitionMode, 0, devices[i].clockOffset | 0x8000);
109 gap_remote_name_request( devices[i].address, devices[i].pageScanRepetitionMode, devices[i].clockOffset | 0x8000);
111 return;
112 }
113 }
114}
115
116static void continue_remote_names(void){
117 if (has_more_remote_name_requests()){
118 do_next_remote_name_request();

--- 58 unchanged lines hidden (view full) ---

177
178 memcpy(devices[deviceCount].address, addr, 6);
179 devices[deviceCount].pageScanRepetitionMode = gap_event_inquiry_result_get_page_scan_repetition_mode(packet);
180 devices[deviceCount].clockOffset = gap_event_inquiry_result_get_clock_offset(packet);
181 // print info
182 printf("Device found: %s ", bd_addr_to_str(addr));
183 printf("with COD: 0x%06x, ", (unsigned int) gap_event_inquiry_result_get_class_of_device(packet));
184 printf("pageScan %d, ", devices[deviceCount].pageScanRepetitionMode);
110 return;
111 }
112 }
113}
114
115static void continue_remote_names(void){
116 if (has_more_remote_name_requests()){
117 do_next_remote_name_request();

--- 58 unchanged lines hidden (view full) ---

176
177 memcpy(devices[deviceCount].address, addr, 6);
178 devices[deviceCount].pageScanRepetitionMode = gap_event_inquiry_result_get_page_scan_repetition_mode(packet);
179 devices[deviceCount].clockOffset = gap_event_inquiry_result_get_clock_offset(packet);
180 // print info
181 printf("Device found: %s ", bd_addr_to_str(addr));
182 printf("with COD: 0x%06x, ", (unsigned int) gap_event_inquiry_result_get_class_of_device(packet));
183 printf("pageScan %d, ", devices[deviceCount].pageScanRepetitionMode);
185 printf("clock offset 0x%04x",devices[deviceCount].clockOffset);
184 printf("clock offset 0x%04x",devices[deviceCount].clockOffset & 0x7fff);
186 if (gap_event_inquiry_result_get_rssi_availabe(packet)){
187 printf(", rssi %d dBm", (int8_t) gap_event_inquiry_result_get_rssi(packet));
188 }
189 if (gap_event_inquiry_result_get_name_available(packet)){
190 char name_buffer[240];
191 int name_len = gap_event_inquiry_result_get_name_len(packet);
192 memcpy(name_buffer, gap_event_inquiry_result_get_name(packet), name_len);
193 name_buffer[name_len] = 0;

--- 72 unchanged lines hidden ---
185 if (gap_event_inquiry_result_get_rssi_availabe(packet)){
186 printf(", rssi %d dBm", (int8_t) gap_event_inquiry_result_get_rssi(packet));
187 }
188 if (gap_event_inquiry_result_get_name_available(packet)){
189 char name_buffer[240];
190 int name_len = gap_event_inquiry_result_get_name_len(packet);
191 memcpy(name_buffer, gap_event_inquiry_result_get_name(packet), name_len);
192 name_buffer[name_len] = 0;

--- 72 unchanged lines hidden ---