al_prog_reminder.h 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. /******************************************************************************
  2. ** al_prog_reminder.h: Program reminder Component Header file.
  3. **
  4. ** Copyright(c) 2008 Wipro Technologies - All Rights Reserved
  5. ** Author : Soumya Pandiyattu
  6. **
  7. ** $Id: app_dvb_prog_reminder.h,v 1.1.1.1 2009/04/15 03:24:32 junluo Exp $
  8. ******************************************************************************/
  9. #ifndef __AL_PR_H__
  10. #define __AL_PR_H__
  11. #include "al_basictypes.h"
  12. #include "al_database.h"
  13. #include "al_scheduler.h"
  14. #define PR_MUXTEX_NAME "PR_Mutex"
  15. /* Value of Zero for the Service or Event
  16. ** reminder means that both share the total
  17. ** reminders. If both wants fixed number of the reminders
  18. ** then different values to be provided and total of
  19. ** both should match the total reminders */
  20. #define AL_PR_MAX_NO_SRV_REMINDERS (0)
  21. #define AL_PR_MAX_NO_EVT_REMINDERS (0)
  22. typedef al_uint16 AL_PR_index_t;
  23. typedef struct
  24. {
  25. al_int8 MaxNumOfReminders;
  26. AL_SCH_time_t app_schd_time[AL_SCH_MAX_NO_OF_CALLBACK];
  27. }AL_PR_Init_Param_t;
  28. typedef enum
  29. {
  30. AL_PR_INVALID_REM =0,
  31. AL_PR_EVT_REM = 1<<0,
  32. AL_PR_SRV_REM = 1<<1,
  33. AL_PR_ANA_EVT_REM = 1<<2
  34. } AL_PR_type_t;
  35. typedef enum
  36. {
  37. AL_PR_REC_FIRST,
  38. AL_PR_REC_LAST,
  39. AL_PR_REC_NEXT,
  40. AL_PR_REC_PREV
  41. } AL_PR_record_type_t;
  42. typedef struct
  43. {
  44. AL_RecHandle_t handle;
  45. AL_RecHandle_t Eventhandle;
  46. al_uint32 event_end_time_insec;
  47. } AL_PR_schedule_details_t;
  48. typedef struct
  49. {
  50. AL_DB_EDBType_t db_type;
  51. AL_PR_type_t rem_type;
  52. AL_PR_schedule_details_t rem_details;
  53. AL_SCH_sched_id_t sch_id;
  54. al_uint32 start_local_time_secs;
  55. al_uint32 snooze_time_secs;
  56. al_int8 gmt_offset;
  57. al_bool enable;
  58. al_bool weekday;
  59. } AL_PR_details_t;
  60. typedef struct PR_persistent_info_t_{
  61. AL_DB_EDBType_t db_type;
  62. AL_PR_type_t rem_type;
  63. AL_PR_schedule_details_t rem_details;
  64. al_uint32 start_local_time_secs;
  65. al_uint32 snooze_time_secs;
  66. al_int8 gmt_offset;
  67. al_bool enable;
  68. al_bool occupied;
  69. al_bool weekday;
  70. } PR_persistent_info_t;
  71. typedef struct PR_details_t_{
  72. PR_persistent_info_t details;
  73. AL_SCH_sched_id_t sch_id;
  74. al_uint8 next_index;
  75. } PR_details_t;
  76. /*****************************************************************************
  77. ** FUNCTION : AL_FW_PR_SetInitParam
  78. **
  79. ** DESCRIPTION :
  80. ** Set init Param for Prog Reminder.
  81. **
  82. ** PARAMETERS :
  83. ** AL_PR_Init_Param_t
  84. **
  85. ** RETURN VALUES:
  86. ** void
  87. *****************************************************************************/
  88. al_void AL_PR_SetInitParam(AL_PR_Init_Param_t *Init_param);
  89. /*****************************************************************************
  90. ** FUNCTION : AL_PR_Init
  91. **
  92. ** DESCRIPTION :
  93. ** This function is used to initialise program reminder module.
  94. **
  95. ** PARAMETERS :
  96. ** set MAX_NO_REMINDERS and NOTIFY_TIME_IN_SEC
  97. **
  98. ** RETURN VALUES:
  99. ** AL_SUCCESS
  100. *****************************************************************************/
  101. AL_Return_t AL_PR_Init (void);
  102. /************************************************************************
  103. ** name : AL_PR_GetById(AL_SCH_sched_id_t *id,APP_PR_details_t details)
  104. **
  105. ** description : This API Terminate this component
  106. **
  107. ** input parameters : none
  108. **
  109. ** output parameters : none
  110. **
  111. ** return type : AL_Return_t
  112. ************************************************************************/
  113. AL_Return_t AL_PR_GetById ( AL_SCH_sched_id_t id, AL_PR_details_t *details);
  114. /************************************************************************
  115. ** name : AL_PR_Get(AL_SCH_sched_id_t *id,APP_PR_details_t details)
  116. **
  117. ** description : This API Terminate this component
  118. **
  119. ** input parameters : none
  120. **
  121. ** output parameters : none
  122. **
  123. ** return type : AL_Return_t
  124. ************************************************************************/
  125. AL_Return_t AL_PR_Get (AL_DB_EDBType_t db_type, AL_PR_record_type_t req_type, AL_PR_type_t rem_type,
  126. const AL_SCH_sched_id_t ref_id, AL_SCH_sched_id_t *ret_id);
  127. /************************************************************************
  128. ** name : AL_PR_GetTotal
  129. **
  130. ** description : This API Terminate this component
  131. **
  132. ** input parameters : none
  133. **
  134. ** output parameters : none
  135. **
  136. ** return type : AL_Return_t
  137. ************************************************************************/
  138. AL_Return_t AL_PR_GetTotal (AL_DB_EDBType_t db_type, AL_PR_type_t rem_type, al_uint8* total_count);
  139. /************************************************************************
  140. ** name : AL_PR_Add()
  141. **
  142. ** description : Add new reminder
  143. **
  144. ** input parameters : none
  145. **
  146. ** output parameters : none
  147. **
  148. ** return type : AL_Return_t
  149. ************************************************************************/
  150. AL_Return_t AL_PR_Add( AL_PR_details_t *details, AL_SCH_sched_id_t *id);
  151. /************************************************************************
  152. ** name : AL_PR_AddEx()
  153. **
  154. ** description : Add new reminder and get the conflicted timers
  155. **
  156. ** input parameters : none
  157. **
  158. ** output parameters : none
  159. **
  160. ** return type : AL_Return_t
  161. ************************************************************************/
  162. AL_Return_t AL_PR_AddEx( AL_PR_details_t* details , AL_SCH_sched_id_t* id,AL_SCH_sched_id_t* ConflictTimerID, UINT8* ConflictTimerNum);
  163. /************************************************************************
  164. ** name : AL_PR_Modify()
  165. **
  166. ** description : This API modifies the scheduled event with new information
  167. **
  168. ** input parameters : none
  169. **
  170. ** output parameters : none
  171. **
  172. ** return type : AL_Return_t
  173. ************************************************************************/
  174. AL_Return_t AL_PR_Modify(AL_PR_details_t *details, AL_SCH_sched_id_t id);
  175. /************************************************************************
  176. ** name : AL_PR_ModifyEx()
  177. **
  178. ** description : This API modifies the scheduled event with new information
  179. ** : and get the conflicted timers
  180. **
  181. ** input parameters : none
  182. **
  183. ** output parameters : none
  184. **
  185. ** return type : AL_Return_t
  186. ************************************************************************/
  187. AL_Return_t AL_PR_ModifyEx(AL_PR_details_t *details ,AL_SCH_sched_id_t id,AL_SCH_sched_id_t* ConflictTimerID, UINT8* ConflictTimerNum);
  188. /************************************************************************
  189. ** name : AL_PR_Delete()
  190. **
  191. ** description : This API Delete this reminder
  192. **
  193. ** input parameters : none
  194. **
  195. ** output parameters : none
  196. **
  197. ** return type : AL_Return_t
  198. ************************************************************************/
  199. AL_Return_t AL_PR_Delete(AL_SCH_sched_id_t id);
  200. /************************************************************************
  201. ** name :APP_Data_PR_delete_all_sch()
  202. **
  203. ** description : This API delete all the schedule for the Program reminder
  204. **
  205. ** input parameters : none
  206. **
  207. ** output parameters : none
  208. **
  209. ** return type : AL_Return_t
  210. ************************************************************************/
  211. AL_Return_t AL_PR_DeleteAllSch (AL_DB_EDBType_t db_type, AL_PR_type_t rem_type );
  212. /************************************************************************
  213. ** name :AL_PR_DefaultSetup()
  214. **
  215. ** description : This API perform default setup.
  216. **
  217. ** input parameters : none
  218. **
  219. ** output parameters : none
  220. **
  221. ** return type : AL_Return_t
  222. ************************************************************************/
  223. AL_Return_t AL_PR_DefaultSetup(AL_DB_EDBType_t db_type);
  224. /************************************************************************
  225. ** name : AL_PR_SetAllStatus()
  226. **
  227. ** description : This API modifies Then enable disable status.
  228. **
  229. ** input parameters : none
  230. **
  231. ** output parameters : none
  232. **
  233. ** return type : AL_Return_t
  234. ************************************************************************/
  235. AL_Return_t AL_PR_SetAllStatus(al_bool enable_rem);
  236. /************************************************************************
  237. ** name :AL_PR_GetMaxNoOfReminders()
  238. **
  239. ** description : This API returns the second that before registed event take place.
  240. **
  241. ** input parameters : none
  242. **
  243. ** output parameters : none
  244. **
  245. ** return type : al_uint8 No. of reminders
  246. ************************************************************************/
  247. al_uint8 AL_PR_GetMaxNoOfReminders(void);
  248. /************************************************************************
  249. ** name :AL_PR_NotifyTime()
  250. **
  251. ** description : This API returns the second that before registed event take place.
  252. **
  253. ** input parameters : none
  254. **
  255. ** output parameters : none
  256. **
  257. ** return type : al_uint32 time in sec
  258. ************************************************************************/
  259. al_uint32 AL_PR_NotifyTime(void);
  260. /************************************************************************
  261. ** name :AL_PR_Update()
  262. **
  263. ** description : Handle the whether reminder should be kept or removed for every reminder.
  264. **
  265. ** input parameters :None
  266. **
  267. ** output parameters :None.
  268. **
  269. ** return type : AL_Return_t
  270. ************************************************************************/
  271. AL_Return_t AL_PR_Update(al_int32 time_diff, al_uint32 new_time);
  272. /**
  273. * @brief We can konw the recording is normal recording or timer recording.
  274. *
  275. * @param ppfGetContext[output] callback function.
  276. *
  277. * @return the Prog_remind_id.
  278. */
  279. al_int AL_FW_PVR_GetProgReminderId(void);
  280. /**
  281. * @brief We can konw the recording is normal recording or timer recording.
  282. *
  283. * @param if the recording is normal recording , the Prog_remind_id is AL_SCH_INVALID_ID .
  284. *
  285. * @return none
  286. */
  287. void AL_FW_PVR_SetProgReminderId(al_int id);
  288. /************************************************************************
  289. ** name : AL_PR_CheckEvtEndTime()
  290. **
  291. ** description :
  292. **
  293. ** input parameters : A event end time
  294. **
  295. ** output parameters : none
  296. **
  297. ** return type : Boolean True A event end time is B event start time,
  298. ************************************************************************/
  299. Boolean AL_PR_CheckEvtEndTime(al_uint32 EndTime);
  300. #endif
  301. /******************************************************************************
  302. ** $Log: ACPR_Component.h,v $
  303. ******************************************************************************/