Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
4.0 KiB

  1. /*************************************************************************
  2. hdlc.h
  3. Contains stuff pertaining to sending and recieving HDLC frames
  4. that are defined in the T30 spec.
  5. *************************************************************************/
  6. // On PCs we should pause before ALL frames _except_ CFR & FTT (because
  7. // those are too time critical). In IFAX we look for silence always.
  8. // This is handled in HDLC.C
  9. // On PCs we use TwiddleThumbs() (FTS and FRS are dangerous)
  10. // In IFAX we must use RecvSilence (safe in IFAX) to avoid collisions
  11. // This is handled inside the Modem driver. AWT30 always call RecvSilence
  12. // (in HDLC.C), and the Class1 modem driver uses TwiddleThumbs()
  13. // not FRS or FTS, while teh IFAX driver looks for real silence
  14. // In WFW don't pause before CFR/FTT. Delay may get too long!!
  15. #define SendCFR(pTG) (SendSingleFrame(pTG,ifrCFR,0,0,1))
  16. #define SendFTT(pTG) (SendSingleFrame(pTG,ifrFTT,0,0,1))
  17. // must pause before MCF/RTN always
  18. #define SendMCF(pTG) (SendSingleFrame(pTG,ifrMCF,0,0,1))
  19. #define SendRTN(pTG) (SendSingleFrame(pTG,ifrRTN,0,0,1))
  20. /*** never send RTP
  21. #define SendRTP() (SendSingleFrame(ifrRTP,0,0))
  22. ***/
  23. // no harm in pausing before DCN.
  24. #define SendDCN(pTG) (SendSingleFrame(pTG,ifrDCN,0,0,1))
  25. #ifdef USECRP
  26. # define SendCRP(pTG) (SendSingleFrame(pTG,ifrCRP,0,0,1))
  27. #else
  28. # define SendCRP(pTG) (0)
  29. #endif
  30. // we've eliminated the post-page pause, so we need to pause before these
  31. // frames. In any case, that's all handled inside the modem driver.
  32. // We make a single call to ModemRecSilence()
  33. #define SendEOM(pTG) (SendSingleFrame(pTG,ifrEOM,0,0,1))
  34. #define SendMPS(pTG) (SendSingleFrame(pTG,ifrMPS,0,0,1))
  35. #define SendEOP(pTG) (SendSingleFrame(pTG,ifrEOP,0,0,1))
  36. #define SendPRI_EOM(pTG) (SendSingleFrame(pTG,ifrPRI_EOM,0,0,1))
  37. #define SendPRI_MPS(pTG) (SendSingleFrame(pTG,ifrPRI_MPS,0,0,1))
  38. #define SendPRI_EOP(pTG) (SendSingleFrame(pTG,ifrPRI_EOP,0,0,1))
  39. #define SendPIP(pTG) (SendSingleFrame(pTG,ifrPIP,0,0.1))
  40. #define SendPIN(pTG) (SendSingleFrame(pTG,ifrPIN,0,0,1))
  41. // do we need a pause before RR/CTC/ERR/CTR etc?
  42. // in RR & CTC we have all teh time in the world, so must pause
  43. // ERR & CTR I dunno, so I'm pausing anyway
  44. #define SendRR(pTG) (SendSingleFrame(pTG,ifrRR,0,0,1))
  45. #define SendCTC(pTG,fif) (SendSingleFrame(pTG,ifrCTC,fif,2,1))
  46. #define SendERR(pTG) (SendSingleFrame(pTG,ifrERR,0,0,1))
  47. #define SendCTR(pTG) (SendSingleFrame(pTG,ifrCTR,0,0,1))
  48. // PPR/RNR sent in same logical spot as MCF so use delay
  49. #define SendPPR(pTG,fif) (SendSingleFrame(pTG,ifrPPR,fif,32,1))
  50. #define SendRNR(pTG) (SendSingleFrame(pTG,ifrRNR,0,0,1))
  51. // add this...
  52. #define SendEOR_EOP(pTG) (SendSingleFrame(pTG,ifrEOR_EOP, 0, 0, 1))
  53. #define TEXTBASED
  54. typedef struct {
  55. BYTE bFCF1;
  56. BYTE bFCF2;
  57. BYTE fInsertDISBit;
  58. BYTE wFIFLength; // required FIF length, 0 if none, FF if variable
  59. char* szName;
  60. } FRAME;
  61. typedef FRAME TEXTBASED *CBPFRAME;
  62. // CBPFRAME is a based pointer to a FRAME structure, with the base as
  63. // the current Code segment. It will only be used to access
  64. // the frame table which is a CODESEG based constant table.
  65. // This is everything you never wanted to know about T30 frames....
  66. #define ifrMAX 48
  67. extern FRAME TEXTBASED rgFrameInfo[ifrMAX];
  68. /****************** begin prototypes from hdlc.c *****************/
  69. BOOL SendSingleFrame(PThrdGlbl pTG, IFR ifr, LPB lpbFIF, USHORT uFIFLen, BOOL fSleep);
  70. BOOL SendManyFrames(PThrdGlbl pTG, LPLPFR lplpfr, USHORT uNumFrames);
  71. BOOL SendZeros(PThrdGlbl pTG, USHORT uCount, BOOL fFinal);
  72. BOOL SendTCF(PThrdGlbl pTG);
  73. BOOL SendRTC(PThrdGlbl pTG, BOOL);
  74. SWORD GetTCF(PThrdGlbl pTG);
  75. /***************** end of prototypes from hdlc.c *****************/