typedefs.h 10 KB

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