Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cd47c70 authored by Chris Manton's avatar Chris Manton
Browse files

legacy: Introduce stack/include/bt_name

Bug: 193830619
Test: gd/cert/run
Tag: #refactor

Change-Id: If28724e0ac45094e40741c6f1a444dfe7050bad6
parent be865572
Loading
Loading
Loading
Loading
+40 −0
Original line number Diff line number Diff line
/*
 * Copyright 2021 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#pragma once

#ifdef __cplusplus
#include <cstdint>
#else
#include <stdint.h>
#endif

// NOTE: Shared with internal_include/bt_target.h
/* Maximum device name length used in btm database. */
#ifndef BTM_MAX_REM_BD_NAME_LEN
#define BTM_MAX_REM_BD_NAME_LEN 248
#endif

/* Maximum local device name length stored btm database */
#ifndef BTM_MAX_LOC_BD_NAME_LEN
#define BTM_MAX_LOC_BD_NAME_LEN 248
#endif

#define BD_NAME_LEN 248
typedef uint8_t BD_NAME[BD_NAME_LEN + 1]; /* Device name */

/* Device name of peer (may be truncated to save space in BTM database) */
typedef uint8_t tBTM_BD_NAME[BTM_MAX_REM_BD_NAME_LEN + 1];
+1 −3
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include "stack/include/bt_dev_class.h"
#include "stack/include/bt_device_type.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_name.h"
#include "stack/include/bt_octets.h"
#ifdef __cplusplus
#include "include/hardware/bluetooth.h"
@@ -333,9 +334,6 @@ enum {
#define PIN_CODE_LEN 16
typedef uint8_t PIN_CODE[PIN_CODE_LEN]; /* Pin Code (upto 128 bits) MSB is 0 */

#define BD_NAME_LEN 248
typedef uint8_t BD_NAME[BD_NAME_LEN + 1]; /* Device name */

#define LAP_LEN 3
typedef uint8_t LAP[LAP_LEN];     /* IAC as passed to Inquiry (LAP) */

+2 −3
Original line number Diff line number Diff line
@@ -20,11 +20,13 @@
#define BTM_API_TYPES_H

#include <base/strings/stringprintf.h>

#include <cstdint>
#include <string>

#include "device/include/esco_parameters.h"
#include "internal_include/bt_target.h"
#include "stack/include/bt_name.h"
#include "stack/include/btm_status.h"
#include "stack/include/hci_mode.h"
#include "stack/include/hcidefs.h"
@@ -32,9 +34,6 @@
#include "types/ble_address_with_type.h"
#include "types/bt_transport.h"

/* Device name of peer (may be truncated to save space in BTM database) */
typedef uint8_t tBTM_BD_NAME[BTM_MAX_REM_BD_NAME_LEN + 1];

/* Structure returned with Vendor Specific Command complete callback */
typedef struct {
  uint16_t opcode;