att_db.c (41f9be703fb87edde73fe6f52b0e680ec8aaf227) att_db.c (c436b760549c6da73e320c4d93ff3b76282abccb)
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

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

1239 default:
1240 response_len = setup_error(response_buffer, request_opcode, 0, ATT_ERROR_REQUEST_NOT_SUPPORTED);
1241 break;
1242 }
1243 return response_len;
1244}
1245
1246// returns 1 if service found. only primary service.
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

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

1239 default:
1240 response_len = setup_error(response_buffer, request_opcode, 0, ATT_ERROR_REQUEST_NOT_SUPPORTED);
1241 break;
1242 }
1243 return response_len;
1244}
1245
1246// returns 1 if service found. only primary service.
1247bool gatt_server_get_get_handle_range_for_service_with_uuid16(uint16_t uuid16, uint16_t * start_handle, uint16_t * end_handle){
1247bool gatt_server_get_handle_range_for_service_with_uuid16(uint16_t uuid16, uint16_t * start_handle, uint16_t * end_handle){
1248 uint16_t in_group = 0;
1249 uint16_t prev_handle = 0;
1250
1251 uint8_t attribute_value[2];
1252 int attribute_len = sizeof(attribute_value);
1253 little_endian_store_16(attribute_value, 0, uuid16);
1254
1255 att_iterator_t it;

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

1323}
1324// returns 0 if not found
1325
1326uint16_t gatt_server_get_server_configuration_handle_for_characteristic_with_uuid16(uint16_t start_handle, uint16_t end_handle, uint16_t characteristic_uuid16){
1327 return gatt_server_get_descriptor_handle_for_characteristic_with_uuid16(start_handle, end_handle, characteristic_uuid16, GATT_SERVER_CHARACTERISTICS_CONFIGURATION);
1328}
1329
1330// returns 1 if service found. only primary service.
1248 uint16_t in_group = 0;
1249 uint16_t prev_handle = 0;
1250
1251 uint8_t attribute_value[2];
1252 int attribute_len = sizeof(attribute_value);
1253 little_endian_store_16(attribute_value, 0, uuid16);
1254
1255 att_iterator_t it;

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

1323}
1324// returns 0 if not found
1325
1326uint16_t gatt_server_get_server_configuration_handle_for_characteristic_with_uuid16(uint16_t start_handle, uint16_t end_handle, uint16_t characteristic_uuid16){
1327 return gatt_server_get_descriptor_handle_for_characteristic_with_uuid16(start_handle, end_handle, characteristic_uuid16, GATT_SERVER_CHARACTERISTICS_CONFIGURATION);
1328}
1329
1330// returns 1 if service found. only primary service.
1331int gatt_server_get_get_handle_range_for_service_with_uuid128(const uint8_t * uuid128, uint16_t * start_handle, uint16_t * end_handle){
1331int gatt_server_get_handle_range_for_service_with_uuid128(const uint8_t * uuid128, uint16_t * start_handle, uint16_t * end_handle){
1332 uint16_t in_group = 0;
1333 uint16_t prev_handle = 0;
1334
1335 uint8_t attribute_value[16];
1336 int attribute_len = sizeof(attribute_value);
1337 reverse_128(uuid128, attribute_value);
1338
1339 att_iterator_t it;

--- 260 unchanged lines hidden ---
1332 uint16_t in_group = 0;
1333 uint16_t prev_handle = 0;
1334
1335 uint8_t attribute_value[16];
1336 int attribute_len = sizeof(attribute_value);
1337 reverse_128(uuid128, attribute_value);
1338
1339 att_iterator_t it;

--- 260 unchanged lines hidden ---