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.

157 lines
4.2 KiB

  1. /***************************************************************************
  2. Name : NCUPARMS.C
  3. Comment :
  4. Functions: (see Prototypes just below)
  5. Copyright (c) Microsoft Corp. 1991, 1992, 1993
  6. Revision Log
  7. Date Name Description
  8. -------- ----- ---------------------------------------------------------
  9. ***************************************************************************/
  10. #include "prep.h"
  11. #include "modemint.h"
  12. #include "fcomint.h"
  13. #include "fdebug.h"
  14. ///RSL
  15. #include "glbproto.h"
  16. #define faxTlog(m) DEBUGMSG(ZONE_MD, m)
  17. #define FILEID FILEID_NCUPARMS
  18. void iNCUParamsReset(PThrdGlbl pTG)
  19. {
  20. _fmemset(&(pTG->NCUParams), 0, sizeof(NCUPARAMS));
  21. pTG->NCUParams.uSize = sizeof(pTG->NCUParams);
  22. // These are used to set S regs etc.
  23. // -1 means leave modem at default
  24. pTG->NCUParams.DialtoneTimeout = -1;
  25. pTG->NCUParams.DialPauseTime = pTG->NCUParams.FlashTime = -1;
  26. pTG->NCUParams.DialBlind = -1;
  27. pTG->NCUParams.SpeakerVolume = pTG->NCUParams.SpeakerControl= -1;
  28. pTG->NCUParams.SpeakerRing = -1;
  29. // should be used in answer
  30. pTG->NCUParams.RingsBeforeAnswer = 0;
  31. // should be used in Dial
  32. pTG->NCUParams.AnswerTimeout = 60;
  33. // used in Dial
  34. pTG->NCUParams.chDialModifier = 'T';
  35. pTG->fNCUParamsChanged =FALSE; // to indicate the we need to reset params
  36. }
  37. void FComInitGlobals(PThrdGlbl pTG)
  38. {
  39. _fmemset(&pTG->FComStatus, 0, sizeof(FCOM_STATUS));
  40. _fmemset(&pTG->FComModem, 0, sizeof(FCOM_MODEM));
  41. pTG->fNCUAbort = 0;
  42. _fmemset(&pTG->Comm, 0, sizeof(pTG->Comm));
  43. // +++ fComInit = 0;
  44. }
  45. BOOL NCUSetParams(PThrdGlbl pTG, USHORT uLine, LPNCUPARAMS lpNCUParams)
  46. {
  47. BG_CHK(lpNCUParams);
  48. // BG_CHK(DDI.fLineInUse == 1);
  49. // (MyDebugPrint(pTG, "In NCUSetParams fModemInit=%d fModemOpen=%d fLineInUse=%d\r\n", FComStatus.fModemInit, DDI.fModemOpen, DDI.fLineInUse));
  50. // BG_CHK(FComStatus.fModemInit);
  51. // Copy params into our local NCUparams struct
  52. pTG->NCUParams = *lpNCUParams;
  53. /*** all will be set on next ReInit. Since all have to *****************
  54. do with dial that's soon enough ***********************************
  55. return
  56. iModemSetNCUParams( pTG->NCUParams.DialPauseTime, pTG->NCUParams.SpeakerControl,
  57. pTG->NCUParams.SpeakerVolume, pTG->NCUParams.DialBlind,
  58. pTG->NCUParams.SpeakerRing);
  59. ************************************************************************/
  60. // ignoring DialtoneTimeout and AnswerTimeout because we have
  61. // problems with S7 and answering correctly (no answer vs voice etc)
  62. // also Pulse/Tone I think is being used correctly in Dial (C2 & C1)
  63. pTG->fNCUParamsChanged =TRUE; // to indicate the we need to reset params
  64. // next time we call/answer...
  65. // To-do
  66. // Use RingsBeforeAnswer in Class2Answer and Modem answer
  67. // and we have to set RingAloud--how?
  68. return TRUE;
  69. }
  70. BOOL ModemGetCaps(PThrdGlbl pTG, USHORT uModem, LPMODEMCAPS lpMdmCaps)
  71. {
  72. BG_CHK(lpMdmCaps);
  73. // BG_CHK(DDI.fModemOpen == 1);
  74. // (MyDebugPrint(pTG, "In ModemGetCaps fModemInit=%d fModemOpen=%d fLineInUse=%d\r\n", FComStatus.fModemInit, DDI.fModemOpen, DDI.fLineInUse));
  75. BG_CHK(pTG->FComStatus.fModemInit);
  76. *lpMdmCaps = pTG->FComModem.CurrMdmCaps;
  77. return TRUE;
  78. }
  79. void NCUAbort(PThrdGlbl pTG, USHORT uLine, BOOL fEnable)
  80. {
  81. // BG_CHK(DDI.fLineInUse == 1);
  82. // (MyDebugPrint(pTG, "In NCUAbort fModemInit=%d fModemOpen=%d fLineInUse=%d\r\n", FComStatus.fModemInit, DDI.fModemOpen, DDI.fLineInUse));
  83. BG_CHK(pTG->FComStatus.fModemInit || !fEnable);
  84. if(!fEnable)
  85. pTG->fNCUAbort = 0;
  86. else if(pTG->FComStatus.fInAnswer || pTG->FComStatus.fInDial)
  87. pTG->fNCUAbort = 2;
  88. else
  89. pTG->fNCUAbort = 1;
  90. return;
  91. }