1
0
mirror of https://github.com/danog/libdvb.git synced 2024-11-30 04:19:00 +01:00

comments for ioctl

This commit is contained in:
Andrey Dyldin 2021-01-26 16:36:14 +02:00
parent 8fb4794c1c
commit 31e3f9fec5
2 changed files with 8 additions and 0 deletions

View File

@ -144,6 +144,7 @@ impl FeDevice {
fn get_info(&mut self) -> Result<()> { fn get_info(&mut self) -> Result<()> {
let mut feinfo = FeInfo::default(); let mut feinfo = FeInfo::default();
// FE_GET_INFO
ioctl_read!(#[inline] ioctl_call, b'o', 61, FeInfo); ioctl_read!(#[inline] ioctl_call, b'o', 61, FeInfo);
unsafe { unsafe {
ioctl_call(self.as_raw_fd(), &mut feinfo as *mut _) ioctl_call(self.as_raw_fd(), &mut feinfo as *mut _)
@ -303,6 +304,7 @@ impl FeDevice {
props: cmdseq.as_ptr(), props: cmdseq.as_ptr(),
}; };
// FE_SET_PROPERTY
ioctl_write_ptr!(#[inline] ioctl_call, b'o', 82, DtvProperties); ioctl_write_ptr!(#[inline] ioctl_call, b'o', 82, DtvProperties);
unsafe { unsafe {
ioctl_call(self.as_raw_fd(), &cmd as *const _) ioctl_call(self.as_raw_fd(), &cmd as *const _)
@ -324,6 +326,7 @@ impl FeDevice {
props: cmdseq.as_mut_ptr(), props: cmdseq.as_mut_ptr(),
}; };
// FE_GET_PROPERTY
ioctl_read!(#[inline] ioctl_call, b'o', 83, DtvProperties); ioctl_read!(#[inline] ioctl_call, b'o', 83, DtvProperties);
unsafe { unsafe {
ioctl_call(self.as_raw_fd(), &mut cmd as *mut _) ioctl_call(self.as_raw_fd(), &mut cmd as *mut _)
@ -334,6 +337,7 @@ impl FeDevice {
/// Returns a frontend events if available /// Returns a frontend events if available
pub fn get_event(&self, event: &mut FeEvent) -> Result<()> { pub fn get_event(&self, event: &mut FeEvent) -> Result<()> {
// FE_GET_EVENT
ioctl_read!(#[inline] ioctl_call, b'o', 78, FeEvent); ioctl_read!(#[inline] ioctl_call, b'o', 78, FeEvent);
unsafe { unsafe {
@ -350,6 +354,7 @@ impl FeDevice {
/// - SEC_TONE_ON - turn 22kHz on /// - SEC_TONE_ON - turn 22kHz on
/// - SEC_TONE_OFF - turn 22kHz off /// - SEC_TONE_OFF - turn 22kHz off
pub fn set_tone(&self, value: u32) -> Result<()> { pub fn set_tone(&self, value: u32) -> Result<()> {
// FE_SET_TONE
ioctl_write_int_bad!(#[inline] ioctl_call, request_code_none!(b'o', 66)); ioctl_write_int_bad!(#[inline] ioctl_call, request_code_none!(b'o', 66));
unsafe { unsafe {
@ -378,6 +383,7 @@ impl FeDevice {
/// - OFF is needed with external power supply, for example /// - OFF is needed with external power supply, for example
/// to use same LNB with several receivers. /// to use same LNB with several receivers.
pub fn set_voltage(&self, value: u32) -> Result<()> { pub fn set_voltage(&self, value: u32) -> Result<()> {
// FE_SET_VOLTAGE
ioctl_write_int_bad!(#[inline] ioctl_call, request_code_none!(b'o', 67)); ioctl_write_int_bad!(#[inline] ioctl_call, request_code_none!(b'o', 67));
unsafe { unsafe {
@ -412,6 +418,7 @@ impl FeDevice {
cmd.msg[0 .. msg.len()].copy_from_slice(msg); cmd.msg[0 .. msg.len()].copy_from_slice(msg);
cmd.len = msg.len() as u8; cmd.len = msg.len() as u8;
// FE_DISEQC_SEND_MASTER_CMD
ioctl_write_ptr!(ioctl_call, b'o', 63, DiseqcMasterCmd); ioctl_write_ptr!(ioctl_call, b'o', 63, DiseqcMasterCmd);
unsafe { unsafe {
ioctl_call(self.as_raw_fd(), &cmd as *const _) ioctl_call(self.as_raw_fd(), &cmd as *const _)

View File

@ -210,6 +210,7 @@ impl FeStatus {
pub fn read(&mut self, fe: &FeDevice) -> Result<()> { pub fn read(&mut self, fe: &FeDevice) -> Result<()> {
self.status = FE_NONE; self.status = FE_NONE;
// FE_READ_STATUS
ioctl_read!(#[inline] ioctl_call, b'o', 69, u32); ioctl_read!(#[inline] ioctl_call, b'o', 69, u32);
unsafe { unsafe {
ioctl_call(fe.as_raw_fd(), &mut self.status as *mut _) ioctl_call(fe.as_raw_fd(), &mut self.status as *mut _)