//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// Represents a remote central.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/corebluetooth/cbcentral?language=objc)
    #[unsafe(super(CBPeer, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "CBPeer")]
    pub struct CBCentral;
);

#[cfg(feature = "CBPeer")]
unsafe impl NSCopying for CBCentral {}

#[cfg(feature = "CBPeer")]
unsafe impl CopyingHelper for CBCentral {
    type Result = Self;
}

#[cfg(feature = "CBPeer")]
unsafe impl NSObjectProtocol for CBCentral {}

#[cfg(feature = "CBPeer")]
impl CBCentral {
    extern_methods!(
        /// The maximum amount of data, in bytes, that can be received by the central in a single notification or indication.
        ///
        ///
        /// See: updateValue:forCharacteristic:onSubscribedCentrals:
        #[unsafe(method(maximumUpdateValueLength))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumUpdateValueLength(&self) -> NSUInteger;
    );
}

/// Methods declared on superclass `CBPeer`.
#[cfg(feature = "CBPeer")]
impl CBCentral {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
#[cfg(feature = "CBPeer")]
impl CBCentral {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}
