?? otelc.c
字號:
extern void send_ht9200(uchar in) ;
void OTel_RP_ZJ()
{
SW = 1 ;
SendDxFlag = 2 ;
Phone_ToneCtrl(TRUE) ;
}
void OTel_RP_GJ()
{
SW = 0 ; SW = 0 ;
SendDxFlag = FALSE ;
IsInputRing = 0 ;
Stop_Play_flag = 0 ;
Is_TongHua_flag = 0 ;
Busy_Cout_flag = 0 ;
Huilingying_flag = 0 ;
Checked_DFZJ_flag = 0 ;
Huilingying_dingshi = 0 ;
Busy_analyse_flag = 0 ;
Sys_TimerRelease(OTimerID1) ;
Phone_ToneCtrl(FALSE) ;
if(Checked_playend_flag == 1)
{
Checked_playend_flag = 0 ;
Send_Stop_Play() ; //stop play
}
delay(600) ;
}
void Send_Code(uchar no)
{
send_ht9200(no) ;
delay(100) ;
}
void OTel_RP_Init()
{
SendDxFlag = FALSE ;
IsInputRing = 0 ;
Stop_Play_flag = 0 ;
Busy_Cout_flag = 0 ;
Huilingying_flag = 0 ;
Huilingying_dingshi = 0 ;
Callid_Ring_time = 0 ;
Busy_analyse_flag = 0 ;
}
void OTel_Rece_DTMF() using 2
{
uchar temp_ret,temp_data ;
temp_ret = check_DV() ; //check dtmf dv
if(temp_ret == TRUE)
{
temp_data = DTMF_read() ; //in data
if(Is_TongHua_flag ==1)
{
disp_buf = temp_data ;
if(Checked_playend_flag == 1)
{
Checked_playend_flag = 0 ;
Stop_Play_flag = 1 ;
//Stop_Play() ; //stop play
Serial_SendCommandR("ATFEND#",7) ;
}
Serial_SendCommandR("ATN",3) ;
Serial_SendCommandR(&temp_data,1) ; //
Serial_SendCommandR("#",1) ;
}
}
}
void OTel_RP_Check()
{
uchar temp_ret ;
// uchar code tablef[17] = "0123456789abcd*#" ;
// /*并機電話使用檢測*/
temp_ret = Check_DXC() ;
if((temp_ret == TRUE)&&(SendDxFlag != 2))
{
disp_buf = 16 ;
SendDxFlag = TRUE ;
Serial_SendCommand("ATTON#",6) ;
}
else if((temp_ret == FALSE)&&(Check_DX_flag == 0))
{
if(SendDxFlag == TRUE)
{
SendDxFlag = FALSE ;
disp_buf = 22 ;
Serial_SendCommand("ATTOFF#",7) ;
}
}
/* CALLID FSK模式
if(CallidFlag == TRUE)
{
EA = 0 ;
temp_ret = CallIDProc() ;
EA = 1 ;
if(temp_ret == OK)
{
if(CallIDFormat == 0x80) //MDMF format
{
disp_buf = 21 ;
callid_close() ;
Serial_SendCommand("ATCALLID",8) ;
Serial_SendCommand(COMBuffer+13,COMBuffer[12]) ;
Serial_SendCommand("#",1) ;
}
else if(CallIDFormat == 0x04) //SDMF format
{
disp_buf = 18 ;
callid_close() ;
Serial_SendCommand("ATCALLID",8) ;
Serial_SendCommand(COMBuffer+9,COMBuffer[0]-8) ;
Serial_SendCommand("#",1) ;
}
}
else if(temp_ret == 2)
{
callid_close() ;
}
}
// /DTMF CALLID模式/
temp_ret = check_FSK_DV() ; //check FSK dtmf dv
if(temp_ret == TRUE)
{
temp_data = DTMF_read() ; //in FSK data
if(Is_TongHua_flag ==1)
{
disp_buf = temp_data ;
if(Checked_playend_flag == 1)
{
Checked_playend_flag = 0 ;
Stop_Play() ; //stop play
Serial_SendCommand("ATFEND#",7) ;
}
Serial_SendCommand("ATN",3) ;
Serial_SendCommand(&temp_data,1) ; //
Serial_SendCommand("#",1) ;
}
else // CALLID DTMF處理
{
//if(temp_data != 0x0d)
//{
disp_buf = temp_data ;
COMBuffer[COMBufferLen] = temp_data ;
if(COMBufferLen < COMMaxByte-1) COMBufferLen++ ;
/}
else
{
Serial_SendCommand("ATCALLID",8) ;
Serial_SendCommand(COMBuffer,COMBufferLen) ;
Serial_SendCommand("#",1) ;
}/
}
}
*/
/* temp_ret = check_DV() ; //check dtmf dv
if(temp_ret == TRUE)
{
temp_data = DTMF_read() ; //in data
if(Is_TongHua_flag ==1)
{
disp_buf = temp_data ;
if(Checked_playend_flag == 1)
{
Checked_playend_flag = 0 ;
Stop_Play() ; //stop play
Serial_SendCommand("ATFEND#",7) ;
}
Serial_SendCommand("ATN",3) ;
Serial_SendCommand(&temp_data,1) ; //
Serial_SendCommand("#",1) ;
}
}
*/
if(Stop_Play_flag == 1)
{
Stop_Play_flag = 0 ;
Send_Stop_Play() ; //stop play
}
if(Checked_playend_flag == 1) //放音放完了
{
if(RDY == 1)
{
Checked_playend_flag = 0 ;
Serial_SendCommand("ATFEND#",7) ;
}
}
// /*振鈴檢測*/
temp_ret = check_RING() ; //ring check
if(temp_ret == TRUE)
{
disp_buf = 23 ;
Serial_SendCommand("ATRing#",7) ;
delay(1150) ;
/* if(Callid_Ring_time <= 1) //第二次振鈴到
{
if(COMBufferLen > 2) //有DTMF方式來的來電號碼
{
Serial_SendCommand("ATCALLID",8) ;
Serial_SendCommand(COMBuffer,COMBufferLen) ;
Serial_SendCommand("#",1) ;
}
}
temp_ret = Sys_TimerReqire(OTimerID0,70,0) ; //超時處理
delay(1200) ;
if(Callid_Ring_time == 0)
callid_open() ;*/
Callid_Ring_time++ ;
IsInputRing = 1 ;
temp_ret = Sys_TimerReqire(OTimerID0,70,0) ; //超時處理
}
//是否需要定時
if((Huilingying_flag == 1)&&(Huilingying_dingshi == 1))
{
Huilingying_dingshi = 0 ;
temp_ret = Sys_TimerReqire(OTimerID1,80,0) ; //超時處理
}
// /*定時器分析*/
temp_ret = Analyse_OTimerID() ;
if(temp_ret == OTimerID0)
{
disp_buf = 0xff ;
Callid_Ring_time = 0 ;
}
else if(temp_ret == OTimerID1)
{
Huilingying_flag = 0 ;
Huilingying_dingshi = 0 ;
Busy_analyse_flag = 1 ;
Checked_DFZJ_flag = 1 ;
Phone_ToneCtrl(TRUE) ;
Serial_SendCommand("ATDFZJ#",7) ;
}
else if(temp_ret == OTimerID2)
{
Busy_Cout_flag = 0 ;
}
// /*忙音檢測*/
if(Busy_analyse_flag == 1)
{
if(ToneKind == 0x30)
{
Busy_Cout_flag ++ ;
if(Busy_Cout_flag < 4)
{
Phone_ToneCtrl(TRUE) ;
temp_ret = Sys_TimerReqire(OTimerID2,15,0) ; //超時清除變量處理
}
else
{
// if(Checked_DFZJ_flag == 1)
Serial_SendCommand("ATDFGJ#",7) ;
OTel_RP_GJ() ;
Phone_ToneCtrl(FALSE) ;
Sys_TimerRelease(OTimerID1) ;
}
}
}
/*/ /按鍵檢測/
temp_ret = check_VIN() ; //VIN check
if(temp_ret == TRUE)
{
if(VIN_frist_flag == 1) //VOUT Contral open
{
disp_buf = 26 ;
VIN_frist_flag = 0 ;
VOUT = 0 ;
}
else //VOUT Contral close
{
disp_buf = 0xff ;
VIN_frist_flag = 1 ;
VOUT = 1 ;
}
}
*/
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -