tsip_timers.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. /*
  2. * Copyright (C) 2010-2011 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango[dot]org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. /**@file tsip_timers.h
  23. * @brief SIP timers.
  24. *
  25. * @author Mamadou Diop <diopmamadou(at)doubango[dot]org>
  26. *
  27. */
  28. #ifndef TINYSIP_TIMERS_H
  29. #define TINYSIP_TIMERS_H
  30. #include "tinysip_config.h"
  31. #include "tsk_timer.h"
  32. TSIP_BEGIN_DECLS
  33. #define TSIP_TIMER_GET(TX) tsip_timers_get##TX()
  34. //extern const char *timerT1;
  35. //extern const char *timerT2;
  36. //extern const char *timerT4;
  37. //extern const char *timerA;
  38. //extern const char *timerB;
  39. //extern const char *timerC;
  40. //extern const char *timerD;
  41. //extern const char *timerE;
  42. //extern const char *timerF;
  43. //extern const char *timerG;
  44. //extern const char *timerH;
  45. //extern const char *timerI;
  46. //extern const char *timerJ;
  47. //extern const char *timerK;
  48. //extern const char *timerL;
  49. //extern const char *timerM;
  50. typedef struct tsip_timer_s {
  51. tsk_timer_id_t id;
  52. uint64_t timeout;
  53. }
  54. tsip_timer_t;
  55. typedef struct tsip_timers_s {
  56. uint32_t T1;
  57. uint32_t T2;
  58. uint32_t T4;
  59. uint32_t A;
  60. uint32_t B;
  61. uint32_t C;
  62. uint32_t D;
  63. uint32_t E;
  64. uint32_t F;
  65. uint32_t G;
  66. uint32_t H;
  67. uint32_t I;
  68. uint32_t J;
  69. uint32_t K;
  70. uint32_t L;
  71. uint32_t M;
  72. }
  73. tsip_timers_t;
  74. TINYSIP_API void tsip_timers_setT1(uint32_t t1);
  75. TINYSIP_API void tsip_timers_setT2(uint32_t t2);
  76. TINYSIP_API void tsip_timers_setT4(uint32_t t4);
  77. TINYSIP_API void tsip_timers_setA(uint32_t a);
  78. TINYSIP_API void tsip_timers_setB(uint32_t b);
  79. TINYSIP_API void tsip_timers_setC(uint32_t c);
  80. TINYSIP_API void tsip_timers_setD(uint32_t d);
  81. TINYSIP_API void tsip_timers_setE(uint32_t e);
  82. TINYSIP_API void tsip_timers_setF(uint32_t f);
  83. TINYSIP_API void tsip_timers_setG(uint32_t g);
  84. TINYSIP_API void tsip_timers_setH(uint32_t h);
  85. TINYSIP_API void tsip_timers_setI(uint32_t i);
  86. TINYSIP_API void tsip_timers_setJ(uint32_t j);
  87. TINYSIP_API void tsip_timers_setK(uint32_t k);
  88. TINYSIP_API void tsip_timers_setL(uint32_t l);
  89. TINYSIP_API void tsip_timers_setM(uint32_t m);
  90. TINYSIP_API uint32_t tsip_timers_getT1();
  91. TINYSIP_API uint32_t tsip_timers_getT2();
  92. TINYSIP_API uint32_t tsip_timers_getT4();
  93. TINYSIP_API uint32_t tsip_timers_getA();
  94. TINYSIP_API uint32_t tsip_timers_getB();
  95. TINYSIP_API uint32_t tsip_timers_getC();
  96. TINYSIP_API uint32_t tsip_timers_getD();
  97. TINYSIP_API uint32_t tsip_timers_getE();
  98. TINYSIP_API uint32_t tsip_timers_getF();
  99. TINYSIP_API uint32_t tsip_timers_getG();
  100. TINYSIP_API uint32_t tsip_timers_getH();
  101. TINYSIP_API uint32_t tsip_timers_getI();
  102. TINYSIP_API uint32_t tsip_timers_getJ();
  103. TINYSIP_API uint32_t tsip_timers_getK();
  104. TINYSIP_API uint32_t tsip_timers_getL();
  105. TINYSIP_API uint32_t tsip_timers_getM();
  106. TSIP_END_DECLS
  107. #endif /* TINYSIP_TIMERS_H */