platform_esp32.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #include "bt_app_core.h"
  6. #include "perf_trace.h"
  7. #include "esp_pthread.h"
  8. #ifndef QUOTE
  9. #define QUOTE(name) #name
  10. #define STR(macro) QUOTE(macro)
  11. #endif
  12. extern void run_command(char * line);
  13. extern bool wait_for_wifi();
  14. //typedef struct {
  15. // char opt_slimproto_logging[11];
  16. // char opt_stream_logging[11];
  17. // char opt_decode_logging[11];
  18. // char opt_output_logging[11];
  19. // char opt_player_name[11];
  20. // char opt_output_rates[21];
  21. // char opt_buffer[11];
  22. //} str_squeezelite_options ;
  23. extern void console_start();
  24. extern pthread_cond_t wifi_connect_suspend_cond;
  25. extern pthread_t wifi_connect_suspend_mutex;
  26. //static const char * art_wifi[]={
  27. // "\n",
  28. // "o `O ooOoOOo OOooOoO ooOoOOo\n",
  29. // "O o O o O \n",
  30. // "o O o O o \n",
  31. // "O O O oOooO O \n",
  32. // "o o o o O o \n",
  33. // "O O O O o O \n",
  34. // "`o O o O' O o O \n",
  35. // " `OoO' `OoO' ooOOoOo O' ooOOoOo\n",
  36. // "\n",
  37. // ""
  38. //};
  39. //static const char * art_wifi_connecting[]={
  40. // " .oOOOo.",
  41. // ".O o o \n",
  42. // "o O \n",
  43. // "o oOo \n",
  44. // "o .oOo. 'OoOo. 'OoOo. .oOo. .oOo o O 'OoOo. .oOoO \n",
  45. // "O O o o O o O OooO' O O o o O o O \n",
  46. // "`o .o o O O o O o O o o O O o O o \n",
  47. // " `OoooO' `OoO' o O o O `OoO' `OoO' `oO o' o O `OoOo \n",
  48. // " O \n",
  49. // " OoO' \n",
  50. // "\n",
  51. // ""
  52. //};
  53. //static const char * art_wifi_connected[]={
  54. // " .oOOOo. o oO\n",
  55. // ".O o O OO\n",
  56. // "o O o oO\n",
  57. // "o oOo o Oo\n",
  58. // "o .oOo. 'OoOo. 'OoOo. .oOo. .oOo o .oOo. .oOoO oO\n",
  59. // "O O o o O o O OooO' O O OooO' o O \n",
  60. // "`o .o o O O o O o O o o O O o Oo\n",
  61. // " `OoooO' `OoO' o O o O `OoO' `OoO' `oO `OoO' `OoO'o oO\n",
  62. // "\n",
  63. // ""
  64. //};
  65. #define ESP_LOG_DEBUG_EVENT(tag,e) ESP_LOGD(tag,"evt: " e)
  66. typedef struct {
  67. char * optName;
  68. char * cmdLinePrefix;
  69. char * description;
  70. char * defaultValue;
  71. char * relatedcommand;
  72. } optListStruct;
  73. optListStruct * getOptionByName(char * option);
  74. //static optListStruct optList[] = {
  75. // {
  76. // .optName= "log_slimproto",
  77. // .cmdLinePrefix="-d slimproto=",
  78. // .description="Slimproto Logging Level info|debug|sdebug",
  79. // .defaultValue=(CONFIG_LOGGING_SLIMPROTO),
  80. // .relatedcommand="squeezelite"
  81. // },
  82. // {
  83. // .optName="log_stream",
  84. // .cmdLinePrefix="-d stream=",
  85. // .description="Stream Logging Level info|debug|sdebug",
  86. // .defaultValue=(CONFIG_LOGGING_STREAM),
  87. // .relatedcommand="squeezelite"
  88. // },
  89. // {
  90. // .optName="log_decode",
  91. // .cmdLinePrefix="-d decode=",
  92. // .description="Decode Logging Level info|debug|sdebug",
  93. // .defaultValue=(CONFIG_LOGGING_DECODE),
  94. // .relatedcommand="squeezelite"
  95. // },
  96. // {
  97. // .optName="log_output",
  98. // .cmdLinePrefix="-d output=",
  99. // .description="Output Logging Level info|debug|sdebug",
  100. // .defaultValue=(CONFIG_LOGGING_OUTPUT),
  101. // .relatedcommand="squeezelite"
  102. // },
  103. // {
  104. // .optName="output_rates",
  105. // .cmdLinePrefix="-r ",
  106. // .description="Supported rates",
  107. // .defaultValue=(CONFIG_OUTPUT_RATES),
  108. // .relatedcommand="squeezelite"
  109. // },
  110. // {
  111. // .optName="output_dev",
  112. // .cmdLinePrefix="-O",
  113. // .description="Output device to use. BT for Bluetooth, DAC for i2s DAC.",
  114. // .defaultValue=(CONFIG_A2DP_SINK_NAME),
  115. // .relatedcommand=""
  116. // },
  117. // {
  118. // .optName="a2dp_sink_name",
  119. // .cmdLinePrefix="",
  120. // .description="Bluetooth sink name to connect to.",
  121. // .defaultValue=(CONFIG_A2DP_SINK_NAME),
  122. // .relatedcommand=""
  123. // },
  124. // {
  125. // .optName="a2dp_dev_name",
  126. // .cmdLinePrefix="",
  127. // .description="A2DP Device name to use when connecting to audio sink.",
  128. // .defaultValue=(CONFIG_A2DP_DEV_NAME),
  129. // .relatedcommand=""
  130. // },
  131. // {
  132. // .optName="a2dp_cntrldelay",
  133. // .cmdLinePrefix="",
  134. // .description="Delay (ms) for each pass of the A2DP control loop.",
  135. // .defaultValue=STR(CONFIG_A2DP_CONTROL_DELAY_MS),
  136. // .relatedcommand=""
  137. // },
  138. // {
  139. // .optName="a2dp_timeout",
  140. // .cmdLinePrefix="",
  141. // .description="Delay (ms) for A2DP timeout on connect.",
  142. // .defaultValue=STR(CONFIG_A2DP_CONNECT_TIMEOUT_MS),
  143. // .relatedcommand=""
  144. // },
  145. // {
  146. // .optName="wifi_ssid",
  147. // .cmdLinePrefix="",
  148. // .description="WiFi access point name to connect to.",
  149. // .defaultValue= (CONFIG_WIFI_SSID),
  150. // .relatedcommand=""
  151. // },
  152. // {
  153. // .optName="wifi_password",
  154. // .cmdLinePrefix= "",
  155. // .description="WiFi access point password.",
  156. // .defaultValue=(CONFIG_WIFI_PASSWORD),
  157. // .relatedcommand=""
  158. // },
  159. // {}
  160. //};
  161. #ifdef __cplusplus
  162. }
  163. #endif