Add software
This commit is contained in:
3
Software/BTLE/host/btle-tools/52-hackrf.rules
Normal file
3
Software/BTLE/host/btle-tools/52-hackrf.rules
Normal file
@ -0,0 +1,3 @@
|
||||
ATTR{idVendor}=="1d50", ATTR{idProduct}=="604b", SYMLINK+="hackrf-jawbreaker-%k", MODE="660", GROUP="plugdev"
|
||||
ATTR{idVendor}=="1d50", ATTR{idProduct}=="6089", SYMLINK+="hackrf-one-%k", MODE="660", GROUP="plugdev"
|
||||
ATTR{idVendor}=="1fc9", ATTR{idProduct}=="000c", SYMLINK+="nxp-dfu-%k", MODE="660", GROUP="plugdev"
|
89
Software/BTLE/host/btle-tools/CMakeLists.txt
Normal file
89
Software/BTLE/host/btle-tools/CMakeLists.txt
Normal file
@ -0,0 +1,89 @@
|
||||
# Copyright 2012 Jared Boone
|
||||
# Copyright 2013 Benjamin Vernoux
|
||||
#
|
||||
# This file is part of HackRF and bladeRF
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
# Based heavily upon the libftdi cmake setup.
|
||||
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project(btle-tools C)
|
||||
set(MAJOR_VERSION 0)
|
||||
set(MINOR_VERSION 5)
|
||||
set(PACKAGE btle-tools)
|
||||
set(VERSION_STRING ${MAJOR_VERSION}.${MINOR_VERSION})
|
||||
set(VERSION ${VERSION_STRING})
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake/modules)
|
||||
|
||||
if(MSVC)
|
||||
# include_directories(getopt)
|
||||
add_definitions(/D _CRT_SECURE_NO_WARNINGS)
|
||||
else()
|
||||
add_definitions(-Wall)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu90")
|
||||
endif()
|
||||
|
||||
# Find needed packages.
|
||||
IF (USE_BLADERF MATCHES 1)
|
||||
MESSAGE(STATUS "Use BLADERF")
|
||||
find_package(LIBBLADERF REQUIRED)
|
||||
include_directories(${LIBBLADERF_INCLUDE_DIR})
|
||||
set(USE_RFBOARD "USE_BLADERF")
|
||||
ELSE (USE_BLADERF MATCHES 1)
|
||||
MESSAGE(STATUS "Use HACKRF")
|
||||
find_package(LIBHACKRF REQUIRED)
|
||||
include_directories(${LIBHACKRF_INCLUDE_DIR})
|
||||
set(USE_RFBOARD "USE_HACKRF")
|
||||
ENDIF (USE_BLADERF MATCHES 1)
|
||||
|
||||
CONFIGURE_FILE (
|
||||
"${PROJECT_SOURCE_DIR}/include/common.h.in"
|
||||
"${PROJECT_SOURCE_DIR}/src/common.h"
|
||||
)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
########################################################################
|
||||
# Create uninstall target
|
||||
########################################################################
|
||||
|
||||
if(NOT btle_all_SOURCE_DIR)
|
||||
configure_file(
|
||||
${PROJECT_SOURCE_DIR}/../cmake/cmake_uninstall.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
||||
@ONLY)
|
||||
|
||||
|
||||
add_custom_target(uninstall
|
||||
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
||||
)
|
||||
endif()
|
||||
|
||||
########################################################################
|
||||
# Install udev rules
|
||||
########################################################################
|
||||
option(INSTALL_UDEV_RULES "Install udev rules for HackRF" OFF)
|
||||
if (INSTALL_UDEV_RULES)
|
||||
install (
|
||||
FILES 52-hackrf.rules
|
||||
DESTINATION "/etc/udev/rules.d"
|
||||
COMPONENT "udev"
|
||||
)
|
||||
else (INSTALL_UDEV_RULES)
|
||||
message (STATUS "Udev rules not being installed, install them with -DINSTALL_UDEV_RULES=ON")
|
||||
endif (INSTALL_UDEV_RULES)
|
7
Software/BTLE/host/btle-tools/include/common.h.in
Normal file
7
Software/BTLE/host/btle-tools/include/common.h.in
Normal file
@ -0,0 +1,7 @@
|
||||
#ifndef HAVE_COMMON_H
|
||||
#define HAVE_COMMON_H
|
||||
|
||||
#define @USE_RFBOARD@
|
||||
|
||||
#endif
|
||||
|
63
Software/BTLE/host/btle-tools/src/CMakeLists.txt
Normal file
63
Software/BTLE/host/btle-tools/src/CMakeLists.txt
Normal file
@ -0,0 +1,63 @@
|
||||
# Copyright 2012 Jared Boone
|
||||
# Copyright 2013 Benjamin Vernoux
|
||||
#
|
||||
# This file is part of HackRF and BladeRF.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
#
|
||||
|
||||
# Based heavily upon the libftdi cmake setup.
|
||||
set(INSTALL_DEFAULT_BINDIR "bin" CACHE STRING "Appended to CMAKE_INSTALL_PREFIX")
|
||||
|
||||
if(MSVC)
|
||||
add_library(libgetopt_static STATIC
|
||||
../getopt/getopt.c
|
||||
)
|
||||
endif()
|
||||
|
||||
add_executable(btle_tx btle_tx.c)
|
||||
install(TARGETS btle_tx RUNTIME DESTINATION ${INSTALL_DEFAULT_BINDIR})
|
||||
|
||||
add_executable(btle_rx btle_rx.c)
|
||||
install(TARGETS btle_rx RUNTIME DESTINATION ${INSTALL_DEFAULT_BINDIR})
|
||||
|
||||
IF (USE_BLADERF MATCHES 1)
|
||||
include_directories(${LIBBLADERF_INCLUDE_DIR})
|
||||
LIST(APPEND TOOLS_LINK_LIBS ${LIBBLADERF_LIBRARIES})
|
||||
ELSE (USE_BLADERF MATCHES 1)
|
||||
include_directories(${LIBHACKRF_INCLUDE_DIR})
|
||||
LIST(APPEND TOOLS_LINK_LIBS ${LIBHACKRF_LIBRARIES})
|
||||
ENDIF (USE_BLADERF MATCHES 1)
|
||||
|
||||
IF(NOT DEFINED C_INLINE)
|
||||
ADD_DEFINITIONS("-Dinline=")
|
||||
ENDIF(NOT DEFINED C_INLINE)
|
||||
|
||||
if(MSVC)
|
||||
LIST(APPEND TOOLS_LINK_LIBS libgetopt_static)
|
||||
endif()
|
||||
|
||||
target_link_libraries(btle_tx ${TOOLS_LINK_LIBS} m)
|
||||
|
||||
IF (USE_BLADERF MATCHES 1)
|
||||
target_link_libraries(btle_rx ${TOOLS_LINK_LIBS} m -lpthread)
|
||||
ELSE (USE_BLADERF MATCHES 1)
|
||||
target_link_libraries(btle_rx ${TOOLS_LINK_LIBS} m)
|
||||
ENDIF (USE_BLADERF MATCHES 1)
|
||||
|
||||
# MESSAGE(STATUS "1")
|
||||
# MESSAGE(STATUS ${LIBBLADERF_LIBRARIES})
|
||||
# MESSAGE(STATUS "2")
|
2421
Software/BTLE/host/btle-tools/src/btle_rx.c
Normal file
2421
Software/BTLE/host/btle-tools/src/btle_rx.c
Normal file
File diff suppressed because it is too large
Load Diff
4256
Software/BTLE/host/btle-tools/src/btle_tx.c
Normal file
4256
Software/BTLE/host/btle-tools/src/btle_tx.c
Normal file
File diff suppressed because it is too large
Load Diff
96
Software/BTLE/host/btle-tools/src/gauss_cos_sin_table.h
Normal file
96
Software/BTLE/host/btle-tools/src/gauss_cos_sin_table.h
Normal file
@ -0,0 +1,96 @@
|
||||
// Lookup table to speedup the program
|
||||
// Xianjun Jiao (putaoshu@msn.com)
|
||||
|
||||
const int8_t gauss_coef_int8[16] = {
|
||||
0, 0, 0, 0, 2, 11, 32, 53, 60, 53, 32, 11, 2, 0, 0, 0, };
|
||||
|
||||
const int8_t cos_table_int8[1024] = {
|
||||
127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 126, 126, 126, 126, 126, 126, 126, 126, 126,
|
||||
126, 126, 125, 125, 125, 125, 125, 125, 125, 124, 124, 124, 124, 124, 124, 123, 123, 123, 123, 123, 122, 122, 122, 122,
|
||||
122, 121, 121, 121, 121, 120, 120, 120, 120, 119, 119, 119, 118, 118, 118, 118, 117, 117, 117, 116, 116, 116, 115, 115,
|
||||
115, 114, 114, 114, 113, 113, 113, 112, 112, 112, 111, 111, 111, 110, 110, 109, 109, 109, 108, 108, 107, 107, 106, 106,
|
||||
106, 105, 105, 104, 104, 103, 103, 102, 102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95,
|
||||
94, 94, 93, 93, 92, 91, 91, 90, 90, 89, 89, 88, 88, 87, 86, 86, 85, 85, 84, 84, 83, 82, 82, 81,
|
||||
81, 80, 79, 79, 78, 78, 77, 76, 76, 75, 74, 74, 73, 72, 72, 71, 71, 70, 69, 69, 68, 67, 67, 66,
|
||||
65, 65, 64, 63, 63, 62, 61, 61, 60, 59, 58, 58, 57, 56, 56, 55, 54, 54, 53, 52, 51, 51, 50, 49,
|
||||
49, 48, 47, 46, 46, 45, 44, 44, 43, 42, 41, 41, 40, 39, 38, 38, 37, 36, 35, 35, 34, 33, 32, 32,
|
||||
31, 30, 29, 29, 28, 27, 26, 26, 25, 24, 23, 22, 22, 21, 20, 19, 19, 18, 17, 16, 16, 15, 14, 13,
|
||||
12, 12, 11, 10, 9, 9, 8, 7, 6, 5, 5, 4, 3, 2, 2, 1, 0, -1, -2, -2, -3, -4, -5, -5,
|
||||
-6, -7, -8, -9, -9, -10, -11, -12, -12, -13, -14, -15, -16, -16, -17, -18, -19, -19, -20, -21, -22, -22, -23, -24,
|
||||
-25, -26, -26, -27, -28, -29, -29, -30, -31, -32, -32, -33, -34, -35, -35, -36, -37, -38, -38, -39, -40, -41, -41, -42,
|
||||
-43, -44, -44, -45, -46, -46, -47, -48, -49, -49, -50, -51, -51, -52, -53, -54, -54, -55, -56, -56, -57, -58, -58, -59,
|
||||
-60, -61, -61, -62, -63, -63, -64, -65, -65, -66, -67, -67, -68, -69, -69, -70, -71, -71, -72, -72, -73, -74, -74, -75,
|
||||
-76, -76, -77, -78, -78, -79, -79, -80, -81, -81, -82, -82, -83, -84, -84, -85, -85, -86, -86, -87, -88, -88, -89, -89,
|
||||
-90, -90, -91, -91, -92, -93, -93, -94, -94, -95, -95, -96, -96, -97, -97, -98, -98, -99, -99, -100, -100, -101, -101, -102,
|
||||
-102, -102, -103, -103, -104, -104, -105, -105, -106, -106, -106, -107, -107, -108, -108, -109, -109, -109, -110, -110, -111, -111, -111, -112,
|
||||
-112, -112, -113, -113, -113, -114, -114, -114, -115, -115, -115, -116, -116, -116, -117, -117, -117, -118, -118, -118, -118, -119, -119, -119,
|
||||
-120, -120, -120, -120, -121, -121, -121, -121, -122, -122, -122, -122, -122, -123, -123, -123, -123, -123, -124, -124, -124, -124, -124, -124,
|
||||
-125, -125, -125, -125, -125, -125, -125, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -127, -127, -127, -127, -127, -127,
|
||||
-127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -126,
|
||||
-126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -125, -125, -125, -125, -125, -125, -125, -124, -124, -124, -124, -124, -124, -123,
|
||||
-123, -123, -123, -123, -122, -122, -122, -122, -122, -121, -121, -121, -121, -120, -120, -120, -120, -119, -119, -119, -118, -118, -118, -118,
|
||||
-117, -117, -117, -116, -116, -116, -115, -115, -115, -114, -114, -114, -113, -113, -113, -112, -112, -112, -111, -111, -111, -110, -110, -109,
|
||||
-109, -109, -108, -108, -107, -107, -106, -106, -106, -105, -105, -104, -104, -103, -103, -102, -102, -102, -101, -101, -100, -100, -99, -99,
|
||||
-98, -98, -97, -97, -96, -96, -95, -95, -94, -94, -93, -93, -92, -91, -91, -90, -90, -89, -89, -88, -88, -87, -86, -86,
|
||||
-85, -85, -84, -84, -83, -82, -82, -81, -81, -80, -79, -79, -78, -78, -77, -76, -76, -75, -74, -74, -73, -72, -72, -71,
|
||||
-71, -70, -69, -69, -68, -67, -67, -66, -65, -65, -64, -63, -63, -62, -61, -61, -60, -59, -58, -58, -57, -56, -56, -55,
|
||||
-54, -54, -53, -52, -51, -51, -50, -49, -49, -48, -47, -46, -46, -45, -44, -44, -43, -42, -41, -41, -40, -39, -38, -38,
|
||||
-37, -36, -35, -35, -34, -33, -32, -32, -31, -30, -29, -29, -28, -27, -26, -26, -25, -24, -23, -22, -22, -21, -20, -19,
|
||||
-19, -18, -17, -16, -16, -15, -14, -13, -12, -12, -11, -10, -9, -9, -8, -7, -6, -5, -5, -4, -3, -2, -2, -1,
|
||||
0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18,
|
||||
19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
|
||||
37, 38, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 51, 52, 53, 54,
|
||||
54, 55, 56, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70,
|
||||
71, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85,
|
||||
85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98,
|
||||
98, 99, 99, 100, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109,
|
||||
109, 109, 110, 110, 111, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, 115, 115, 116, 116, 116, 117, 117,
|
||||
117, 118, 118, 118, 118, 119, 119, 119, 120, 120, 120, 120, 121, 121, 121, 121, 122, 122, 122, 122, 122, 123, 123, 123,
|
||||
123, 123, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126,
|
||||
126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, };
|
||||
|
||||
const int8_t sin_table_int8[1024] = {
|
||||
0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 16, 16, 17, 18,
|
||||
19, 19, 20, 21, 22, 22, 23, 24, 25, 26, 26, 27, 28, 29, 29, 30, 31, 32, 32, 33, 34, 35, 35, 36,
|
||||
37, 38, 38, 39, 40, 41, 41, 42, 43, 44, 44, 45, 46, 46, 47, 48, 49, 49, 50, 51, 51, 52, 53, 54,
|
||||
54, 55, 56, 56, 57, 58, 58, 59, 60, 61, 61, 62, 63, 63, 64, 65, 65, 66, 67, 67, 68, 69, 69, 70,
|
||||
71, 71, 72, 72, 73, 74, 74, 75, 76, 76, 77, 78, 78, 79, 79, 80, 81, 81, 82, 82, 83, 84, 84, 85,
|
||||
85, 86, 86, 87, 88, 88, 89, 89, 90, 90, 91, 91, 92, 93, 93, 94, 94, 95, 95, 96, 96, 97, 97, 98,
|
||||
98, 99, 99, 100, 100, 101, 101, 102, 102, 102, 103, 103, 104, 104, 105, 105, 106, 106, 106, 107, 107, 108, 108, 109,
|
||||
109, 109, 110, 110, 111, 111, 111, 112, 112, 112, 113, 113, 113, 114, 114, 114, 115, 115, 115, 116, 116, 116, 117, 117,
|
||||
117, 118, 118, 118, 118, 119, 119, 119, 120, 120, 120, 120, 121, 121, 121, 121, 122, 122, 122, 122, 122, 123, 123, 123,
|
||||
123, 123, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126,
|
||||
126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127,
|
||||
127, 127, 127, 127, 127, 127, 127, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 125, 125, 125, 125, 125, 125,
|
||||
125, 124, 124, 124, 124, 124, 124, 123, 123, 123, 123, 123, 122, 122, 122, 122, 122, 121, 121, 121, 121, 120, 120, 120,
|
||||
120, 119, 119, 119, 118, 118, 118, 118, 117, 117, 117, 116, 116, 116, 115, 115, 115, 114, 114, 114, 113, 113, 113, 112,
|
||||
112, 112, 111, 111, 111, 110, 110, 109, 109, 109, 108, 108, 107, 107, 106, 106, 106, 105, 105, 104, 104, 103, 103, 102,
|
||||
102, 102, 101, 101, 100, 100, 99, 99, 98, 98, 97, 97, 96, 96, 95, 95, 94, 94, 93, 93, 92, 91, 91, 90,
|
||||
90, 89, 89, 88, 88, 87, 86, 86, 85, 85, 84, 84, 83, 82, 82, 81, 81, 80, 79, 79, 78, 78, 77, 76,
|
||||
76, 75, 74, 74, 73, 72, 72, 71, 71, 70, 69, 69, 68, 67, 67, 66, 65, 65, 64, 63, 63, 62, 61, 61,
|
||||
60, 59, 58, 58, 57, 56, 56, 55, 54, 54, 53, 52, 51, 51, 50, 49, 49, 48, 47, 46, 46, 45, 44, 44,
|
||||
43, 42, 41, 41, 40, 39, 38, 38, 37, 36, 35, 35, 34, 33, 32, 32, 31, 30, 29, 29, 28, 27, 26, 26,
|
||||
25, 24, 23, 22, 22, 21, 20, 19, 19, 18, 17, 16, 16, 15, 14, 13, 12, 12, 11, 10, 9, 9, 8, 7,
|
||||
6, 5, 5, 4, 3, 2, 2, 1, 0, -1, -2, -2, -3, -4, -5, -5, -6, -7, -8, -9, -9, -10, -11, -12,
|
||||
-12, -13, -14, -15, -16, -16, -17, -18, -19, -19, -20, -21, -22, -22, -23, -24, -25, -26, -26, -27, -28, -29, -29, -30,
|
||||
-31, -32, -32, -33, -34, -35, -35, -36, -37, -38, -38, -39, -40, -41, -41, -42, -43, -44, -44, -45, -46, -46, -47, -48,
|
||||
-49, -49, -50, -51, -51, -52, -53, -54, -54, -55, -56, -56, -57, -58, -58, -59, -60, -61, -61, -62, -63, -63, -64, -65,
|
||||
-65, -66, -67, -67, -68, -69, -69, -70, -71, -71, -72, -72, -73, -74, -74, -75, -76, -76, -77, -78, -78, -79, -79, -80,
|
||||
-81, -81, -82, -82, -83, -84, -84, -85, -85, -86, -86, -87, -88, -88, -89, -89, -90, -90, -91, -91, -92, -93, -93, -94,
|
||||
-94, -95, -95, -96, -96, -97, -97, -98, -98, -99, -99, -100, -100, -101, -101, -102, -102, -102, -103, -103, -104, -104, -105, -105,
|
||||
-106, -106, -106, -107, -107, -108, -108, -109, -109, -109, -110, -110, -111, -111, -111, -112, -112, -112, -113, -113, -113, -114, -114, -114,
|
||||
-115, -115, -115, -116, -116, -116, -117, -117, -117, -118, -118, -118, -118, -119, -119, -119, -120, -120, -120, -120, -121, -121, -121, -121,
|
||||
-122, -122, -122, -122, -122, -123, -123, -123, -123, -123, -124, -124, -124, -124, -124, -124, -125, -125, -125, -125, -125, -125, -125, -126,
|
||||
-126, -126, -126, -126, -126, -126, -126, -126, -126, -126, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127,
|
||||
-127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -127, -126, -126, -126, -126, -126, -126, -126, -126, -126,
|
||||
-126, -126, -125, -125, -125, -125, -125, -125, -125, -124, -124, -124, -124, -124, -124, -123, -123, -123, -123, -123, -122, -122, -122, -122,
|
||||
-122, -121, -121, -121, -121, -120, -120, -120, -120, -119, -119, -119, -118, -118, -118, -118, -117, -117, -117, -116, -116, -116, -115, -115,
|
||||
-115, -114, -114, -114, -113, -113, -113, -112, -112, -112, -111, -111, -111, -110, -110, -109, -109, -109, -108, -108, -107, -107, -106, -106,
|
||||
-106, -105, -105, -104, -104, -103, -103, -102, -102, -102, -101, -101, -100, -100, -99, -99, -98, -98, -97, -97, -96, -96, -95, -95,
|
||||
-94, -94, -93, -93, -92, -91, -91, -90, -90, -89, -89, -88, -88, -87, -86, -86, -85, -85, -84, -84, -83, -82, -82, -81,
|
||||
-81, -80, -79, -79, -78, -78, -77, -76, -76, -75, -74, -74, -73, -72, -72, -71, -71, -70, -69, -69, -68, -67, -67, -66,
|
||||
-65, -65, -64, -63, -63, -62, -61, -61, -60, -59, -58, -58, -57, -56, -56, -55, -54, -54, -53, -52, -51, -51, -50, -49,
|
||||
-49, -48, -47, -46, -46, -45, -44, -44, -43, -42, -41, -41, -40, -39, -38, -38, -37, -36, -35, -35, -34, -33, -32, -32,
|
||||
-31, -30, -29, -29, -28, -27, -26, -26, -25, -24, -23, -22, -22, -21, -20, -19, -19, -18, -17, -16, -16, -15, -14, -13,
|
||||
-12, -12, -11, -10, -9, -9, -8, -7, -6, -5, -5, -4, -3, -2, -2, -1, };
|
||||
|
13
Software/BTLE/host/btle-tools/src/packets.txt
Normal file
13
Software/BTLE/host/btle-tools/src/packets.txt
Normal file
@ -0,0 +1,13 @@
|
||||
# Simulate BTLE Connection establishment according to BTLE/doc/TI-BLE-INTRODUCTION.pdf
|
||||
# Turn on your BLE sniffer dongle at channel 37 to see the procedure
|
||||
|
||||
37-ADV_IND-TxAdd-0-RxAdd-0-AdvA-90D7EBB19299-AdvData-0201050702031802180418-Space-1000
|
||||
|
||||
37-CONNECT_REQ-TxAdd-0-RxAdd-0-InitA-001830EA965F-AdvA-90D7EBB19299-AA-60850A1B-CRCInit-A77B22-WinSize-02-WinOffset-000F-Interval-0050-Latency-0000-Timeout-07D0-ChM-1FFFFFFFFF-Hop-9-SCA-5-Space-1000
|
||||
|
||||
9-LL_DATA-AA-60850A1B-LLID-1-NESN-0-SN-0-MD-0-DATA-X-CRCInit-A77B22-Space-1000
|
||||
|
||||
r1
|
||||
|
||||
|
||||
|
55
Software/BTLE/host/btle-tools/src/packets_discovery.txt
Normal file
55
Software/BTLE/host/btle-tools/src/packets_discovery.txt
Normal file
@ -0,0 +1,55 @@
|
||||
# example
|
||||
# ./btle_tx 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-CA-TXPOWER-03-SERVICE03-180D1810-SERVICE_DATA-180D40-MANUF_DATA-0001FF-CONN_INTERVAL-0006 (-SERVICE_SOLI14-1811)
|
||||
# FLAGS: 0x01 LE Limited Discoverable Mode; 0x02 LE General Discoverable Mode
|
||||
# SERVICE:
|
||||
# 0x02 16-bit Service UUIDs More 16-bit UUIDs available
|
||||
# 0x03 16-bit Service UUIDs Complete list of 16-bit UUIDs available
|
||||
# 0x04 32-bit Service UUIDs More 32-bit UUIDs available
|
||||
# 0x05 32-bit Service UUIDs Complete list of 32-bit UUIDs available
|
||||
# 0x06 128-bit Service UUIDs More 128-bit UUIDs available
|
||||
# 0x07 128-bit Service UUIDs Complete list of 128-bit UUIDs available
|
||||
|
||||
# 37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-Jxj-TXPOWER-03-SERVICE03-180D1810-SERVICE_DATA-180D40-MANUF_DATA-004CFF-CONN_INTERVAL-0006
|
||||
|
||||
# r30
|
||||
|
||||
37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-SDR Bluetooth Low Energy
|
||||
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040500-LOCAL_NAME09-CA0000 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040501-LOCAL_NAME09-CA0001 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040502-LOCAL_NAME09-CA0002 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040503-LOCAL_NAME09-CA0003 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040504-LOCAL_NAME09-CA0004 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040505-LOCAL_NAME09-CA0005 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-CA0006 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040507-LOCAL_NAME09-CA0007 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040508-LOCAL_NAME09-CA0008 11950 22.626 113.823 1
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040509-LOCAL_NAME09-CA0009 11950 22.626 113.823 1
|
||||
|
||||
r4000
|
||||
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-LOCAL_NAME09-01234567890123456789012345678
|
||||
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-LOCAL_NAME09-01234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-110203040506-FLAGS-02-LOCAL_NAME09-11234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-210203040506-FLAGS-02-LOCAL_NAME09-21234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-310203040506-FLAGS-02-LOCAL_NAME09-31234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-LOCAL_NAME09-41234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-510203040506-FLAGS-02-LOCAL_NAME09-51234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-610203040506-FLAGS-02-LOCAL_NAME09-61234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-710203040506-FLAGS-02-LOCAL_NAME09-71234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-810203040506-FLAGS-02-LOCAL_NAME09-81234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-910203040506-FLAGS-02-LOCAL_NAME09-91234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-a10203040506-FLAGS-02-LOCAL_NAME09-a1234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-b10203040506-FLAGS-02-LOCAL_NAME09-b1234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-c10203040506-FLAGS-02-LOCAL_NAME09-c1234567890123456789012345
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-d10203040506-FLAGS-02-LOCAL_NAME09-d1234567890123456789012345
|
||||
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-010203040506-FLAGS-02-SERVICE03-180D-SERVICE_DATA-180D40-SPACE-500
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-110203040506-FLAGS-02-SERVICE03-1819-SERVICE_DATA-181940-SPACE-100
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-210203040506-FLAGS-02-SERVICE03-181c-SERVICE_DATA-181c40-SPACE-500
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-310203040506-FLAGS-02-SERVICE03-180a-SERVICE_DATA-180a40-SPACE-500
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-SERVICE03-1800-SERVICE_DATA-180040-SPACE-500
|
||||
#37-DISCOVERY-TxAdd-1-RxAdd-0-AdvA-410203040506-FLAGS-02-SERVICE03-1801-SERVICE_DATA-180140-SPACE-500
|
||||
# r30
|
||||
|
5
Software/BTLE/host/btle-tools/src/packets_ibeacon.txt
Normal file
5
Software/BTLE/host/btle-tools/src/packets_ibeacon.txt
Normal file
@ -0,0 +1,5 @@
|
||||
37-iBeacon-AdvA-010203040506-UUID-B9407F30F5F8466EAFF925556B57FE6D-Major-0008-Minor-0009-TxPower-C5-Space-100
|
||||
|
||||
r10
|
||||
|
||||
|
46
Software/BTLE/host/btle-tools/src/scramble_table.h
Normal file
46
Software/BTLE/host/btle-tools/src/scramble_table.h
Normal file
@ -0,0 +1,46 @@
|
||||
// Scramble table definition
|
||||
// Xianjun Jiao (putaoshu@msn.com)
|
||||
|
||||
const uint8_t scramble_table[40][42] = {
|
||||
{64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, },
|
||||
{137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, },
|
||||
{210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, },
|
||||
{27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, },
|
||||
{100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, },
|
||||
{173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, },
|
||||
{246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, },
|
||||
{63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, },
|
||||
{8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, },
|
||||
{193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, },
|
||||
{154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, },
|
||||
{83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, },
|
||||
{44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, },
|
||||
{229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, },
|
||||
{190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, },
|
||||
{119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, },
|
||||
{208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, },
|
||||
{25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, },
|
||||
{66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, },
|
||||
{139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, },
|
||||
{244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, },
|
||||
{61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, },
|
||||
{102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, },
|
||||
{175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, },
|
||||
{152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, },
|
||||
{81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, },
|
||||
{10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, },
|
||||
{195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, },
|
||||
{188, 195, 31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, },
|
||||
{117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, },
|
||||
{46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, },
|
||||
{231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, },
|
||||
{96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, },
|
||||
{169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, },
|
||||
{242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, 91, 23, 19, 129, 100, 121, 135, 63, 110, 148, 190, 10, 237, 57, 53, 131, 173, 139, 137, 64, 178, 188, 195, 31, 55, 74, 95, 133, 246, 156, 154, },
|
||||
{59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, 4, 146, 229, 29, 254, 184, 81, 250, 42, 180, 231, 212, 12, 182, 46, 38, 2, 201, 242, 14, 127, 220, 40, 125, 21, 218, 115, 106, 6, },
|
||||
{68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, },
|
||||
{141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216, 186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, },
|
||||
{214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, },
|
||||
{31, 55, 74, 95, 133, 246, 156, 154, 193, 214, 197, 68, 32, 89, 222, 225, 143, 27, 165, 175, 66, 123, 78, 205, 96, 235, 98, 34, 144, 44, 239, 240, 199, 141, 210, 87, 161, 61, 167, 102, 176, 117, },
|
||||
};
|
||||
|
7
Software/BTLE/host/btle-tools/src/scramble_table_ch37.h
Normal file
7
Software/BTLE/host/btle-tools/src/scramble_table_ch37.h
Normal file
@ -0,0 +1,7 @@
|
||||
// Scramble table definition for channel 37
|
||||
// Xianjun Jiao (putaoshu@msn.com)
|
||||
|
||||
const uint8_t scramble_table_ch37[42] = {
|
||||
141, 210, 87, 161, 61, 167, 102, 176, 117, 49, 17, 72, 150, 119, 248, 227, 70, 233, 171, 208, 158, 83, 51, 216,
|
||||
186, 152, 8, 36, 203, 59, 252, 113, 163, 244, 85, 104, 207, 169, 25, 108, 93, 76, };
|
||||
|
Reference in New Issue
Block a user