Skip to content

Commit ae05029

Browse files
committed
Merge branch 'main' into remote_ctrl
2 parents b20f4fe + 1590306 commit ae05029

File tree

8 files changed

+7
-2
lines changed

8 files changed

+7
-2
lines changed

components/vb6824/libs/libesp32.a

124 KB
Binary file not shown.

components/vb6824/libs/libesp32c2.a

1.48 KB
Binary file not shown.

components/vb6824/libs/libesp32c3.a

1.48 KB
Binary file not shown.

components/vb6824/libs/libesp32s3.a

1.66 KB
Binary file not shown.

components/vb6824/vb6824.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,10 @@ bool vb6824_is_support_ota(){
623623
void vb6824_init(gpio_num_t tx, gpio_num_t rx){
624624
__uart_init(tx, rx);
625625

626+
#if defined(CONFIG_VB6824_OTA_SUPPORT) && CONFIG_VB6824_OTA_SUPPORT == 1
627+
jl_set_uart_port(UART_NUM);
628+
#endif
629+
626630
#if defined(CONFIG_VB6824_TYPE_OPUS_16K_20MS)
627631
g_rx_ringbuffer = xRingbufferCreate(RECV_BUF_LENGTH, RINGBUF_TYPE_NOSPLIT);
628632
g_tx_ringbuffer = xRingbufferCreate(SEND_BUF_LENGTH, RINGBUF_TYPE_NOSPLIT);

components/vb6824/vb_ota.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void jl_ondata(uint8_t *buf, uint16_t len);
3131
int jl_set_ota_url(const char* url);
3232
int jl_ota_start(jl_ota_event_t evt_cb);
3333
int jl_ota_set_code(char *code);
34+
void jl_set_uart_port(uint8_t port);
3435

3536

3637
#ifdef __cplusplus

main/assets/en-US/start_ota.p3

3.29 KB
Binary file not shown.

main/audio_codecs/vb6824_audio_codec.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ std::string VbAduioCodec::GenDevCode() {
6464
mbedtls_md5(reinterpret_cast<const unsigned char*>(mac.c_str()), mac.size(), md5_result);
6565
uint16_t value = (((md5_result[14]) << 8) | md5_result[15]) & 0xFFFF;
6666
std::ostringstream oss;
67-
oss << value % 10000;
67+
oss << std::setw(4) << std::setfill('0') << (value % 10000);
6868
last_four_digits = oss.str();
6969
ESP_LOGW(TAG, "last_four_digits: %s", last_four_digits.c_str());
7070
}
@@ -113,11 +113,11 @@ int VbAduioCodec::OtaStart(uint8_t mode) {
113113
bool VbAduioCodec::InOtaMode(bool reShowIfInOta) {
114114
#if defined(CONFIG_VB6824_OTA_SUPPORT) && CONFIG_VB6824_OTA_SUPPORT == 1
115115
auto &app = Application::GetInstance();
116-
std::string code = GenDevCode();
117116
const std::string ip = WifiStation::GetInstance().GetIpAddress();
118117
if (jl_ws_is_start() == 1) {
119118
if (reShowIfInOta)
120119
{
120+
std::string code = GenDevCode();
121121
app.ShowOtaInfo(code, ip);
122122
}
123123
return true;

0 commit comments

Comments
 (0)