fix: improve field diagnostics and mirror logs to USB CDC
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
#ifndef BANBAN_FIELD_LOG_H
|
||||
#define BANBAN_FIELD_LOG_H
|
||||
/* Init once from the application startup task, before other app workers. */
|
||||
int field_log_init(void);
|
||||
int field_log_printf(const char *format, ...);
|
||||
#endif
|
||||
@@ -1,5 +1,7 @@
|
||||
#ifndef BANBAN_NET_DIAG_H
|
||||
#define BANBAN_NET_DIAG_H
|
||||
int net_diag_is_enabled(void);
|
||||
int net_diag_can_probe(void);
|
||||
void net_diag_start(void);
|
||||
void net_diag_event(const char *event, int code);
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
#ifndef BANBAN_NET_DIAG_PROBE_H
|
||||
#define BANBAN_NET_DIAG_PROBE_H
|
||||
/* Transport failures are distinct from local setup/resource failures. */
|
||||
enum { PROBE_OK, PROBE_DNS, PROBE_LOCAL, PROBE_CONNECT, PROBE_TIMEOUT, PROBE_CANCELLED };
|
||||
typedef struct {
|
||||
int outcome, error, dns_result, tcp_started;
|
||||
unsigned long dns_ms, tcp_ms;
|
||||
char address[48];
|
||||
} net_probe_result;
|
||||
void net_diag_probe(const char *host, unsigned short port, net_probe_result *result);
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifndef BANBAN_NET_DIAG_VOICE_H
|
||||
#define BANBAN_NET_DIAG_VOICE_H
|
||||
enum {
|
||||
VOICE_SPEECH, VOICE_RECORD_STOP, VOICE_END_QUEUED, VOICE_END_ACK,
|
||||
VOICE_TTS_START, VOICE_FIRST_URL, VOICE_DOWNLOAD_BEGIN,
|
||||
VOICE_DOWNLOAD_DONE, VOICE_FIRST_PCM, VOICE_STAGE_COUNT
|
||||
};
|
||||
void net_diag_voice_begin(unsigned int round);
|
||||
/* round=0 means the currently recording round (for the VAD task). */
|
||||
void net_diag_voice_mark(unsigned int round, int stage);
|
||||
void net_diag_voice_url(unsigned int round, const char *url);
|
||||
unsigned int net_diag_audio_begin(const char *url);
|
||||
void net_diag_audio_done(unsigned int round, int bytes, int result);
|
||||
void net_diag_vad_stats(unsigned int frames, unsigned int speech, unsigned int peak);
|
||||
#endif
|
||||
Reference in New Issue
Block a user