objc2_thread_network/generated/
THCredentials.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// A class that contains credentials for a Thread network.
12    ///
13    /// A Thread network defines parameters that all connected devices use.
14    /// ``THCredentials`` provides these parameters.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/threadnetwork/thcredentials?language=objc)
17    #[unsafe(super(NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    pub struct THCredentials;
20);
21
22extern_conformance!(
23    unsafe impl NSCoding for THCredentials {}
24);
25
26extern_conformance!(
27    unsafe impl NSObjectProtocol for THCredentials {}
28);
29
30extern_conformance!(
31    unsafe impl NSSecureCoding for THCredentials {}
32);
33
34impl THCredentials {
35    extern_methods!(
36        /// The Thread network name.
37        #[unsafe(method(networkName))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn networkName(&self) -> Option<Retained<NSString>>;
40
41        /// The Thread network extended PAN identifier.
42        #[unsafe(method(extendedPANID))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn extendedPANID(&self) -> Option<Retained<NSData>>;
45
46        /// The identifer of an active Thread network Border Agent.
47        ///
48        /// This property’s value is the MAC Extended Address, a random identifier that
49        /// the active Thread network border router generates.
50        #[unsafe(method(borderAgentID))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn borderAgentID(&self) -> Option<Retained<NSData>>;
53
54        /// The essential operational parameters for the Thread network.
55        ///
56        /// The framework parses this property, then extracts and sets
57        /// ``THCredentials/channel``, ``THCredentials/extendedPANID``,
58        /// ``THCredentials/networkKey``, ``THCredentials/networkName``,
59        /// ``THCredentials/panID``, and ``THCredentials/PSKC`` when you call
60        /// ``THClient/storeCredentialsForBorderAgent:activeOperationalDataSet:completion:``.
61        #[unsafe(method(activeOperationalDataSet))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn activeOperationalDataSet(&self) -> Option<Retained<NSData>>;
64
65        /// The sixteen byte Thread network key.
66        #[unsafe(method(networkKey))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn networkKey(&self) -> Option<Retained<NSData>>;
69
70        /// The sixteen byte Thread network pre-shared key for the Commissioner.
71        #[unsafe(method(PSKC))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn PSKC(&self) -> Option<Retained<NSData>>;
74
75        /// The Thread network radio channel.
76        #[unsafe(method(channel))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn channel(&self) -> u8;
79
80        /// Setter for [`channel`][Self::channel].
81        #[unsafe(method(setChannel:))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn setChannel(&self, channel: u8);
84
85        /// The two byte Thead network PAN identifier.
86        #[unsafe(method(panID))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn panID(&self) -> Option<Retained<NSData>>;
89
90        /// The date and time that the framework stored the credential in the database.
91        #[unsafe(method(creationDate))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn creationDate(&self) -> Option<Retained<NSDate>>;
94
95        /// The date and time that the framework updated the credential in the database.
96        #[unsafe(method(lastModificationDate))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn lastModificationDate(&self) -> Option<Retained<NSDate>>;
99
100        #[unsafe(method(init))]
101        #[unsafe(method_family = init)]
102        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
103
104        #[unsafe(method(new))]
105        #[unsafe(method_family = new)]
106        pub unsafe fn new() -> Retained<Self>;
107    );
108}