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;
}
|