求解,每句后面帮我注释一下,谢谢。

[复制链接]
查看11 | 回复1 | 2011-3-29 08:09:21 | 显示全部楼层 |阅读模式
extern \"C\"{

#include \"APP.h\"
#include \"APP_TOE_add.h\"
}
#include \"DAppChannel.h\"
#include \"DAppChildLock.h\"
#include \"TOEResource.h\"
externPOSD _OSD; //
static trid_uint32 channelnum = 0;
//static trid_bool channellock[100] = {0};

DAppChildLock::DAppChildLock(IDataSlot *slot):DChildLock(0, slot)
{
}
UInt32 DAppChildLock::GetItemCount(void)
{

return 1;
}
Int32 DAppChildLock::GetInteger(Int32 item, Int32 field)
{

trid_uint32 value = 0;

// trid_bool bvalue = 0;

switch(field)

{

case Source:

return value;

case ChannelNum:

value = channelnum;

return value;

case ChannelLock:

value = _OSD-GetDataSlot(\"DataChannel\")-GetInteger(channelnum, DChannel::IsLocked);

return value;

case SourceLock:

return value;

case ChildLockEnable:

return value;

}

return 0;
}
void DAppChildLock::SetInteger(Int32 item, Int32 field, Int32 value)
{

switch(field)

{

case Source:

break;

case ChannelNum:

channelnum = (trid_uint32)value ;
_OSD-GetDataSlot(\"DataChildLock\")-Update();

break;

case ChannelLock:

_OSD-GetDataSlot(\"DataChannel\")-SetInteger(channelnum, DChannel::IsLocked, value);

break;

case SourceLock:

break;

case ChildLockEnable:

break;

default:

break;

}
}
PtrConstAny DAppChildLock::GetString(Int32 item, Int32 field, UInt32 *length, TextEncoding *encoding)
{
static char pass[5];
int pwdCount=5;
RETURN_TYPE ret;

switch (field)
{
case ChildLockPwd:
ret = APP_CFG_GetChildLockPwd(pass,
if(ret != SYS_NOERROR)
{

TRID_ERROR(\"Get parent PIN failed! ret=%d\\n\", ret);

pass[0] = \'\\0\';
}
TRID_DEBUG(\"====parent pin:%s\\n\", pass);
*length = strlen(pass);
*encoding = EncodingASCII;
return pass;
default :
break;
}
return NULL;
}
回复

使用道具 举报

千问 | 2011-3-29 08:09:21 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">求解
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行