diff options
author | Srinu Jella <sjella@codeaurora.org> | 2015-05-29 17:27:36 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:21:47 -0600 |
commit | 8884317d8e0eb1f9de1f69115aeff9b22c60ebe2 (patch) | |
tree | dbb03c7267ae0beebb39bbfebe94255dbcf396fc /include | |
parent | b30e712d81e0b4b655e3f51295e931ffaa1e17b7 (diff) | |
download | android_system_bt-8884317d8e0eb1f9de1f69115aeff9b22c60ebe2.tar.gz android_system_bt-8884317d8e0eb1f9de1f69115aeff9b22c60ebe2.tar.bz2 android_system_bt-8884317d8e0eb1f9de1f69115aeff9b22c60ebe2.zip |
Rfcomm test tool for rfcomm protocol certification.
- Interface provided from BT-If layer to interact
with rfcomm.
- This tool covers all rfcomm PTS test cases.
Conflicts:
btif/src/bluetooth.c
Change-Id: I129fbabdbdd80c87f0867c90e472e65bd1611af2
Diffstat (limited to 'include')
-rw-r--r-- | include/bt_target.h | 9 | ||||
-rw-r--r-- | include/bt_testapp.h | 127 |
2 files changed, 136 insertions, 0 deletions
diff --git a/include/bt_target.h b/include/bt_target.h index d9fca6ea8..a4cbc8218 100644 --- a/include/bt_target.h +++ b/include/bt_target.h @@ -209,6 +209,15 @@ //------------------End added from bdroid_buildcfg.h--------------------- +/****************************************************************************** +** +** Test Application interface +** +******************************************************************************/ + +#ifndef TEST_APP_INTERFACE +#define TEST_APP_INTERFACE TRUE +#endif /****************************************************************************** ** diff --git a/include/bt_testapp.h b/include/bt_testapp.h new file mode 100644 index 000000000..3dee39e59 --- /dev/null +++ b/include/bt_testapp.h @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of The Linux Foundation nor + * the names of its contributors may be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifdef TEST_APP_INTERFACE +#ifndef ANDROID_INCLUDE_BT_TESTAPP_H +#define ANDROID_INCLUDE_BT_TESTAPP_H +#include <stdio.h> +#include <dlfcn.h> +#include <stdlib.h> +#include <errno.h> +#include <string.h> +#include <pthread.h> +#include <unistd.h> +#include <ctype.h> +#include <fcntl.h> +#include <sys/prctl.h> +#include <linux/capability.h> +#include <arpa/inet.h> +#include <netinet/in.h> +#include <netdb.h> +#include <private/android_filesystem_config.h> +#include <android/log.h> +#include <hardware/bluetooth.h> +#include "l2c_api.h" +#include "sdp_api.h" +#include "gatt_api.h" +#include "gap_api.h" +#include "mca_api.h" +#include <hardware/hardware.h> +#include "btm_api.h" + +__BEGIN_DECLS + +typedef void (tREMOTE_DEVICE_NAME_CB) (void *p1); + +enum { + SUCCESS, + FAIL +}; + +typedef enum { + DUMMY, + ALL, + SPP, + FTP, + OPP, + MAP, + PBAP, + DUN, + NOT_SUPPORTED, +}profileName; +typedef enum { + TEST_APP_RFCOMM, +} test_app_profile; + +/** Bluetooth RFC tool commands */ +typedef enum { + RFC_TEST_CLIENT =1, + RFC_TEST_FRAME_ERROR, + RFC_TEST_ROLE_SWITCH, + RFC_TEST_SERVER, + RFC_TEST_DISCON, + RFC_TEST_CLIENT_TEST_MSC_DATA, //For PTS test case BV 21 and 22 + RFC_TEST_WRITE_DATA +}rfc_test_cmd_t; + + +typedef struct { + bt_bdaddr_t bdadd; + uint8_t scn; //Server Channel Number +}bt_rfc_conn_t; + +typedef struct { + bt_bdaddr_t bdadd; + uint8_t role; //0x01 for master +}bt_role_sw; + +typedef union { + bt_rfc_conn_t conn; + uint8_t server; + bt_role_sw role_switch; +}tRfcomm_test; + +typedef struct { + rfc_test_cmd_t param; + tRfcomm_test data; +}tRFC; + +typedef struct { + size_t size; + bt_status_t (*init)( tL2CAP_APPL_INFO* callbacks ); + void (*rdut_rfcomm)( UINT8 server ); + void (*rdut_rfcomm_test_interface)( tRFC *input); + bt_status_t (*connect)( bt_bdaddr_t *bd_addr ); + void (*cleanup)( void ); +} btrfcomm_interface_t; + +#endif + +__END_DECLS + +#endif /* ANDROID_INCLUDE_BT_TESTAPP_H */ |