2 次代碼提交 e5615679ab ... 67e52cda42

作者 SHA1 備註 提交日期
  Joey 67e52cda42 Merge branch 'main' of https://repo.tochtech.com/smarttalk/2_way_Tochie 9 小時之前
  Joey 8269ea80a4 RTP clear audio implemented from ESP32 9 小時之前
共有 9 個文件被更改,包括 1393 次插入161 次删除
  1. 37 0
      .gitignore
  2. 17 29
      dependencies.lock
  3. 5 4
      main/CMakeLists.txt
  4. 236 47
      main/hardeware_driver/bsp_board.c
  5. 8 0
      main/hardeware_driver/bsp_board.h
  6. 1 1
      main/idf_component.yml
  7. 33 80
      main/main.c
  8. 1030 0
      main/sip/sip.c
  9. 26 0
      main/sip/sip.h

+ 37 - 0
.gitignore

@@ -0,0 +1,37 @@
+# PlatformIO build and dependency state
+.pio/
+.pioenvs/
+.piolibdeps/
+libdeps/
+
+# PlatformIO / editor-generated configuration
+.vscode/*
+!.vscode/extensions.json
+.idea/
+.clangd/
+
+# ESP-IDF generated configuration and managed component sources
+sdkconfig
+sdkconfig.old
+sdkconfig.*
+!sdkconfig.defaults
+!sdkconfig.defaults.*
+managed_components/
+components/
+compile_commands.json
+
+# Generated firmware and linker artifacts
+*.bin
+*.elf
+*.map
+
+# Local tooling, caches, and packaged deliverables
+work/
+outputs/
+.cache/
+__pycache__/
+*.py[cod]
+
+# Host operating-system files
+.DS_Store
+Thumbs.db

+ 17 - 29
dependencies.lock

@@ -6,19 +6,19 @@ dependencies:
       require: private
       version: '>=5.0'
     source:
-      registry_url: https://components.espressif.com
+      registry_url: https://components.espressif.com/
       type: service
     version: 1.7.19~2
   espressif/dl_fft:
-    component_hash: ced3cf28cc70452b7859c06f4e5059215167254a2047e34c893d6f501ccd6ea2
+    component_hash: a955ca29581de2177ddf25759273bd83f082b3c805e735fe6ee105858643989b
     dependencies:
     - name: idf
       require: private
       version: '>=5.0'
     source:
-      registry_url: https://components.espressif.com
+      registry_url: https://components.espressif.com/
       type: service
-    version: 0.4.0
+    version: 0.6.0
   espressif/esp-dsp:
     component_hash: 12e44db246517a627bc0fe2b255b8335410c0215c98bfba2df5a8e3edea839ef
     dependencies:
@@ -26,33 +26,17 @@ dependencies:
       require: private
       version: '>=4.2'
     source:
-      registry_url: https://components.espressif.com
+      registry_url: https://components.espressif.com/
       type: service
     version: 1.8.0
   espressif/esp-sr:
-    component_hash: aa58d6a13a49600314a50a27240ccbd17e407f608216a3086d4868e0da2e8053
-    dependencies:
-    - name: espressif/cjson
-      registry_url: https://components.espressif.com
-      require: private
-      version: ^1.7.19
-    - name: espressif/dl_fft
-      registry_url: https://components.espressif.com
-      require: private
-      version: '>=0.2.0'
-    - name: espressif/esp-dsp
-      registry_url: https://components.espressif.com
-      require: private
-      version: 1.8.0
-    - name: idf
-      require: private
-      version: '>=5.0'
+    dependencies: []
     source:
-      registry_url: https://components.espressif.com/
-      type: service
+      path: C:\Users\doop3\OneDrive\Documents\espidfprojects\SIP_test2_1\SIP_test2\components\espressif__esp-sr
+      type: local
     version: 2.4.6
   espressif/esp_codec_dev:
-    component_hash: 896c67360ae1f8dedaf8a53dfe48c015317fa455f061a5165307892296990028
+    component_hash: 8a58569aed3c6e8d858da5419eba4d54ee905d7709cdbe01c42101c1ed0c5319
     dependencies:
     - name: idf
       require: private
@@ -60,7 +44,7 @@ dependencies:
     source:
       registry_url: https://components.espressif.com/
       type: service
-    version: 1.5.10
+    version: 1.6.1
   espressif/esp_io_expander:
     component_hash: 7b7f91270172e46ca4597e3874f48d8412e280e8c295559f5922ec38656e3e5f
     dependencies:
@@ -98,12 +82,16 @@ dependencies:
   idf:
     source:
       type: idf
-    version: 6.0.1
+    version: 5.3.5
 direct_dependencies:
+- espressif/cjson
+- espressif/dl_fft
+- espressif/esp-dsp
 - espressif/esp-sr
 - espressif/esp_codec_dev
 - espressif/esp_io_expander_tca95xx_16bit
 - espressif/led_strip
-manifest_hash: cc6725c3be0ea7fd83b3ab5f9e00bbc374e48bbe22994003311ddb44aa92bcbe
+- idf
+manifest_hash: 2e8c992a35dd97ed7aa093a6dede2214b63671f1dbf36fba70a42539f89df49a
 target: esp32s3
-version: 3.0.0
+version: 2.0.0

+ 5 - 4
main/CMakeLists.txt

@@ -1,9 +1,9 @@
-# 初始化源文件和包含目录
+
 set(SOURCES
     "./main.c" 
     "./hardeware_driver/bsp_board.c"
     "./tca9555_driver/tca9555_driver.c"
-    "./LED_Control/LED.c"
+    "./sip/sip.c"
 
 )
 
@@ -11,12 +11,13 @@ set(INCLUDE_DIRS
     "."
     "./hardeware_driver"
     "./tca9555_driver"
-    "./LED_Control"
+    "./sip"
 )
 
 
-# 注册组件
 idf_component_register(
     SRCS ${SOURCES}
     INCLUDE_DIRS ${INCLUDE_DIRS}
+    REQUIRES mbedtls esp_driver_gpio esp_driver_i2s openthread
+    PRIV_REQUIRES esp_wifi fatfs nvs_flash
 )

+ 236 - 47
main/hardeware_driver/bsp_board.c

@@ -4,6 +4,7 @@
 #include "esp_err.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/semphr.h"
+#include "freertos/task.h"
 #include "string.h"
 #include "driver/gpio.h"
 #include "esp_err.h"
@@ -28,7 +29,8 @@
 #endif /* ((SOC_SDMMC_HOST_SUPPORTED) && (FUNC_SDMMC_EN)) */
 
 
