blob: 1cd453e6bbd3a7f651e0442a6f3ad9df633c96bb [file] [log] [blame]
#ifndef _LINE_TSET_H
#define _LINE_TSET_H
/********************²âÊÔÏÒå***********************************/
#define TI_BatteryVolt 0x1 /*²âÊÔSLC °å¶ÔÓû§ÏßµÄÀ¡µçµçѹ´óС·´¼«ÐÔ*/
#define TI_RingVolt 0x2 /*²âÊÔSLC °å¶ÔÓû§ËÍÁåÁ÷ÊÇ·ñÕý³£¼°ÁåÁ÷µçѹ´óС£¨ ·åÖµ¡³*/
#define TI_PulseRecv 0x3 /*²âÊÔSLC °å½ÓÊÕÂö³å»°»ú(Ä£Äâ)·¢ºÅµÄÇé¿ö*/
#define TI_DTMFRecv 0x4 /*²âÊÔSLC °å½ÓÊÕDTMF»°»ú(Ä£Äâ)·¢ºÅµÄÇé¿ö*/
#define TI_SendTone 0x5 /*²¦ºÅÒô£¬»ØÁåÒô£¬ÓµÈûÒô¼°Ã¦Òô¼ì²â*/
#define TI_SendHowl 0x6 /*¶ÔÓû§ËÍ´ß¹ÒÒô*/
#define TI_LoopCircuitAndRes 0x7 /*ÍâÏß»·Â·µçÁ÷¼°»·Â·µç×è²âÊÔ*/
#define TI_PulseDial 0x8 /*²âÊÔÓû§»°»úÂö³å·¢ºÅµÄÄÜÁ¦*/
#define TI_DTMFDial 0x9 /*²âÊÔÓû§»°»úµÄDTMF·¢ºÅÒÔ¼°Âö³å·¢ºÅµÄÇé¿ö*/
#define TI_RingtoUser 0xA /*¶ÔÓû§»°»úËÍÁåÁ÷*/
#define TI_LineVolt 0xB /*ÍâÏßÈ«µçѹ²âÊÔ*/
#define TI_LineRes 0xC /*ÍâÏßÈ«¾øÔµµç×è²âÊÔ*/
#define TI_LineCap 0xD /*ÍâÏßÈ«µçÈݲâÊÔ*/
#define TI_Insert 0xF /*ÓëÓû§Í¨»°*/
/*INVALID TEST ITEM*/
#define TI_Hook 0x10 /*²âÊÔÓû§Õª¹Ò»ú״̬*/
#define TI_VAB 0x11 /*ÍâÏßA-B¼äµçѹ²âÊÔ*/
#define TI_VAG 0x12 /*ÍâÏßA-GND ¼äµçѹ²âÊÔ*/
#define TI_VBG 0x13 /*ÍâÏßB-GND¼äµçѹ²âÊÔ*/
#define TI_RAB 0x14 /*ÍâÏßA-B ¼ä¾øÔµµç×è²âÊÔ*/
#define TI_RAG 0x15 /*ÍâÏßA-GND¼ä¾øÔµµç×è²âÊÔ*/
#define TI_RBG 0x16 /*ÍâÏßB-GND ¼ä¾øÔµµç×è²âÊÔ*/
#define TI_CAB 0x17 /*ÍâÏßA-B¼äµçÈݲâÊÔ*/
#define TI_CAG 0x18 /*ÍâÏßA-GND¼äµçÈݲâÊÔ*/
#define TI_CBG 0x19 /*ÍâÏßB-GND¼äµçÈݲâÊÔ*/
#define TI_InverseBatt 0x1a /* ÎĵµÖÐÊDzâÄÚÏß»ØÂ·µçÁ÷²âÊÔ*/
#define TI_InLoopCurrent 0x1B /* ÄÚÏß»ØÂ·µçÁ÷²âÊÔ*/
#define TI_ISDNLoop 0x1C /* isdn loop Test*/
#define TI_Outside12 0x1D /* ÍâÏß12Ïî²âÊÔ*/
#define TI_REN 0x1e /* ÁåÁ÷Êý */
#define TI_LineConnect 0x1f /* Ïß·Á¬½ÓÐÔ²âÊÔ*/
#define TI_LineRes_reverse 0x20 /*·´¼«ÐÔ¾øÔµµç×è²âÊÔ*/
#define TI_SimCaller 0x27 /*Ä£ÄâÖ÷½Ð*/
#define TI_SimCallee 0x28 /*Ä£Äâ±»½Ð*/
#define TI_Dual 0x29 /*41:Ë«Ïò·ÓÉ */
#define TI_LeakCurrent 0x30 /*48:©µçµçÁ÷*/
#define TI_OutsideNoise 0x31 /*49:ÍâÏßÔëÉù */
#define TI_SimulateDial 0x33 /*51:Ä£ÄⲦÈë*/
#define TI_Monitor 0x34 /*52:¸ß×è¼àÌý*/
#define TI_TalkWithUser 0x35 /*53:ÓëÓû§Í¨»°*/
#define TI_PolarityReversal 0x36 /*54:·´¼«ÐÔ²âÊÔ*/
#define ROH_TEST 0x37 /*55 :Õª»ú²âÊÔ*/
#define TI_CheckBoard 0xFF /*°åλ¼ì²éÃüÁî*/
#define TI_SelfTest 0xFE /*×Ô²â*/
/************************ÃüÁî×Ö***********************************/
#define CMD_WRITE_START 0x01
#define CMD_READ_STATE 0x02
#define CMD_WRITE_ABORT 0x03
#define CMD_READ_RESULT 0x04
/*******************************²âÊÔ״̬**************************/
#define NOT_TEST 0x00
#define TESTING 0x01
#define TEST_SUCC 0x02
#define TEST_ERROR 0x03
#define TEST_STARTING 0x04
#define TEST_STOPING 0x05
#define MAX_TIMOUT 12000 /* 2 min */
/************************´íÎó±àºÅ*********************************/
typedef enum{
NO_ERROR = 0,
ERR_UNKONW ,
TESTITEM_TIMEOVER, /* Time out!*/
COMMAND_ERR_NOTLINE, /* No available testing line! */
COMMAND_ERR_NOTEST_UNIT, /* No available testing data buffer! */
ASSIGN_DATA_ERR, /* Data assignment failed!*/
TESTITEM_FAIL, /* Testing failed!*/
COMMAND_ERR_USER_USED, /* The user card is in testing process!*/
UNFIND_TEST_RECORD, /* No available testing card!*/
DATABASE_FAIL, /* Database accessing failed!*/
ALC_OFFLINE, /* The user card is offline!*/
USER_BUSY, /* User is busy!*/
BOARD_ABNORMAL, /* Board is abnormal!*/
TEST_USER_BUSY, /* User is busy!*/
USER_IS_ONHOOK, /* User is onhook state!*/
USER_IS_OFFHOOK, /* User is offhook state!*/
ARGS_ERROR , /* Testing error, please check the user line state!*/
USER_LINE_RES, /* User line is resistive loop, maybe short circuit!*/
REN_GREATER, /* REN is greater than 5000 milli,check the user line.*/
REN_LOWER, /* REN is lower than 175 milli,check the user line.*/
RES_LOWER, /* The DC resistance measured from the rtg/rrg/rrt lead to ground is less than 150k.*/
RESULT_OC, /* The result is over the ouside the the specified criteria.Check the user line.*/
NO_PHONE, /* No signal between tip and ring, maybe there is no phone!*/
NOT_SURPPORT /* The test item is not surpported !*/
}ErrMsg_t;
typedef struct{
unsigned char port; /* ¶Ë¿Ú±àºÅ */
unsigned char port_type; /* ¶Ë¿ÚÀàÐÍ */
unsigned char item; /* ²âÊÔÏî±àºÅ£¬¼ûÉÏÃæ²âÊÔÏÒå */
unsigned char obligate; /* ÊÇ·ñÇ¿ÖÆ²âÊÔ 0£º²»Ç¿ÖÆ£»1£ºÇ¿ÖÆ*/
long num; /* ²âÊÔÐòºÅ */
unsigned char omci_item; /* ÓÃÓÚ¶àÏî²âÊÔÖмǼomci²âÊÔÏî±àºÅ */
unsigned char cmd; /* ²âÊÔÆô¶¯ºÍ¶Á״̬:1,write;2,read;3,abort. */
unsigned char flg; /* ²âÊÔÍê³É±ê¼Ç:³É¹¦»òÕßʧ°Ü */
}WriteCmd_t;
typedef struct{
unsigned char port; /* ¶Ë¿Ú±àºÅ */
unsigned char port_type; /* ¶Ë¿ÚÀàÐÍ */
unsigned char item; /* ²âÊÔÏî±àºÅ */
unsigned char obligate; /* ÊÇ·ñÇ¿ÖÆ²âÊÔ */
long num; /* ²âÊÔÐòºÅ */
unsigned char omci_item; /* ÓÃÓÚ¶àÏî²âÊÔÖмǼomci²âÊÔÏî±àºÅ */
unsigned char flg; /* ²âÊÔÍê³É±ê¼Ç:³É¹¦»òÕßʧ°Ü */
unsigned char user_flg; /* Óû§ÊÇ·ñÔÚÏß */
ErrMsg_t err_num; /* ²âÊÔʧ°ÜºóµÄ´íÎó±àºÅ,²âÊԳɹ¦ÔòÎÞÒâÒå */
/* TI_LineVolt */
signed long vac_tr; /* ½»Á÷µçѹ£ºTip-Ring */
signed long vac_tg; /* ½»Á÷µçѹ£ºTip-Gnd */
signed long vac_rg; /* ½»Á÷µçѹ£ºRing-Gnd */
signed long vdc_tr; /* Ö±Á÷µçѹ£ºTip-Ring */
signed long vdc_tg; /* Ö±Á÷µçѹ£ºTip-Gnd */
signed long vdc_rg; /* Ö±Á÷µçѹ£ºRing-Gnd */
/* TI_LineRes */
signed long res_tr; /* µç×裺Tip-Ring */
signed long res_tg; /* µç×裺Tip-Gnd */
signed long res_rg; /* µç×裺Ring-Gnd */
/* TI_LineCap */
signed long cap_tr; /* µçÈÝ£ºTip-Ring */
signed long cap_tg; /* µçÈÝ£ºTip-Gnd */
signed long cap_rg; /* µçÈÝ£ºRing-Gnd */
/* TI_RingVolt */
signed long ring_vol; /* ÕñÁåµçѹ */
signed long Hz; /* ÕñÁ寵ÂÊ */
/* TI_REN */
signed long ren; /* ÁåÁ÷Êý */
/* TI_InLoopCurrent */
signed long loop_curent; /* »ØÂ·µçÁ÷ */
signed long loop_res; /* »ØÂ·µç×è */
/* TI_BatteryVolt */
signed long battary; /* À¡µçµçѹ */
}TestResult_t;
#endif