att_db.c (15f22304d24c6f71475ad558b6ea23ee0db432b5) att_db.c (b58c6eb9050ca5824c198adc3fcd3384eba68af7)
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

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

1235 continue;
1236 }
1237 if (att_iterator_match_uuid16(&it, GATT_PRIMARY_SERVICE_UUID)
1238 || att_iterator_match_uuid16(&it, GATT_SECONDARY_SERVICE_UUID)
1239 || att_iterator_match_uuid16(&it, GATT_CHARACTERISTICS_UUID)){
1240 if (characteristic_found) break;
1241 continue;
1242 }
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

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

1235 continue;
1236 }
1237 if (att_iterator_match_uuid16(&it, GATT_PRIMARY_SERVICE_UUID)
1238 || att_iterator_match_uuid16(&it, GATT_SECONDARY_SERVICE_UUID)
1239 || att_iterator_match_uuid16(&it, GATT_CHARACTERISTICS_UUID)){
1240 if (characteristic_found) break;
1241 continue;
1242 }
1243 if (att_iterator_match_uuid16(&it, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION)){
1243 if (characteristic_found && att_iterator_match_uuid16(&it, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION)){
1244 return it.handle;
1245 }
1246 }
1247 return 0;
1248}
1249
1250// returns 1 if service found. only primary service.
1251int gatt_server_get_get_handle_range_for_service_with_uuid128(const uint8_t * uuid128, uint16_t * start_handle, uint16_t * end_handle){

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

1314 continue;
1315 }
1316 if (att_iterator_match_uuid16(&it, GATT_PRIMARY_SERVICE_UUID)
1317 || att_iterator_match_uuid16(&it, GATT_SECONDARY_SERVICE_UUID)
1318 || att_iterator_match_uuid16(&it, GATT_CHARACTERISTICS_UUID)){
1319 if (characteristic_found) break;
1320 continue;
1321 }
1244 return it.handle;
1245 }
1246 }
1247 return 0;
1248}
1249
1250// returns 1 if service found. only primary service.
1251int gatt_server_get_get_handle_range_for_service_with_uuid128(const uint8_t * uuid128, uint16_t * start_handle, uint16_t * end_handle){

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

1314 continue;
1315 }
1316 if (att_iterator_match_uuid16(&it, GATT_PRIMARY_SERVICE_UUID)
1317 || att_iterator_match_uuid16(&it, GATT_SECONDARY_SERVICE_UUID)
1318 || att_iterator_match_uuid16(&it, GATT_CHARACTERISTICS_UUID)){
1319 if (characteristic_found) break;
1320 continue;
1321 }
1322 if (att_iterator_match_uuid16(&it, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION)){
1322 if (characteristic_found && att_iterator_match_uuid16(&it, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION)){
1323 return it.handle;
1324 }
1325 }
1326 return 0;
1327}
1328
1329
1330// 1-item cache to optimize query during write_callback

--- 47 unchanged lines hidden ---
1323 return it.handle;
1324 }
1325 }
1326 return 0;
1327}
1328
1329
1330// 1-item cache to optimize query during write_callback

--- 47 unchanged lines hidden ---