@@ -9,7 +9,7 @@ use bt_hci::uuid::declarations::{CHARACTERISTIC, PRIMARY_SERVICE};
99use bt_hci:: uuid:: descriptors:: CLIENT_CHARACTERISTIC_CONFIGURATION ;
1010use embassy_futures:: select:: { select, Either } ;
1111use embassy_sync:: blocking_mutex:: raw:: { NoopRawMutex , RawMutex } ;
12- use embassy_sync:: channel:: { Channel , DynamicReceiver } ;
12+ use embassy_sync:: channel:: Channel ;
1313use embassy_sync:: pubsub:: { self , PubSubChannel , WaitResult } ;
1414use embassy_time:: Duration ;
1515use heapless:: Vec ;
@@ -650,7 +650,6 @@ const NOTIF_QSIZE: usize = config::GATT_CLIENT_NOTIFICATION_QUEUE_SIZE;
650650/// A GATT client capable of using the GATT protocol.
651651pub struct GattClient < ' reference , T : Controller , P : PacketPool , const MAX_SERVICES : usize > {
652652 known_services : RefCell < Vec < ServiceHandle , MAX_SERVICES > > ,
653- rx : DynamicReceiver < ' reference , ( ConnHandle , Pdu < P :: Packet > ) > ,
654653 stack : & ' reference Stack < ' reference , T , P > ,
655654 connection : Connection < ' reference , P > ,
656655 response_channel : Channel < NoopRawMutex , ( ConnHandle , Pdu < P :: Packet > ) , 1 > ,
@@ -754,7 +753,6 @@ impl<'reference, C: Controller, P: PacketPool, const MAX_SERVICES: usize> GattCl
754753 connection. send ( Pdu :: new ( buf, len) ) . await ;
755754 Ok ( Self {
756755 known_services : RefCell :: new ( heapless:: Vec :: new ( ) ) ,
757- rx : stack. host . att_client . receiver ( ) . into ( ) ,
758756 stack,
759757 connection : connection. clone ( ) ,
760758
@@ -1173,7 +1171,8 @@ impl<'reference, C: Controller, P: PacketPool, const MAX_SERVICES: usize> GattCl
11731171 /// Task which handles GATT rx data (needed for notifications to work)
11741172 pub async fn task ( & self ) -> Result < ( ) , BleHostError < C :: Error > > {
11751173 loop {
1176- let ( handle, pdu) = self . rx . receive ( ) . await ;
1174+ let handle = self . connection . handle ( ) ;
1175+ let pdu = self . connection . next_gatt_client ( ) . await ;
11771176 let data = pdu. as_ref ( ) ;
11781177 // handle notifications
11791178 if pdu. as_ref ( ) [ 0 ] == ATT_HANDLE_VALUE_NTF {
0 commit comments