typedefs.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. #ifndef _Typedefs_H
  2. #define _Typedefs_H
  3. /* ========================================================================
  4. * [PROJECT] SIR
  5. * [MODULE] global module
  6. * [TITLE] system header file
  7. * [FILE] typedefs.h
  8. * [VSN] 1.0
  9. * [CREATED] 09 november 2003
  10. * [LASTCHNGD] 09 november 2003
  11. * [COPYRIGHT] Copyright (C) STREAMIT BV 2010
  12. * [PURPOSE] global typedefs
  13. * ======================================================================== */
  14. /*
  15. * Copyright 20152016-TI2.3a6, 2016.
  16. *
  17. * Project : 20152016-TI2.3a6-Internet Radio
  18. * Module : Type definitions
  19. * File name : Typedefs.h
  20. * Revision : 1.1
  21. * Creation Date : 2016/03/04
  22. *
  23. * Description : Global type definitions for the SIR100/120
  24. * firmware.
  25. *
  26. * Changelog 1.1 : Add type definitions for TI2.3a6 software.
  27. * - Add bool
  28. */
  29. /*--------------------------------------------------------------------------*/
  30. /* Include files */
  31. /*--------------------------------------------------------------------------*/
  32. #include <fs/typedefs.h>
  33. /*--------------------------------------------------------------------------*/
  34. /* Constant definitions */
  35. /*--------------------------------------------------------------------------*/
  36. /*--------------------------------------------------------------------------*/
  37. /* Type declarations */
  38. /*--------------------------------------------------------------------------*/
  39. /* RL: this 'table' has now a mirror table in 'Display.c' (LcdErrorStrings) */
  40. /* Make sure that any modification made to this table are reflected by */
  41. /* the LcdErrorStirngs table! (an error is bad but showing the wrong */
  42. /* error is too much....) */
  43. // Additions based on version 1.1
  44. typedef enum {false, true} bool;
  45. typedef enum _TERRORCODE
  46. {
  47. OK = 0, /* All ok */
  48. /*
  49. * Status messages
  50. */
  51. CHANNEL_CONNECTING, /* Channel connecting */
  52. CHANNEL_RETRIEVING, /* Retrieving channels */
  53. STREAMER_CONNECTING, /* Connecting to stream */
  54. STREAMER_BUFFERING, /* Buffering audio */
  55. STREAMER_PLAYING, /* Playing audio from a stream */
  56. STREAMER_FALLBACK, /* trying card now, inet failed*/
  57. UPDATE_CONNECTING, /* connecting to update server */
  58. CARD_BUFFERING, /* Buffering audio */
  59. CARD_PLAYING, /* Playing audio from a card */
  60. USER_ABORT, /* User abort */
  61. /*
  62. * Warnings. In other words, problems that are
  63. * probably recoverable by a retry
  64. */
  65. PLAYER_WARNINGS = 200,
  66. CHANNEL_HOSTNOTFOUND, /* Could not resolve hostname */
  67. CHANNEL_NEW_ISP, /* New ISP settings received */
  68. CHANNEL_NEW_DB, /* New DB URL info received */
  69. CHANNEL_NEW_CHANNEL, /* New channel info received */
  70. CHANNEL_NOCONNECT, /* Could not connect (will retry) */
  71. CHANNEL_TOO_MANY_NOCONNECTS, /* Could not connect */
  72. CHANNEL_REDIRECT, /* Redirect (will retry) */
  73. CHANNEL_TOO_MANY_REDIRECTS, /* Too many redirects */
  74. CHANNEL_BADRESPONSE, /* Bad server response (will retry) */
  75. CHANNEL_TOO_MANY_BADRESPONSES, /* Bad server response */
  76. STREAM_HOSTNOTFOUND, /* Could not resolve hostname */
  77. STREAM_NOCONNECT, /* Could not connect (will retry) */
  78. STREAM_REDIRECT, /* Redirect (will retry) */
  79. STREAM_BADRESPONSE, /* Bad server response (will retry) */
  80. INET_HOSTNOTFOUND, /* Could not resolve hostname (will retry) */
  81. INET_NOCONNECT, /* Could not connect (will retry) */
  82. INET_BADRESPONSE, /* Bad server response (will retry) */
  83. INET_REDIRECT, /* Redirect (will retry) */
  84. INET_ACCESS_RESTRICTED, /* Access needs login info (will retry) */
  85. STREAM_TIMEOUT, /* Network timeout */
  86. STREAM_BADAUDIO, /* Audio data seems invalid */
  87. STREAM_DISCONNECTED, /* Server closed the connection */
  88. STREAM_BUFFEREMPTY, /* Audio buffer ran out of data */
  89. STREAM_BADCHANNEL, /* Bad channel number */
  90. UPDATE_NEEDED, /* Firmware update is needed */
  91. PLAYER_WAITPLAY, /* Player has nothing to do */
  92. PLAYER_STARTING,
  93. CARD_BUFFEREMPTY, /* Audio buffer ran out of data */
  94. CARD_BADPLAYLIST, /* non-existing or invalid playlist requested */
  95. CARD_BADAUDIO, /* Audio data seems invalid */
  96. /*
  97. * Errors.
  98. * User interaction (e.g. select a different channel) can solve these
  99. */
  100. PLAYER_ERRORS = 400,
  101. BADCHANNEL, /* Bad channel number - no longer used */
  102. STREAM_TOO_MANY_NOCONNECTS, /* Too many no connects */
  103. STREAM_TOO_MANY_BADRESPONSES, /* Too many bad server responses */
  104. STREAM_TOO_MANY_REDIRECTS, /* Too many redirects */
  105. UPDATE_FAILED, /* not specified, just failed */
  106. CHANNEL_NODATA, /* Didn't receive any data */
  107. STREAM_BAD_FILETYPE, /* Bad type of file */
  108. STREAM_BAD_NETWORK, /* Too many network failures - no longer used */
  109. STREAM_DISCONNECTED_UNUSED, /* Server closed the connection - no longer used */
  110. STREAM_BUFFEREMPTY_UNUSED, /* Audio buffer ran out of data - no longer used */
  111. INET_HOST_NONEXISTANT, /* Hostname unknown */
  112. INET_TOO_MANY_NOCONNECTS, /* Too many no connects */
  113. INET_TOO_MANY_REDIRECTS, /* Too many redirects */
  114. INET_TOO_MANY_BADRESPONSES, /* Too many bad server responses */
  115. INET_ACCESS_DENIED, /* Access to the server was denied */
  116. CARD_NO_SONG, /* no (more) songs found on this card */
  117. CARD_PLAYLIST_IN_USE, /* trying to open a playlist that was open already */
  118. CARD_CREATE_STREAM, /* Failed to create a stream */
  119. CARD_NO_CARD, /* card not present to perfom desired action */
  120. CARD_NO_HEAP, /* unable to allocate RAM */
  121. CARD_NOT_REGISTERED, /* card present but not know in the system */
  122. CARD_WRONG_HASH, /* hash results in a non-valid flash-address */
  123. /*
  124. * System Errors.
  125. * These include programming errors but also:
  126. * errors that may (or may not..) be solved by a reboot (indicated by REBOOT)
  127. */
  128. PLAYER_SYSTEMERRORS = 500,
  129. PLAYER_NOTREADY, /* Player was not successfully initialised */
  130. SESSION_NODEVICE, /* Could not register devices */
  131. SESSION_NODHCP_NOEEPROM, /* No DHCP and no previous IP address. REBOOT */
  132. SESSION_MDMNOINIT, /* Could not initialise modem. REBOOT */
  133. SESSION_MDMNODISCONNECT, /* Modem is still connected. REBOOT */
  134. SESSION_PPPINIT, /* Could not initialise PPP */
  135. SESSION_PPPSTART, /* Could not start PPP (username/password incorrect?)
  136. Note that NutOs ALWAYS requires a REBOOT in this case! */
  137. SESSION_NOROUTEADD, /* Could not add route to routetable */
  138. CHANNEL_NOMEM, /* Not enough memory for channel */
  139. CHANNEL_CREATE_SOCKET, /* Failed to create a socket */
  140. CHANNEL_SOCK_RCVTO, /* Could not set socket option RCVTO */
  141. CHANNEL_CREATE_STREAM, /* Failed to create a stream */
  142. STREAM_NOTHREAD, /* Could not start streamer thread */
  143. STREAM_NOMEM, /* Not enough memory for streamer */
  144. STREAM_CREATE_SOCKET, /* Failed to create a socket */
  145. STREAM_CREATE_STREAM, /* Failed to create a stream */
  146. STREAM_SOCK_MSS, /* Could not set socket option MSS */
  147. STREAM_SOCK_RCVTO, /* Could not set socket option RCVTO */
  148. STREAM_SOCK_RXBUF, /* Could not set socket option RXBUF */
  149. UPDATE_WRONG_NROF_BYTES, /* nrof bytes not as specified in 'update.inf' */
  150. UPDATE_CODESIZE_OVERFLOW, /* codesize exceeds 126KB (note: 2KB needed for bootloader) */
  151. UPDATE_CRC_ERROR, /* CRC of downloaded code in RAM incorrect */
  152. UPDATE_NOT_ALLOWED, /* either ISP or bootloader prohibits Remote Update functionality */
  153. INET_NOMEM, /* Not enough memory */
  154. INET_CREATE_SOCKET, /* Failed to create a socket */
  155. INET_SOCK_MSS, /* Could not set socket option MSS */
  156. INET_SOCK_RCVTO, /* Could not set socket option RCVTO */
  157. INET_SOCK_RXBUF, /* Could not set socket option RXBUF */
  158. INET_CREATE_STREAM, /* Failed to create a stream */
  159. INET_SEND_FAIL, /* Failed to send data */
  160. STREAM_TOO_MANY_ERRORS, /* Seen too many errors */
  161. PLAYER_NO_THREAD, /* Could not start player thread */
  162. PLAYER_NO_SOURCE, /* No source to play audio from */
  163. } TError;
  164. /*--------------------------------------------------------------------------*/
  165. /* Global variables */
  166. /*--------------------------------------------------------------------------*/
  167. /*--------------------------------------------------------------------------*/
  168. /* Global functions */
  169. /*--------------------------------------------------------------------------*/
  170. #endif /* _Typedefs_H */