         XCTAssertEqual(clientSocket.cache, mockData.client)
         */
     }
-    /*
-    func testCharacteristicValue() {
-        
-        // setup sockets
-        let serverSocket = TestL2CAPSocket(name: "Server")
-        let clientSocket = TestL2CAPSocket(name: "Client")
-        clientSocket.target = serverSocket
-        serverSocket.target = clientSocket
-        
-        // host controller
-        let serverHostController = PeripheralHostController(address: .max)
-        let clientHostController = CentralHostController(address: .min)
-        
-        // peripheral
-        typealias TestPeripheral = GATTPeripheral<PeripheralHostController, TestL2CAPSocket>
-        let options = GATTPeripheralOptions(maximumTransmissionUnit: .default, maximumPreparedWrites: .max)
-        let peripheral = TestPeripheral(controller: serverHostController, options: options)
-        peripheral.log = { print("Peripheral:", $0) }
-        
-        var incomingConnections = [(serverSocket, Central(identifier: serverSocket.address))]
-        
-        peripheral.newConnection = {
-            
-            repeat {
-                if let newConnecion = incomingConnections.popFirst() {
-                    return newConnecion
-                } else {
-                    sleep(1)
-                }
-            } while true
-        }
+    
+    func testCharacteristicValue() async throws {
         
         // service
         let batteryLevel = GATTBatteryLevel(level: .max)
         
         let characteristics = [
-            GATTAttribute.Characteristic(uuid: type(of: batteryLevel).uuid,
-                                value: batteryLevel.data,
-                                permissions: [.read, .write],
-                                properties: [.read, .write],
-                                descriptors: [])
+            GATTAttribute.Characteristic(
+                uuid: type(of: batteryLevel).uuid,
+                value: batteryLevel.data,
+                permissions: [.read, .write],
+                properties: [.read, .write],
+                descriptors: []
+            )
         ]
         
         let service = GATTAttribute.Service(

                let services = try await central.discoverServices(for: peripheral)
                guard let foundService = services.first,
                    services.count == 1
                    else { return }
                XCTAssertEqual(foundService.uuid, .batteryService)
                XCTAssertEqual(foundService.isPrimary, true)
            }

            characteristics: characteristics
        )
        
        // write value
        let newValue = GATTBatteryLevel(level: .min)
        
        var serviceAttribute: UInt16!
        var characteristicValueHandle: UInt16!
        var peripheralDatabaseValue: (() async -> (Data))!
        
        try await connect(
            server: { peripheral in
                serviceAttribute = try await peripheral.add(service: service)
                XCTAssertEqual(serviceAttribute, 1)
                characteristicValueHandle = await peripheral.characteristics(for: .batteryLevel)[0]
                peripheralDatabaseValue = { await peripheral[characteristic: characteristicValueHandle] }
                let currentValue = await peripheralDatabaseValue()
                XCTAssertEqual(currentValue, characteristics[0].value)
                peripheral.willWrite = {
                    XCTAssertEqual($0.uuid, .batteryLevel)
                    XCTAssertEqual($0.value, batteryLevel.data)
                    XCTAssertEqual($0.newValue, newValue.data)
                    return nil
                }
                peripheral.didWrite = {
                    XCTAssertEqual($0.uuid, .batteryLevel)
                    XCTAssertEqual($0.value, newValue.data)
                }
            },
            client: { (central, peripheral) in
                let services = try await central.discoverServices(for: peripheral)
                guard let foundService = services.first,
                    services.count == 1
                    else { XCTFail(); return }
                XCTAssertEqual(foundService.uuid, .batteryService)
                XCTAssertEqual(foundService.isPrimary, true)
                let foundCharacteristics = try await central.discoverCharacteristics(for: foundService)
                guard let foundCharacteristic = foundCharacteristics.first,
                    foundCharacteristics.count == 1
                    else { XCTFail(); return }
                XCTAssertEqual(foundCharacteristic.uuid, .batteryLevel)
                XCTAssertEqual(foundCharacteristic.properties, [.read, .write])
                // read value
                let characteristicData = try await central.readValue(for: foundCharacteristic)
                guard let characteristicValue = GATTBatteryLevel(data: characteristicData)
                    else { XCTFail(); return }
                XCTAssertEqual(characteristicValue, batteryLevel)
                // write value
                try await central.writeValue(newValue.data, for: foundCharacteristic, withResponse: true)
                // validate
                let currentValue = await peripheralDatabaseValue()
                XCTAssertEqual(currentValue, newValue.data)
                XCTAssertNotEqual(currentValue, characteristics[0].value)
                XCTAssertNotEqual(currentValue, characteristicValue.data)
            }
        )
    }
    
    func testNotification() {
        
        // FIXME: Fix mock notifications
