Loading system/bta/sys/bta_sys_main.c +1 −1 Original line number Diff line number Diff line Loading @@ -34,9 +34,9 @@ #include "fixed_queue.h" #include "gki.h" #include "hash_functions.h" #include "hash_map.h" #include "osi.h" #include "osi/include/hash_functions.h" #include "osi/include/log.h" #include "thread.h" #if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE) Loading system/btcore/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/.. LOCAL_SRC_FILES := \ ./test/bdaddr_test.cpp \ ./test/counter_test.cpp \ ../osi/test/AllocationTestHarness.cpp Loading system/btcore/include/bdaddr.h +5 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ #include <stdbool.h> #include <stddef.h> #include "osi/include/hash_map.h" // Note: the string representation of a bdaddr is expected to have the format // xx:xx:xx:xx:xx:xx // where each 'x' is a hex digit. The API presented in this header will accept Loading Loading @@ -49,3 +51,6 @@ bool string_is_bdaddr(const char *string); // represent a Bluetooth address, |addr| is not modified and this function returns // false. Otherwise, it returns true. Neither |string| nor |addr| may be NULL. bool string_to_bdaddr(const char *string, bt_bdaddr_t *addr); // A hash function tailored for bdaddrs. hash_index_t hash_function_bdaddr(const void *key); system/btcore/src/bdaddr.c +8 −0 Original line number Diff line number Diff line Loading @@ -84,3 +84,11 @@ bool string_to_bdaddr(const char *string, bt_bdaddr_t *addr) { return ret; } hash_index_t hash_function_bdaddr(const void *key) { hash_index_t hash = 5381; const char *bytes = (const char *)key; for (size_t i = 0; i < sizeof(bt_bdaddr_t); ++i) hash = ((hash << 5) + hash) + bytes[i]; return hash; } system/btcore/src/counter.c +1 −1 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ #include "allocator.h" #include "atomic.h" #include "counter.h" #include "hash_functions.h" #include "hash_map.h" #include "list.h" #include "module.h" #include "osi.h" #include "osi/include/hash_functions.h" #include "osi/include/log.h" #include "socket.h" #include "thread.h" Loading Loading
system/bta/sys/bta_sys_main.c +1 −1 Original line number Diff line number Diff line Loading @@ -34,9 +34,9 @@ #include "fixed_queue.h" #include "gki.h" #include "hash_functions.h" #include "hash_map.h" #include "osi.h" #include "osi/include/hash_functions.h" #include "osi/include/log.h" #include "thread.h" #if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE) Loading
system/btcore/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,7 @@ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/.. LOCAL_SRC_FILES := \ ./test/bdaddr_test.cpp \ ./test/counter_test.cpp \ ../osi/test/AllocationTestHarness.cpp Loading
system/btcore/include/bdaddr.h +5 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,8 @@ #include <stdbool.h> #include <stddef.h> #include "osi/include/hash_map.h" // Note: the string representation of a bdaddr is expected to have the format // xx:xx:xx:xx:xx:xx // where each 'x' is a hex digit. The API presented in this header will accept Loading Loading @@ -49,3 +51,6 @@ bool string_is_bdaddr(const char *string); // represent a Bluetooth address, |addr| is not modified and this function returns // false. Otherwise, it returns true. Neither |string| nor |addr| may be NULL. bool string_to_bdaddr(const char *string, bt_bdaddr_t *addr); // A hash function tailored for bdaddrs. hash_index_t hash_function_bdaddr(const void *key);
system/btcore/src/bdaddr.c +8 −0 Original line number Diff line number Diff line Loading @@ -84,3 +84,11 @@ bool string_to_bdaddr(const char *string, bt_bdaddr_t *addr) { return ret; } hash_index_t hash_function_bdaddr(const void *key) { hash_index_t hash = 5381; const char *bytes = (const char *)key; for (size_t i = 0; i < sizeof(bt_bdaddr_t); ++i) hash = ((hash << 5) + hash) + bytes[i]; return hash; }
system/btcore/src/counter.c +1 −1 Original line number Diff line number Diff line Loading @@ -27,11 +27,11 @@ #include "allocator.h" #include "atomic.h" #include "counter.h" #include "hash_functions.h" #include "hash_map.h" #include "list.h" #include "module.h" #include "osi.h" #include "osi/include/hash_functions.h" #include "osi/include/log.h" #include "socket.h" #include "thread.h" Loading