gap_inquiry.c (0e2df43f5cbae3fc71139523458b98f30307d21b) gap_inquiry.c (a0ffb263e02c613f9155d5035f68cb0ad7b80d74)
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

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

137 if (packet_type != HCI_EVENT_PACKET) return;
138
139 uint8_t event = hci_event_packet_get_type(packet);
140
141 switch(state){
142 /* @text In INIT, an inquiry scan is started, and the application transits to
143 * ACTIVE state.
144 */
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

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

137 if (packet_type != HCI_EVENT_PACKET) return;
138
139 uint8_t event = hci_event_packet_get_type(packet);
140
141 switch(state){
142 /* @text In INIT, an inquiry scan is started, and the application transits to
143 * ACTIVE state.
144 */
145 case INIT:
146 if (packet[2] == HCI_STATE_WORKING) {
147 start_scan();
148 state = ACTIVE;
145 case INIT:
146 switch(event){
147 case BTSTACK_EVENT_STATE:
148 if (packet[2] == HCI_STATE_WORKING){
149 start_scan();
150 state = ACTIVE;
151 }
152 break;
153 default:
154 break;
149 }
150 break;
151
152 /* @text In ACTIVE, the following events are processed:
153 * - Inquiry result event: the list of discovered devices is processed and the
154 * Class of Device (CoD), page scan mode, clock offset, and RSSI are stored in a table.
155 * - Inquiry complete event: the remote name is requested for devices without a fetched
156 * name. The state of a remote name can be one of the following:

--- 93 unchanged lines hidden ---
155 }
156 break;
157
158 /* @text In ACTIVE, the following events are processed:
159 * - Inquiry result event: the list of discovered devices is processed and the
160 * Class of Device (CoD), page scan mode, clock offset, and RSSI are stored in a table.
161 * - Inquiry complete event: the remote name is requested for devices without a fetched
162 * name. The state of a remote name can be one of the following:

--- 93 unchanged lines hidden ---