vdr
2.0.4
Main Page
Namespaces
Classes
Files
File List
File Members
PLUGINS
src
dvbhddevice
libhdffcmd
hdffcmd_base.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 "
hdffcmd_base.h
"
25
26
void
HdffCmdBuildHeader
(
BitBuffer_t
* MsgBuf,
HdffMessageType_t
MsgType,
27
HdffMessageGroup_t
MsgGroup,
HdffMessageId_t
MsgId)
28
{
29
BitBuffer_SetBits
(MsgBuf, 16, 0);
// length field will be set later
30
BitBuffer_SetBits
(MsgBuf, 6, 0);
// reserved
31
BitBuffer_SetBits
(MsgBuf, 2, MsgType);
32
BitBuffer_SetBits
(MsgBuf, 8, MsgGroup);
33
BitBuffer_SetBits
(MsgBuf, 16, MsgId);
34
}
35
36
uint32_t
HdffCmdSetLength
(
BitBuffer_t
* MsgBuf)
37
{
38
uint32_t length;
39
40
length =
BitBuffer_GetByteLength
(MsgBuf) - 2;
41
MsgBuf->
Data
[0] = (uint8_t) (length >> 8);
42
MsgBuf->
Data
[1] = (uint8_t) length;
43
44
return
length + 2;
45
}
46
Generated by
1.8.3.1