-#define ADC_I2S_CHANNEL 4
+#define ADC_I2S_CHANNEL 2
+#define ADC_BITS_PER_SAMPLE 32
 
 static sdmmc_card_t *card;
 static const char *TAG = "board";
@@ -52,6 +54,7 @@ static audio_codec_if_t *play_codec_if        = NULL;
 static esp_codec_dev_handle_t play_dev        = NULL;
 static i2c_master_bus_handle_t i2c_bus_handle = NULL;
 static uint32_t SDCard_Size  = 0;
+static bool s_volume_buttons_task_started = false;
 
 int mic_level = 0;
 esp_codec_dev_handle_t esp_ret_play_dev(void)
@@ -85,10 +88,9 @@ static esp_err_t i2c_master_init(void)
 
 
 esp_err_t bsp_codec_adc_init(int sample_rate)
-{
+{    ESP_LOGI(TAG,"ADC INIT START");
     esp_err_t ret_val = ESP_OK;
 
-    // Do initialize of related interface: data_if, ctrl_if and gpio_if
     audio_codec_i2s_cfg_t i2s_cfg = {
         .port = I2S_NUM_1,
 #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
@@ -96,35 +98,86 @@ esp_err_t bsp_codec_adc_init(int sample_rate)
         .tx_handle = NULL,
 #endif
     };
+
     record_data_if = audio_codec_new_i2s_data(&i2s_cfg);
 
-    audio_codec_i2c_cfg_t i2c_cfg = {.addr = ES7210_CODEC_DEFAULT_ADDR,.bus_handle = i2c_bus_handle};
+    if(record_data_if == NULL)
+{
+    ESP_LOGE(TAG,"record_data_if creation failed");
+    return ESP_FAIL;
+}
+
+
+    audio_codec_i2c_cfg_t i2c_cfg = {
+        .addr = ES7210_CODEC_DEFAULT_ADDR,
+        .bus_handle = i2c_bus_handle
+    };
+
+
     record_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg);
-    // New input codec interface
+
+
     es7210_codec_cfg_t es7210_cfg = {
         .ctrl_if = record_ctrl_if,
-        .mic_selected = ES7210_SEL_MIC1 | ES7210_SEL_MIC2 | ES7210_SEL_MIC3 | ES7210_SEL_MIC4,
-    };  
+        .mic_selected =
+            ES7210_SEL_MIC1 |
+            ES7210_SEL_MIC2 |
+            ES7210_SEL_MIC3 |
+            ES7210_SEL_MIC4,
+    };
+
+
     record_codec_if = es7210_codec_new(&es7210_cfg);
