Skip to content

Commit c340f85

Browse files
authored
Merge pull request #836 from david-cermak/fix/modem_urc
[modem]: Fix URC handler processing
2 parents 7cddc8c + b95d8be commit c340f85

File tree

16 files changed

+801
-12
lines changed

16 files changed

+801
-12
lines changed

.github/workflows/modem__build-host-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
strategy:
4646
matrix:
4747
idf_ver: ["release-v5.0", "release-v5.1", "release-v5.2", "release-v5.3", "release-v5.4", "latest"]
48-
test: ["target", "target_ota", "target_iperf"]
48+
test: ["target", "target_ota", "target_iperf", "target_urc"]
4949

5050
runs-on: ubuntu-22.04
5151
container: espressif/idf:${{ matrix.idf_ver }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "modem_sim: build-tests"
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened, labeled]
9+
10+
jobs:
11+
build_modem_sim:
12+
if: contains(github.event.pull_request.labels.*.name, 'modem_sim') || github.event_name == 'push'
13+
name: Build
14+
strategy:
15+
matrix:
16+
idf_ver: ["release-v5.4"]
17+
runs-on: ubuntu-22.04
18+
container: espressif/idf:${{ matrix.idf_ver }}
19+
steps:
20+
- name: Checkout esp-protocols
21+
uses: actions/checkout@v3
22+
- name: Build ESP-AT with IDF-${{ matrix.idf_ver }}
23+
shell: bash
24+
run: |
25+
cd common_components/modem_sim
26+
./install.sh
27+
source export.sh
28+
idf.py build

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,9 @@ docs/html
9494

9595
# esp-idf managed components
9696
**/managed_components/**
97+
98+
# modem simulator uses esp-at clone
99+
common_components/modem_sim/modem_sim_esp32/
100+
101+
# repository release tools
102+
release_notes.txt

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ repos:
6161
- repo: local
6262
hooks:
6363
- id: commit message scopes
64-
name: "commit message must be scoped with: mdns, dns, modem, websocket, asio, mqtt_cxx, console, common, eppp, tls_cxx, mosq, sockutls, lws"
65-
entry: '\A(?!(feat|fix|ci|bump|test|docs|chore)\((mdns|dns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|tls_cxx|mosq|sockutls|lws)\)\:)'
64+
name: "commit message must be scoped with: mdns, dns, modem, websocket, asio, mqtt_cxx, console, common, eppp, tls_cxx, mosq, sockutls, lws, modem_sim"
65+
entry: '\A(?!(feat|fix|ci|bump|test|docs|chore)\((mdns|dns|modem|common|console|websocket|asio|mqtt_cxx|examples|eppp|tls_cxx|mosq|sockutls|lws|modem_sim)\)\:)'
6666
language: pygrep
6767
args: [--multiline]
6868
stages: [commit-msg]

common_components/modem_sim/export.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
source $IDF_PATH/export.sh
4+
5+
export AT_CUSTOM_COMPONENTS="`pwd`/pppd_cmd"
6+
7+
cd modem_sim_esp32/esp-at
8+
9+
python -m pip install -r requirements.txt
10+
11+
python build.py reconfigure
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Create directory "modem_sim_esp32", go inside it
5+
# Usage: ./install.sh [platform] [module]
6+
7+
SCRIPT_DIR=$(pwd)
8+
mkdir -p modem_sim_esp32
9+
cd modem_sim_esp32
10+
11+
if [ -z "$IDF_PATH" ]; then
12+
echo "Error: IDF_PATH environment variable is not set"
13+
exit 1
14+
fi
15+
16+
# Default ESP_AT_VERSION uses this specific commit from master to support new chips and features
17+
ESP_AT_VERSION="aa9d7e0e9b741744f7bf5bec3bbf887cff033d5f"
18+
19+
# Shallow clone of esp-at.git at $ESP_AT_VERSION
20+
if [ ! -d "esp-at" ]; then
21+
# cannot shallow clone from a specific commit, so we init, shallow fetch, and checkout
22+
mkdir -p esp-at && cd esp-at && git init && git remote add origin https://github.com/espressif/esp-at.git
23+
git fetch --depth 1 origin $ESP_AT_VERSION && git checkout $ESP_AT_VERSION
24+
else
25+
echo "esp-at directory already exists, skipping clone."
26+
cd esp-at
27+
fi
28+
29+
# Add esp-idf directory which is a symlink to the $IDF_PATH
30+
if [ ! -L "esp-idf" ]; then
31+
ln -sf "$IDF_PATH" esp-idf
32+
else
33+
echo "esp-idf symlink already exists, skipping."
34+
fi
35+
36+
# Create "build" directory
37+
mkdir -p build
38+
39+
# Default values for platform and module
40+
platform="PLATFORM_ESP32"
41+
module="WROOM-32"
42+
43+
# Override defaults if parameters are provided
44+
if [ ! -z "$1" ]; then
45+
platform="$1"
46+
fi
47+
if [ ! -z "$2" ]; then
48+
module="$2"
49+
fi
50+
51+
# Create file "build/module_info.json" with content
52+
cat > build/module_info.json << EOF
53+
{
54+
"platform": "$platform",
55+
"module": "$module",
56+
"description": "4MB, Wi-Fi + BLE, OTA, TX:17 RX:16",
57+
"silence": 0
58+
}
59+
EOF
60+
61+
cp "$SCRIPT_DIR/sdkconfig.defaults" "module_config/module_esp32_default/sdkconfig.defaults"
62+
63+
echo "Installation completed successfully!"
64+
echo "Created modem_sim_esp32 directory with esp-at repository and configuration"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
idf_component_register(
2+
SRCS additional_commands.c
3+
INCLUDE_DIRS include
4+
REQUIRES at freertos nvs_flash)
5+
6+
idf_component_set_property(${COMPONENT_NAME} WHOLE_ARCHIVE TRUE)

0 commit comments

Comments
 (0)