How to get input from telium device??
while( nState != STATE_INPUT_END )
{
cKey=0;
reset_buf(pxKbd, _receive_id);
cKey = getchar();
switch( cKey )
{
case T_VAL:
nState = STATE_INPUT_END;
break;
case T_CORR:
if(ch=='P')
{
password[--i]=' ';
tcBuf[--iIdx]=' ';
}
else
tcBuf[--iIdx]=' ';
break;
case T_ANN:
while(iIdx>=0)
tcBuf[--iIdx]=' ';
iIdx++;
if(ch=='P')
{
while(i>=0)
password[--i]=' ';
i++;
}
font_size(8,16);
putchar('\x1B');
gotoxy(0,0);
printf("%s",lbldisplay);
font_size(6,8);
break;
case T_NUM0:
case T_NUM1:
case T_NUM2:
case T_NUM3:
case T_NUM4:
case T_NUM5:
case T_NUM6:
case T_NUM7:
case T_NUM8:
case T_NUM9:
//case T_POINT:
if(ch=='P')
{
password[i++]='*';
tcBuf[iIdx++]=cKey;
}
else
tcBuf[iIdx++]=cKey;
break;
}
gotoxy(3,3);
if(ch=='P')
printf(password);
else
printf(tcBuf);
}
while( nState != STATE_INPUT_END )
{
cKey=0;
reset_buf(pxKbd, _receive_id);
cKey = getchar();
switch( cKey )
{
case T_VAL:
nState = STATE_INPUT_END;
break;
case T_CORR:
if(ch=='P')
{
password[--i]=' ';
tcBuf[--iIdx]=' ';
}
else
tcBuf[--iIdx]=' ';
break;
case T_ANN:
while(iIdx>=0)
tcBuf[--iIdx]=' ';
iIdx++;
if(ch=='P')
{
while(i>=0)
password[--i]=' ';
i++;
}
font_size(8,16);
putchar('\x1B');
gotoxy(0,0);
printf("%s",lbldisplay);
font_size(6,8);
break;
case T_NUM0:
case T_NUM1:
case T_NUM2:
case T_NUM3:
case T_NUM4:
case T_NUM5:
case T_NUM6:
case T_NUM7:
case T_NUM8:
case T_NUM9:
//case T_POINT:
if(ch=='P')
{
password[i++]='*';
tcBuf[iIdx++]=cKey;
}
else
tcBuf[iIdx++]=cKey;
break;
}
gotoxy(3,3);
if(ch=='P')
printf(password);
else
printf(tcBuf);
}
Any problem for getting this code??
ReplyDelete