typedefs.h 9.6 KB

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