func (c *conn) Close() error {
	h := c.hci
	hh := c.attr
	h.connsmu.Lock()
	defer h.connsmu.Unlock()
	_, found := h.conns[hh]
	if !found {
		// log.Printf("l2conn: 0x%04x already disconnected", hh)
		return nil
	}
	if err, _ := h.c.Send(cmd.Disconnect{ConnectionHandle: hh, Reason: 0x13}); err != nil {
		return fmt.Errorf("l2conn: failed to disconnect, %s", err)
	}
	return nil
}
// Close disconnects the connection by sending HCI disconnect command to the device.
Close disconnects the connection by sending HCI disconnect command to the device.
// Close disconnects the connection by sending HCI disconnect command to the device .
func (c *conn) Close() error {
	h := c.hci
	hh := c.attr
	h.connsmu.Lock()
	defer h.connsmu.Unlock()
	_, found := h.conns[hh]
	if !found {
		return nil
	}
	if err, _ := h.c.Send(cmd.Disconnect{ConnectionHandle: hh, Reason: 0x13}); err != nil {
		return fmt.Errorf("l2conn: failed to disconnect, %s", err)
	}
	return nil
}
func ( c * conn ) Close ( ) error { h := c . hci hh := c . attr h . connsmu . Lock ( ) defer h . connsmu . Unlock ( ) _ , found := h . conns [ hh ] if ! found { return nil } if err , _ := h . c . Send ( cmd . Disconnect { ConnectionHandle : hh , Reason : 0x13 } ) ; err != nil { return fmt . Errorf ( " " , err ) } return nil }
Close disconnects the connection by sending HCI disconnect command to the device.
Close disconnects the connection by sending HCI disconnect command to the device .
// log.Printf("l2conn: 0x%04x already disconnected", hh)