vdr
2.0.2
Main Page
Namespaces
Classes
Files
File List
File Members
PLUGINS
src
dvbhddevice
libhdffcmd
hdffcmd_remote.c
Go to the documentation of this file.
1
/**********************************************************************
2
*
3
* HDFF firmware command interface library
4
*
5
* Copyright (C) 2011 Andreas Regel
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the
19
* Free Software Foundation, Inc.,
20
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
*
22
*********************************************************************/
23
24
#include <stdint.h>
25
#include <string.h>
26
#include <sys/ioctl.h>
27
28
#include "
hdffcmd.h
"
29
#include "
hdffcmd_base.h
"
30
#include "
hdffcmd_defs.h
"
31
32
33
int
HdffCmdRemoteSetProtocol
(
int
OsdDevice,
HdffRemoteProtocol_t
Protocol)
34
{
35
uint8_t cmdData[8];
36
BitBuffer_t
cmdBuf;
37
osd_raw_cmd_t
osd_cmd;
38
39
BitBuffer_Init
(&cmdBuf, cmdData,
sizeof
(cmdData));
40
memset(&osd_cmd, 0,
sizeof
(
osd_raw_cmd_t
));
41
osd_cmd.
cmd_data
= cmdData;
42
HdffCmdBuildHeader
(&cmdBuf,
HDFF_MSG_TYPE_COMMAND
,
43
HDFF_MSG_GROUP_REMOTE_CONTROL
,
44
HDFF_MSG_REMOTE_SET_PROTOCOL
);
45
BitBuffer_SetBits
(&cmdBuf, 8, Protocol);
46
osd_cmd.
cmd_len
=
HdffCmdSetLength
(&cmdBuf);
47
return
ioctl(OsdDevice,
OSD_RAW_CMD
, &osd_cmd);
48
}
49
50
int
HdffCmdRemoteSetAddressFilter
(
int
OsdDevice,
int
Enable, uint32_t Address)
51
{
52
uint8_t cmdData[12];
53
BitBuffer_t
cmdBuf;
54
osd_raw_cmd_t
osd_cmd;
55
56
BitBuffer_Init
(&cmdBuf, cmdData,
sizeof
(cmdData));
57
memset(&osd_cmd, 0,
sizeof
(
osd_raw_cmd_t
));
58
osd_cmd.
cmd_data
= cmdData;
59
HdffCmdBuildHeader
(&cmdBuf,
HDFF_MSG_TYPE_COMMAND
,
60
HDFF_MSG_GROUP_REMOTE_CONTROL
,
61
HDFF_MSG_REMOTE_SET_ADDRESS_FILTER
);
62
BitBuffer_SetBits
(&cmdBuf, 1, Enable);
63
BitBuffer_SetBits
(&cmdBuf, 7, 0);
// reserved
64
BitBuffer_SetBits
(&cmdBuf, 32, Address);
65
osd_cmd.
cmd_len
=
HdffCmdSetLength
(&cmdBuf);
66
return
ioctl(OsdDevice,
OSD_RAW_CMD
, &osd_cmd);
67
}
68
Generated by
1.8.3.1