-    // New input codec device
+
+    ESP_LOGI(TAG,"ES7210 IF=%p", record_codec_if);
+
+
     esp_codec_dev_cfg_t dev_cfg = {
         .codec_if = record_codec_if,
         .data_if = record_data_if,
         .dev_type = ESP_CODEC_DEV_TYPE_IN,
     };
+
+
     record_dev = esp_codec_dev_new(&dev_cfg);
 
+
+    if(record_dev == NULL)
+    {
+        ESP_LOGE(TAG,"Failed creating ADC codec");
+        return ESP_FAIL;
+    }
+
+
     esp_codec_dev_sample_info_t fs = {
-        .sample_rate = 16000,
+        .sample_rate = sample_rate,
         .channel = 2,
-        .bits_per_sample = 32,
+        .bits_per_sample = 16,
     };
-    esp_codec_dev_open(record_dev, &fs);
-    // esp_codec_dev_set_in_gain(record_dev, RECORD_VOLUME);
-    esp_codec_dev_set_in_channel_gain(record_dev, ESP_CODEC_DEV_MAKE_CHANNEL_MASK(0), RECORD_VOLUME);
-    esp_codec_dev_set_in_channel_gain(record_dev, ESP_CODEC_DEV_MAKE_CHANNEL_MASK(1), RECORD_VOLUME);
-    esp_codec_dev_set_in_channel_gain(record_dev, ESP_CODEC_DEV_MAKE_CHANNEL_MASK(2), RECORD_VOLUME);
-    esp_codec_dev_set_in_channel_gain(record_dev, ESP_CODEC_DEV_MAKE_CHANNEL_MASK(3), RECORD_VOLUME);
+
+
+    ret_val = esp_codec_dev_open(record_dev, &fs);
+
+
+    if(ret_val != ESP_OK)
+    {
+        ESP_LOGE(TAG,
+                 "Codec open failed %s",
+                 esp_err_to_name(ret_val));
+        return ret_val;
+    }
+
+
+    esp_codec_dev_set_in_channel_gain(
+        record_dev,
+        ESP_CODEC_DEV_MAKE_CHANNEL_MASK(0),
+        RECORD_VOLUME);
+
+    esp_codec_dev_set_in_channel_gain(
+        record_dev,
+        ESP_CODEC_DEV_MAKE_CHANNEL_MASK(1),
+        RECORD_VOLUME);
+
 
     return ret_val;
 }
@@ -346,14 +399,39 @@ static esp_err_t bsp_i2s_deinit(int i2s_num)
     return ret_val;
 }
 
-static esp_err_t bsp_codec_init(int adc_sample_rate, int dac_sample_rate, int dac_channel_format, int dac_bits_per_chan)
+static esp_err_t bsp_codec_init(
+        int adc_sample_rate,
+        int dac_sample_rate,
+        int dac_channel_format,
+        int dac_bits_per_chan)
 {
-    esp_err_t ret_val = ESP_OK;
+    //ESP_LOGE(TAG, "bsp_codec_adc_init START");
+    esp_err_t ret;
 
-    ret_val |= bsp_codec_adc_init(adc_sample_rate);
-    ret_val |= bsp_codec_dac_init(dac_sample_rate, dac_channel_format, dac_bits_per_chan);
+    ret = bsp_codec_adc_init(adc_sample_rate);
 
-    return ret_val;
+    if(ret != ESP_OK)
+    {
+        ESP_LOGE(TAG,"ADC init failed: %s",
+                 esp_err_to_name(ret));
+        return ret;
+    }
+
+
+    ret = bsp_codec_dac_init(
+            dac_sample_rate,
+            dac_channel_format,
+            dac_bits_per_chan);
+
+
+    if(ret != ESP_OK)
+    {
+        ESP_LOGE(TAG,"DAC init failed: %s",
+                 esp_err_to_name(ret));
+    }
+
+
+    return ret;
 }
 
 static esp_err_t bsp_codec_deinit()
