1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! PS ID operations.
#![allow(unused_imports)]
use pspsdk_macros::psp_stub;
use crate::sys::SceError;
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc(alias("PspOpenPSID", "SceOpenPSID"))]
pub struct OpenPSID {
pub data: [u8; 16],
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[doc(alias("SceProductCode"))]
pub struct ProductCode {
pub unk: [u8; 2],
}
#[psp_stub(libname = "sceOpenPSID", flags = 0x4009, version = (0x00, 0x11), use_crate)]
unsafe extern "C" {
/// Get the open PS ID.
///
/// # Parameters
///
/// - `openpsid` **[[Out parameter]]**: A reference to a [`OpenPSID`] to receive the data.
///
/// # Return Values
///
/// `Ok` value on success, error value otherwise.
#[nid(0xC69BEBCE)]
#[cfg(not(feature = "kernel"))]
pub safe fn sceOpenPSIDGetOpenPSID(openpsid: &mut OpenPSID) -> Result<(), SceError>;
/// Get the product code.
///
/// # Parameters
///
/// - `product_code` **[[Out parameter]]**: A reference to a [`ProductCode`] to receive the
/// data.
///
/// # Return Values
///
/// `Ok` value on success, error value otherwise.
#[nid(0xB29330DE)]
pub safe fn sceOpenPSIDGetProductCode(product_code: &mut ProductCode) -> Result<(), SceError>;
}
#[cfg(feature = "kernel")]
#[psp_stub(libname = "sceOpenPSID_driver", flags = 0x0009, version = (0x00, 0x11), use_crate)]
unsafe extern "C" {
/// Get the open PS ID.
///
/// # Parameters
///
/// - `openpsid` **[[Out parameter]]**: A reference to a [`OpenPSID`] to receive the data.
///
/// # Return Values
///
/// `Ok` value on success, error value otherwise.
#[nid(0xC69BEBCE)]
pub safe fn sceOpenPSIDGetOpenPSID(openpsid: &mut OpenPSID) -> Result<(), SceError>;
}