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

Commit c3e93c66 authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Gerrit Code Review
Browse files

Merge changes I7379c003,Id2857d76

* changes:
  floss: GATT topshim populate callbacks
  floss: Add GATT topshim
parents c5a79ea2 dbbc8629
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -101,9 +101,11 @@ rust_bindgen {
        "--size_t-is-usize",
        "--allowlist-function=bt_.*",
        "--allowlist-function=bthh_.*",
        "--allowlist-function=btgatt_.*",
        "--allowlist-function=hal_util_.*",
        "--allowlist-type=bt_.*",
        "--allowlist-type=bthh_.*",
        "--allowlist-type=btgatt_.*",
        "--enable-cxx-namespaces",
        "--opaque-type=std::.*",
        "--with-derive-default",
+1 −0
Original line number Diff line number Diff line
@@ -7,4 +7,5 @@
// Profiles

// Hid host profile
#include "hardware/bt_gatt.h"
#include "hardware/bt_hh.h"
+3 −2
Original line number Diff line number Diff line
@@ -34,8 +34,9 @@ fn main() {
        .clang_args(libchrome_paths)
        .clang_args(clang_args)
        .enable_cxx_namespaces()
        .whitelist_type("(bt_|bthh_).*")
        .whitelist_function("(bt_|bthh_).*")
        .size_t_is_usize(true)
        .whitelist_type("(bt_|bthh_|btgatt_).*")
        .whitelist_function("(bt_|bthh_|btgatt_).*")
        .whitelist_function("hal_util_.*")
        // We must opaque out std:: in order to prevent bindgen from choking
        .opaque_type("std::.*")
+10 −3
Original line number Diff line number Diff line
@@ -239,17 +239,24 @@ pub type BtHciErrorCode = u8;

pub type BtPinCode = bindings::bt_pin_code_t;

pub type Uuid = bindings::bluetooth::Uuid;

pub enum SupportedProfiles {
    HidHost,
    A2dp,
    Gatt,
}

impl From<SupportedProfiles> for Vec<u8> {
    fn from(item: SupportedProfiles) -> Self {
        match item {
            SupportedProfiles::HidHost => "hidhost".bytes().collect::<Vec<u8>>(),
            SupportedProfiles::A2dp => "a2dp".bytes().collect::<Vec<u8>>(),
            SupportedProfiles::HidHost => "hidhost",
            SupportedProfiles::A2dp => "a2dp",
            SupportedProfiles::Gatt => "gatt",
        }
        .bytes()
        .chain("\0".bytes())
        .collect::<Vec<u8>>()
    }
}

@@ -268,7 +275,7 @@ mod ffi {
}

// Export the raw address type directly from the bindings
type FfiAddress = bindings::RawAddress;
pub type FfiAddress = bindings::RawAddress;

/// A shared address structure that has the same representation as
/// bindings::RawAddress. Macros `deref_ffi_address` and `cast_to_ffi_address`
+792 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading