tsms_tpdu_deliver.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. * Copyright (C) 2009 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 tsms_tpdu_deliver.h
  23. * @brief SMS TPDU SMS-DELIVER message as per 3GPP TS 23.040 section 9.2.2.1.
  24. *
  25. * @author Mamadou Diop <diopmamadou [at) doubango (DOT) org>
  26. *
  27. */
  28. #ifndef TINYSMS_TSMS_TPDU_DELIVER_H
  29. #define TINYSMS_TSMS_TPDU_DELIVER_H
  30. #include "tinysms_config.h"
  31. #include "tinysms/tsms_common.h"
  32. TSMS_BEGIN_DECLS
  33. /** SMS TPDU SMS-DELIVER message as per 3GPP TS 23.040 section 9.2.2.1.
  34. */
  35. typedef struct tsms_tpdu_deliver_s {
  36. TSMS_DECLARE_TPDU_MESSAGE;
  37. tsms_address_t* smsc;
  38. /** TP More Messages to Send (M - 1b)
  39. * Parameter indicating whether or not there are more messages to send. */
  40. unsigned mms:1;
  41. /** TP-Loop-Prevention (O - 1b)
  42. * Parameter indicating that SMS applications should inhibit forwarding or automatic message generation that could cause infinite looping. */
  43. unsigned lp:2;
  44. /** TP Reply Path (M - 1b)
  45. * Parameter indicating the request for Reply Path.
  46. Section 9.2.3.28 */
  47. unsigned rp:1;
  48. /** TP User Data Header Indicator (O - 1b)
  49. * Parameter indicating that the TP UD field contains a Header. */
  50. unsigned udhi:1;
  51. /** TP Status Report Indicator (O - 1b)
  52. * Parameter indicating if the SME has requested a status report. */
  53. unsigned sri:1;
  54. /** TP Originating Address (M - 2-12o)
  55. * Address of the originating SME. */
  56. tsms_address_t* oa;
  57. /** TP Protocol Identifier (M - o)
  58. * Parameter identifying the above layer protocol, if any. */
  59. //(base)uint8_t pid;
  60. /** TP Data Coding Scheme (M - o)
  61. * Parameter identifying the coding scheme within the TP-User-Data. */
  62. //(base)uint8_t dcs;
  63. /** TP Service Centre Time Stamp (M - 7o)
  64. * Parameter identifying time when the SC received the message. */
  65. uint8_t scts[7];
  66. /** TP User Data Length (M - I)
  67. * Parameter indicating the length of the TP User Data field to follow. */
  68. //(base)uint8_t udl;
  69. /** TP User Data (O - v)
  70. * User data. */
  71. //(base)tsk_buffer_t* ud;
  72. }
  73. tsms_tpdu_deliver_t;
  74. /** cast any pointer to @ref tsms_tpdu_deliver_t* */
  75. #define TSMS_TPDU_DELIVER(self) ((tsms_tpdu_deliver_t*)(self))
  76. TINYSMS_API tsms_tpdu_deliver_t* tsms_tpdu_deliver_create(const tsms_address_string_t smsc, const tsms_address_string_t orig);
  77. /**@ingroup tsms_tpdu_group
  78. * @def tsms_tpdu_deliver_serialize
  79. * Serializes a @a SMS-DELIVER message as binary content.
  80. * @param self A pointer to the @a SMS-DELIVER (@ref tsms_tpdu_deliver_t) message to serialize.
  81. * @param output A pointer to the output buffer. Should be valid.
  82. * @retval Zero if succeed and non-zero error code otherwise.
  83. *
  84. * See For more information, see @ref tsms_tpdu_group_DELIVER "SMS-DELIVER".
  85. */
  86. /**@ingroup tsms_tpdu_group
  87. * @def tsms_tpdu_deliver_tohexastring
  88. * Serializes a @a SMS-DELIVER message as hexa-string content.
  89. * @param self A pointer to the @a SMS-DELIVER (@ref tsms_tpdu_deliver_t) message to serialize.
  90. * @retval A pointer to the hexa-string if succeed and Null otherwise.
  91. *
  92. * See For more information, see @ref tsms_tpdu_group_DELIVER "SMS-DELIVER".
  93. */
  94. /**@ingroup tsms_tpdu_group
  95. * @def tsms_tpdu_deliver_set_userdata
  96. * Sets the content of the @a SMS-DELIVER message.
  97. * @param self A pointer to the @a SMS-DELIVER (@ref tsms_tpdu_deliver_t).
  98. * @param udata A pointer to the content.
  99. * @param alpha The alphabet used to encode the content.
  100. * @retval Zero if succeed and non-zero error code otherwise.
  101. *
  102. * See For more information, see @ref tsms_tpdu_group_DELIVER "SMS-DELIVER".
  103. */
  104. #define tsms_tpdu_deliver_serialize(self, output) tsms_tpdu_message_serialize(TSMS_TPDU_MESSAGE(self), output, tsk_false)
  105. #define tsms_tpdu_deliver_tostring(self) tsms_tpdu_message_tostring(TSMS_TPDU_MESSAGE(self), tsk_false)
  106. #define tsms_tpdu_deliver_tohexastring(self) tsms_tpdu_message_tohexastring(TSMS_TPDU_MESSAGE(self), tsk_false)
  107. #define tsms_tpdu_deliver_set_userdata(self, udata, alpha) tsms_tpdu_message_set_userdata(TSMS_TPDU_MESSAGE(self), udata, alpha)
  108. TINYSMS_GEXTERN const tsk_object_def_t *tsms_tpdu_deliver_def_t;
  109. TSMS_END_DECLS
  110. #endif /* TINYSMS_TSMS_TPDU_DELIVER_H */