@@ -426,36 +504,64 @@ int get_mic_level (void) {
 
     return mic_level;
 }
-esp_err_t esp_get_feed_data(bool is_get_raw_channel, int16_t *buffer, int buffer_len)
-{   
-    
+esp_err_t esp_get_feed_data(
+        bool is_get_raw_channel,
+        int16_t *buffer,
+        int buffer_len)
+{
 
-    esp_err_t ret = ESP_OK;
-    size_t bytes_read;
-    int audio_chunksize = buffer_len / (sizeof(int16_t) * ADC_I2S_CHANNEL);
+    ESP_LOGE(TAG, "NEW esp_get_feed_data CALLED");
 
-    ret = esp_codec_dev_read(record_dev, (void *)buffer, buffer_len);
-    
-    int64_t sum = 0;
-    for(int i = 0; i < buffer_len/sizeof(int16_t); i++) {
-        sum += abs(buffer[i]);
-        
+    if(record_dev == NULL)
+    {
+        ESP_LOGE(TAG,"record_dev NULL");
+        return ESP_ERR_INVALID_STATE;
+    }
+
+
+    ESP_LOGI(TAG,
+             "read buffer=%p size=%d",
+             buffer,
+             buffer_len);
+
+
+    esp_err_t ret;
+
+    ret = esp_codec_dev_read(
+            record_dev,
+            buffer,
+            buffer_len);
 
+
+    ESP_LOGI(TAG,
+             "codec read ret=%s",
+             esp_err_to_name(ret));
+
+
+    if(ret != ESP_OK)
+    {
+        return ret;
     }
-    ESP_LOGI("MIC", "Level=%lld", sum/(buffer_len/sizeof(int16_t)));
-    mic_level = sum/(buffer_len/sizeof(int16_t));
 
-    if (!is_get_raw_channel) {
-        for (int i = 0; i < audio_chunksize; i++) {
-            int16_t ref = buffer[4 * i + 0];
-            buffer[3 * i + 0] = buffer[4 * i + 1];
-            buffer[3 * i + 1] = buffer[4 * i + 3];
-            buffer[3 * i + 2] = ref;
-        }
+
+    // Check microphone data
+    int64_t sum = 0;
+
+    for(int i=0;i<buffer_len/sizeof(int16_t);i++)
+    {
+        sum += abs(buffer[i]);
     }
-    return ret;
+
+
+    ESP_LOGI(TAG,
+             "MIC level=%lld",
+             sum/(buffer_len/sizeof(int16_t)));
+
+
+    return ESP_OK;
 }
 
+
 int esp_get_feed_channel(void)
 {
     return ADC_I2S_CHANNEL;
@@ -463,12 +569,77 @@ int esp_get_feed_channel(void)
 
 char* esp_get_input_format(void)
 {
-    return "RMNM";
+    return "RM";
 }
 
+static void bsp_volume_buttons_task(void *arg)
+{
+    int last_key1 = 1;
+    int last_key3 = 1;
+
+    while (1) {
+        int key1 = gpio_get_level(GPIO_KEY1_PIN);
+        int key3 = gpio_get_level(GPIO_KEY3_PIN);
+
+        if (key1 == 0 && last_key1 != 0) {
+            int current_vol = 0;
+            if (esp_audio_get_play_vol(&current_vol) == ESP_OK) {
+                current_vol += VOLUME_STEP;
+                if (current_vol > VOLUME_MAX_LEVEL) {
+                    current_vol = VOLUME_MAX_LEVEL;
+                }
+                if (esp_audio_set_play_vol(current_vol) == ESP_OK) {
+                    ESP_LOGI(TAG, "Volume up -> %d", current_vol);
+                }
+            }
+        }
 
+        if (key3 == 0 && last_key3 != 0) {
+            int current_vol = 0;
+            if (esp_audio_get_play_vol(&current_vol) == ESP_OK) {
+                current_vol -= VOLUME_STEP;
+                if (current_vol < VOLUME_MIN_LEVEL) {
+                    current_vol = VOLUME_MIN_LEVEL;
+                }
+                if (esp_audio_set_play_vol(current_vol) == ESP_OK) {
+                    ESP_LOGI(TAG, "Volume down -> %d", current_vol);
+                }
+            }
+        }
+
+        last_key1 = key1;
+        last_key3 = key3;
+        vTaskDelay(pdMS_TO_TICKS(VOLUME_BUTTON_POLL_MS));
+    }
+}
+
+static esp_err_t bsp_volume_buttons_init(void)
+{
+    if (s_volume_buttons_task_started) {
+        return ESP_OK;
+    }
+
+    gpio_config_t io_conf = {
+        .pin_bit_mask = (1ULL << GPIO_KEY1_PIN) | (1ULL << GPIO_KEY3_PIN),
+        .mode = GPIO_MODE_INPUT,
+        .pull_up_en = GPIO_PULLUP_ENABLE,
+        .pull_down_en = GPIO_PULLDOWN_DISABLE,
+        .intr_type = GPIO_INTR_DISABLE,
+    };
+
+    esp_err_t ret = gpio_config(&io_conf);
+    if (ret != ESP_OK) {
+        return ret;
+    }
 
+    BaseType_t task_created = xTaskCreate(bsp_volume_buttons_task, "vol_btns", 4096, NULL, 5, NULL);
+    if (task_created != pdPASS) {
+        return ESP_FAIL;
+    }
 
+    s_volume_buttons_task_started = true;
+    return ESP_OK;
+}
 
 esp_err_t esp_board_init(uint32_t sample_rate, int channel_format, int bits_per_chan)
 {
@@ -489,10 +660,22 @@ esp_err_t esp_board_init(uint32_t sample_rate, int channel_format, int bits_per_
     }
     s_bits_per_chan = bits_per_chan;
 
-    bsp_i2s_init(I2S_NUM_1, 16000, 2, 32);
+    bsp_i2s_init(I2S_NUM_1, 16000, 2, 16);
     // Because record and play use the same i2s.
-    bsp_codec_init(16000, 16000, 2, 32);
+esp_err_t codec_ret;
 
+codec_ret = bsp_codec_init(16000,16000,2,16);
+
+if(codec_ret != ESP_OK)
+{
+    ESP_LOGE(TAG,
+             "bsp_codec_init failed: %s",
+             esp_err_to_name(codec_ret));
+}
+else
+{
+    ESP_LOGI(TAG,"bsp_codec_init OK");
+}
     /* Initialize PA */
      /*gpio_config_t  io_conf;
      memset(&io_conf, 0, sizeof(io_conf));
@@ -504,6 +687,12 @@ esp_err_t esp_board_init(uint32_t sample_rate, int channel_format, int bits_per_
      gpio_config(&io_conf);
      */
     gpio_set_level(GPIO_PWR_CTRL, 1);
+
+    esp_err_t button_ret = bsp_volume_buttons_init();
+    if (button_ret != ESP_OK) {
+        ESP_LOGW(TAG, "Failed to initialize volume buttons: %s", esp_err_to_name(button_ret));
+    }
+
     return ESP_OK;
 }
 
@@ -693,4 +882,4 @@ uint16_t Folder_retrieval(const char* directory, const char* fileExtension, char
     }
 
     return fileCount; 
-}
+}

+ 8 - 0
main/hardeware_driver/bsp_board.h

@@ -98,6 +98,14 @@ extern "C" {
 #define GPIO_PWR_CTRL       (-1)
 #define GPIO_PWR_ON_LEVEL   (1)
 
+/* Waveshare ESP32-S3 audio board button mapping */
+#define GPIO_KEY1_PIN       (GPIO_NUM_0)
+#define GPIO_KEY3_PIN       (GPIO_NUM_18)
+#define VOLUME_BUTTON_POLL_MS (50)
+#define VOLUME_STEP         (2)
+#define VOLUME_MIN_LEVEL    (0)
+#define VOLUME_MAX_LEVEL    (100)
+
 #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
 
 #define I2S_CONFIG_DEFAULT(sample_rate, channel_fmt, bits_per_chan) { \

+ 1 - 1
main/idf_component.yml

@@ -2,4 +2,4 @@ dependencies:
   espressif/esp-sr: ^2.1.5
   espressif/esp_io_expander_tca95xx_16bit: ^2.0.1
   espressif/esp_codec_dev: ^1.5.1
-  espressif/led_strip: ^3.0.3
+  espressif/led_strip: ^3.0.3

+ 33 - 80
main/main.c

@@ -1,101 +1,54 @@
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
+
+#include "esp_wifi.h"
+#include "esp_event.h"
 #include "esp_log.h"
-#include "esp_err.h"
-#include "esp_timer.h"
+#include "nvs_flash.h"
 
-#include "bsp_board.h"
-#include "tca9555_driver.h"
+#include "lwip/sockets.h"
 
-#include "LED.h"
-#define SAMPLE_RATE 16000
-#define DELAY_SECONDS 1
+#include <stdbool.h>
+#include "esp_rom_md5.h"
+#include "sip/sip.h"
 
-#define DELAY_SAMPLES (SAMPLE_RATE * DELAY_SECONDS)
-static int16_t mono[256];
-static int16_t stereo[512];
+#include "bsp_board.h"
 
-static int16_t delay_buffer[DELAY_SAMPLES];
-static uint32_t write_idx = 0;
-static uint32_t read_idx = DELAY_SAMPLES/2;
+static const char *TAG = "APP";
 
-static void mic_task(void *arg)
+void app_main(void)
 {
-    int16_t buffer[1024];
-
-    while(1)
-    {
-        esp_get_feed_data(true, buffer, sizeof(buffer));
-        int level = get_mic_level();
-
-        for(int i = 0; i < 256; i++)
-        {
-            mono[i] = buffer[i*4+3];
-        }
+    ESP_LOGI(TAG, "Starting SIP client...");
 
-        for(int i = 0; i < 256; i++) {
-            delay_buffer[write_idx] = mono[i];
-            write_idx++;
-            if(write_idx >= DELAY_SAMPLES)
-                write_idx = 0;
-        }
+    esp_err_t ret;
 
-        static int16_t delayed_mono[256];
-        for(int i = 0; i < 256; i++) {
-            delayed_mono[i] = delay_buffer[read_idx];
-            read_idx++;
-            if(read_idx >= DELAY_SAMPLES)
-                read_idx = 0;
-        }
+    ret = esp_board_init(16000, 2, 32);
 
-        for(int i = 0; i < 256; i++)
-        {
-            stereo[i*2] = delayed_mono[i];
-            stereo[i*2+1] = delayed_mono[i];
-        }
-
-        esp_audio_play(
-            stereo,
-            sizeof(stereo),
-            portMAX_DELAY
-        );
+    if(ret != ESP_OK)
+    {
+        ESP_LOGE(TAG,
+                 "Audio board init failed: %s",
+                 esp_err_to_name(ret));
+        return;
+    }
 
 
-        if(level > 70)
-        {
-            led_strip_set_pixel(
-                led_strip,
-                0,
-                5,
-                5,
-                5
-            );
+    wifi_init();
 
-            led_strip_refresh(led_strip);
-        }
-        else
-        {
-            led_strip_clear(led_strip);
-        }
+    while (!wifi_ready) {
+        vTaskDelay(pdMS_TO_TICKS(500));
     }
-}
 
-void app_main()
-{
-    ESP_ERROR_CHECK(esp_board_init(16000, 2, 16));
-    gpio_set_level(GPIO_PWR_CTRL, 1);
-    esp_audio_set_play_vol(60);
-    tca9555_driver_init();
-    led_strip = configure_led();
 
     xTaskCreate(
-        mic_task,
-        "mic_task",
-        8192,
+        sip_register_task,
+        "sip_register",
+        24576,
         NULL,
         5,
-        NULL
-    );
-}
-
-
+        NULL);
+}

File diff suppressed because it is too large
+ 1030 - 0
main/sip/sip.c


+ 26 - 0
main/sip/sip.h

@@ -0,0 +1,26 @@
+#ifndef SIP_H
+#define SIP_H
+
+#include <stdbool.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern volatile bool wifi_ready;
+
+void wifi_init(void);
+void sip_compute_response(const char *username,
+                          const char *realm,
+                          const char *password,
+                          const char *nonce,
+                          const char *uri,
+                          char *out_response);
+void sip_register_task(void *pvParameters);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* SIP_H */