att_db.c (eeeae29572c0a80881040fd86b562c1534c37727) att_db.c (fd1be25d180b83fa8818fbefe35e2873a2c6906e)
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

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

195 if (bytes_to_copy > buffer_size){
196 bytes_to_copy = buffer_size;
197 }
198 memcpy(buffer, it->value, bytes_to_copy);
199 return bytes_to_copy;
200}
201
202void att_set_db(uint8_t const * db){
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

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

195 if (bytes_to_copy > buffer_size){
196 bytes_to_copy = buffer_size;
197 }
198 memcpy(buffer, it->value, bytes_to_copy);
199 return bytes_to_copy;
200}
201
202void att_set_db(uint8_t const * db){
203 // validate db version
204 if (db == NULL) return;
205 if (*db++ != ATT_DB_VERSION){
206 log_error("ATT DB version differs, please regenerate .h from .gatt file or update att_db_util.c");
207 return;
208 }
203 att_db = db;
204}
205
206void att_set_read_callback(att_read_callback_t callback){
207 att_read_callback = callback;
208}
209
210void att_set_write_callback(att_write_callback_t callback){

--- 1081 unchanged lines hidden ---
209 att_db = db;
210}
211
212void att_set_read_callback(att_read_callback_t callback){
213 att_read_callback = callback;
214}
215
216void att_set_write_callback(att_write_callback_t callback){

--- 1081 unchanged lines hidden ---