Merge branch 'master' of github.com:cesanta/mongoose
@@ -159,6 +159,21 @@ jobs:
|
||||
- if: ${{ env.GO == 1 }}
|
||||
run: make -C examples/stm32/nucleo-h743zi-baremetal test VCON_API_KEY=${{secrets.VCON_API_KEY}}
|
||||
|
||||
test_tm4c:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with: { fetch-depth: 2 }
|
||||
- run: if ./test/match_changed_files.sh "^src|examples/ti/ek-tm4c" ; then echo GO=1 >> $GITHUB_ENV ; fi
|
||||
- if: ${{ env.GO == 1 }}
|
||||
run: sudo apt -y update; sudo apt -y install gcc-arm-none-eabi
|
||||
- run: echo GO=0 > $GITHUB_ENV ; if ./test/match_changed_files.sh "^src|examples/ti/ek-tm4c1294xl-baremetal" ; then echo GO=1 > $GITHUB_ENV ; fi
|
||||
- if: ${{ env.GO == 1 }}
|
||||
run: make -C examples/ti/ek-tm4c1294xl-baremetal test VCON_API_KEY=${{secrets.VCON_API_KEY}}
|
||||
- run: echo GO=0 > $GITHUB_ENV ; if ./test/match_changed_files.sh "^src|examples/ti/ek-tm4c1294xl-freertos" ; then echo GO=1 > $GITHUB_ENV ; fi
|
||||
- if: ${{ env.GO == 1 }}
|
||||
run: make -C examples/ti/ek-tm4c1294xl-freertos test VCON_API_KEY=${{secrets.VCON_API_KEY}}
|
||||
|
||||
test_pico_w5500:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
@@ -213,7 +228,7 @@ jobs:
|
||||
- path: infineon/infineon-xmc4700_4800-lwip-rtx-rtos
|
||||
- path: ti/ti-ek-tm4c1294xl-http-server
|
||||
- path: ti/ek-tm4c1294xl-baremetal
|
||||
- path: ti/ek-tm4c1294xl-freertos-mip
|
||||
- path: ti/ek-tm4c1294xl-freertos
|
||||
- path: rp2040/pico-rmii
|
||||
- path: rp2040/pico-rndis-dashboard
|
||||
- path: rp2040/pico-w
|
||||
|
||||
@@ -31,8 +31,7 @@ robust, and easy. Features include:
|
||||
[bare metal example on Nucleo-F429ZI](examples/stm32/nucleo-f429zi-baremetal)
|
||||
is only 6 files
|
||||
- For comparison, a CubeIDE generated HTTP example is 400+ files
|
||||
- Detailed [user guide, API reference](https://mongoose.ws/documentation/) and
|
||||
[tons of tutorials](https://mongoose.ws/tutorials/) available
|
||||
- Detailed [user guide, API reference and tons of tutorials](https://mongoose.ws/documentation/) available
|
||||
|
||||
|
||||
# Commercial use
|
||||
|
||||
|
Before Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 158 KiB |
@@ -1,97 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1034 239" style="enable-background:new 0 0 1034 239;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#576174;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st2{font-family:'Courier-Bold';}
|
||||
.st3{font-size:16.7604px;}
|
||||
.st4{fill:#00983A;}
|
||||
.st5{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st6{fill:#45CFFF;}
|
||||
.st7{fill:none;stroke:#A000FF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st8{fill:#A000FF;}
|
||||
.st9{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st10{fill:#FFDE00;}
|
||||
.st11{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st12{fill:#EA5B0C;}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0" d="M485.3,224.22H8.5c-4.7,0-8.5-3.8-8.5-8.5V27.22c0-4.7,3.8-8.5,8.5-8.5h476.8c4.7,0,8.5,3.8,8.5,8.5v188.5
|
||||
C493.8,220.32,490,224.22,485.3,224.22z"/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 21.294 60.1267)" class="st1 st2 st3">struct mg_str k,v,s = mg_str(”a=333, b=777”);</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 21.294 136.2499)" class="st1 st2 st3">mg_commalist(&s, &k, &v); </text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 21.294 197.1485)" class="st1 st2 st3">mg_commalist(&s, &k, &v); </text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 291.5096 140.18)" class="st4 st2 st3">// 1st call</text>
|
||||
<text transform="matrix(1 0 0 1 291.5096 199.8101)" class="st4 st2 st3">// 2nd call</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<polyline class="st5" points="336.4,64.52 336.4,68.52 317.8,68.52 317.8,64.52 "/>
|
||||
<g>
|
||||
<path class="st5" d="M122.3,59.62"/>
|
||||
<g>
|
||||
<polyline class="st5" points="327.5,76.82 327.6,94.02 203.3,94.02 203.3,116.12 "/>
|
||||
<path class="st6" d="M331,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C329.5,74.42,331,75.92,331,77.62z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st6" d="M203.2,114.92c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C206.5,116.32,205,114.92,203.2,114.92z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline class="st7" points="407.4,64.52 407.4,68.52 388.8,68.52 388.8,64.52 "/>
|
||||
<g>
|
||||
<path class="st5" d="M193.4,59.62"/>
|
||||
<g>
|
||||
<polyline class="st7" points="398.6,76.82 398.6,149.02 203.4,149.02 203.4,177.12 "/>
|
||||
<path class="st8" d="M402,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C400.6,74.42,402,75.92,402,77.62z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st8" d="M203.2,175.42c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C206.5,176.82,205,175.42,203.2,175.42z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline class="st9" points="440.8,64.52 440.8,68.52 414.2,68.52 414.2,64.52 "/>
|
||||
<g>
|
||||
<path class="st5" d="M218.8,59.62"/>
|
||||
<g>
|
||||
<polyline class="st9" points="428,76.82 428,163.02 245.7,163.02 245.7,176.12 "/>
|
||||
<path class="st10" d="M431.4,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C430,74.42,431.4,75.92,431.4,77.62z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st10" d="M245.4,175.42c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C248.7,176.82,247.2,175.42,245.4,175.42z
|
||||
"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline class="st11" points="372.8,64.52 372.8,68.52 343.2,68.52 343.2,64.52 "/>
|
||||
<g>
|
||||
<path class="st5" d="M164.7,59.62"/>
|
||||
<g>
|
||||
<polyline class="st11" points="358.3,76.62 358.3,104.82 245.7,105.02 245.7,116.12 "/>
|
||||
<path class="st12" d="M361.4,77.62c0,1.8-1.4,3.2-3.2,3.3c-1.8,0.1-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C359.9,74.42,361.4,75.92,361.4,77.62z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st12" d="M245.7,114.92c-1.8,0-3.2,1.3-3.3,3s1.4,3,3.2,3s3.2-1.3,3.3-3l0,0C248.9,116.32,247.4,114.92,245.7,114.92z
|
||||
"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.9 KiB |
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1034 158.07" style="enable-background:new 0 0 1034 158.07;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#67748A;}
|
||||
.st1{fill:#FFFFFF;}
|
||||
.st2{font-family:'Courier-Bold';}
|
||||
.st3{font-size:16.7604px;}
|
||||
.st4{fill:none;stroke:#45CFFF;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st5{fill:#45CFFF;}
|
||||
.st6{font-family:'Arial-BoldMT';}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0" d="M516.7,39.8v56.33c0,4.17-3.8,7.54-8.5,7.54H14.6H8.5c-4.7,0-8.5-3.37-8.5-7.54V39.8c0-4.17,3.8-7.54,8.5-7.54
|
||||
h499.7C512.9,32.26,516.7,35.63,516.7,39.8z"/>
|
||||
<text transform="matrix(1 0 0 1 51.0379 69.3318)" class="st1 st2 st3">GET /test \n\nGET /test \n\nGET test \n\n</text>
|
||||
<g>
|
||||
<polyline class="st4" points="189.5,76.47 189.5,80.47 51.8,80.47 51.8,76.47 "/>
|
||||
<polyline class="st4" points="331.3,76.47 331.3,80.47 195.6,80.47 195.6,76.47 "/>
|
||||
<polyline class="st4" points="462.7,76.47 462.7,80.47 336.9,80.47 336.9,76.47 "/>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 78.8909 148.8896)" class="st5 st6 st3">1st request</text>
|
||||
<g>
|
||||
<line class="st4" x1="120.2" y1="93.57" x2="120.3" y2="129.57"/>
|
||||
<path class="st5" d="M117.1,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
|
||||
C118.5,95.77,117.1,94.37,117.1,92.57z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 217.3594 148.8891)" class="st5 st6 st3">2nd request </text>
|
||||
<g>
|
||||
<line class="st4" x1="263.8" y1="93.57" x2="263.9" y2="129.57"/>
|
||||
<path class="st5" d="M260.7,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
|
||||
C262.1,95.77,260.7,94.37,260.7,92.57z"/>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 354.7297 148.8896)" class="st5 st6 st3">3rd request </text>
|
||||
<g>
|
||||
<line class="st4" x1="399.4" y1="93.57" x2="399.4" y2="129.57"/>
|
||||
<path class="st5" d="M396.2,92.57c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
|
||||
C397.7,95.77,396.2,94.37,396.2,92.57z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.2 KiB |
@@ -1,113 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1035.4 429.9" style="enable-background:new 0 0 1035.4 429.9;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#576174;}
|
||||
.st1{fill:#67748A;}
|
||||
.st2{fill:none;stroke:#87005B;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st3{fill:#87005B;}
|
||||
.st4{fill:#FFFFFF;}
|
||||
.st5{font-family:'Courier-Bold';}
|
||||
.st6{font-size:16.7604px;}
|
||||
.st7{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st8{fill:#EA5B0C;}
|
||||
.st9{fill:none;stroke:#CA70FF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st10{fill:#CA70FF;}
|
||||
.st11{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st12{fill:#FFDE00;}
|
||||
.st13{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st14{fill:#00CF4F;}
|
||||
.st15{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st16{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st17{font-family:'Arial-BoldMT';}
|
||||
.st18{font-size:24px;}
|
||||
.st19{fill:#45CFFF;}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0" d="M755.8,391.8H8.5c-4.7,0-8.5-3.8-8.5-8.5v-153c0-4.7,3.8-8.5,8.5-8.5h747.3c4.7,0,8.5,3.8,8.5,8.5v153
|
||||
C764.3,388,760.5,391.8,755.8,391.8z"/>
|
||||
<path class="st1" d="M996.9,261.5h-427c-4.7,0-8.5-3.8-8.5-8.5V81.2c0-4.7,3.8-8.5,8.5-8.5h427c4.7,0,8.5,3.8,8.5,8.5V253
|
||||
C1005.4,257.7,1001.5,261.5,996.9,261.5z"/>
|
||||
<g>
|
||||
<polyline class="st2" points="598.1,238.2 598.1,242.3 787.7,242.3 787.7,238.2 "/>
|
||||
<g>
|
||||
<line class="st2" x1="689.3" y1="342.2" x2="276.4" y2="343.3"/>
|
||||
<g>
|
||||
<line class="st2" x1="689.4" y1="253.3" x2="689.4" y2="342.1"/>
|
||||
<path class="st3" d="M689.4,249.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2l0,0
|
||||
C686.1,250.7,687.6,249.3,689.4,249.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st3" d="M274.2,340.4c1.8,0,3.2,1.4,3.3,3.2s-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2l0,0
|
||||
C270.9,341.8,272.4,340.4,274.2,340.4z"/>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 26.0923 262.5192)" class="st4 st5 st6">struct mg_http_message {</text>
|
||||
<text transform="matrix(1 0 0 1 45.542 286.2874)" class="st4 st5 st6">struct mg_str method; uri, query, proto; </text>
|
||||
<text transform="matrix(1 0 0 1 45.542 306.3874)" class="st4 st5 st6">struct mg_http_header headers[MG_MAX_HTTP_HEADERS];</text>
|
||||
<text transform="matrix(1 0 0 1 45.542 326.4874)" class="st4 st5 st6">struct mg_str body;</text>
|
||||
<text transform="matrix(1 0 0 1 45.542 346.5874)" class="st4 st5 st6">struct mg_str message; </text>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st7" points="621.1,89.6 621.1,78.6 215.4,79.7 215.3,269.4 "/>
|
||||
<path class="st8" d="M624.3,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C622.8,87.4,624.3,88.8,624.3,90.6z"/>
|
||||
</g>
|
||||
<path class="st8" d="M212.3,269.4c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
|
||||
C213.7,272.6,212.3,271.2,212.3,269.4z"/>
|
||||
</g>
|
||||
<g>
|
||||
<polyline class="st9" points="597.2,183.6 593.1,183.6 593.1,127.8 597.2,127.8 "/>
|
||||
<g>
|
||||
<polyline class="st9" points="582.4,156.2 575.2,156.2 575,302.8 563.4,302.8 "/>
|
||||
<path class="st10" d="M586.1,156.2c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
|
||||
C584.7,159.4,586.1,158,586.1,156.2z"/>
|
||||
<path class="st10" d="M564.2,303c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3l0,0
|
||||
C562.7,306.2,564.2,304.7,564.2,303z"/>
|
||||
</g>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 601.1215 118.1291)" class="st4 st5 st6">POST /foo/bar/baz?aa=b&cc=ddd HTTP/1.1</text>
|
||||
<text transform="matrix(1 0 0 1 601.1215 138.2291)" class="st4 st5 st6">Content-Type: application/json</text>
|
||||
<text transform="matrix(1 0 0 1 601.1215 158.3291)" class="st4 st5 st6">Content-Length: 19</text>
|
||||
<text transform="matrix(1 0 0 1 601.1215 178.4291)" class="st4 st5 st6">Host: reqbin.com</text>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st11" points="712.3,90.6 712.4,67.6 277.8,67.6 279.7,269.3 "/>
|
||||
<path class="st12" d="M715.6,90.8c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C714.1,87.6,715.6,89.1,715.6,90.8z"/>
|
||||
</g>
|
||||
<path class="st12" d="M276.5,269.4c0-1.8,1.4-3.2,3.2-3.3s3.2,1.4,3.3,3.2s-1.4,3.2-3.2,3.3l0,0
|
||||
C278,272.6,276.5,271.2,276.5,269.4z"/>
|
||||
</g>
|
||||
<polyline class="st11" points="771.5,104.3 771.5,100.3 652.7,100.3 652.7,104.3 "/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st13" points="836.3,90.6 836.3,56.6 342.8,56.6 344.7,268.3 "/>
|
||||
<path class="st14" d="M839.5,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C838,87.4,839.5,88.9,839.5,90.6z"/>
|
||||
</g>
|
||||
<path class="st14" d="M341.4,269.3c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
|
||||
C342.9,272.5,341.4,271.1,341.4,269.3z"/>
|
||||
</g>
|
||||
<polyline class="st15" points="981.4,104.2 981.4,100.2 902.6,100.2 902.6,104.2 "/>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 596.891 232.3658)" class="st4 st5 st6">{"success": "true"}</text>
|
||||
<polyline class="st16" points="643.1,104.4 643.1,100.4 599.3,100.4 599.3,104.4 "/>
|
||||
<text transform="matrix(1 0 0 1 9.5506 207.5157)" class="st17 st18">Source Code</text>
|
||||
<text transform="matrix(1 0 0 1 797.0799 32.3923)" class="st17 st18">HTTP message</text>
|
||||
<text transform="matrix(1 0 0 1 26.0924 359.209)" class="st4 st5 st6">};</text>
|
||||
<polyline class="st13" points="894.2,104.2 894.2,100.2 774.4,100.2 774.4,104.2 "/>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st15" points="941.3,90.6 941.3,45.6 412.8,45.6 414.7,268.3 "/>
|
||||
<path class="st19" d="M944.5,90.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C943,87.4,944.5,88.9,944.5,90.6z"/>
|
||||
</g>
|
||||
<path class="st19" d="M411.4,269.3c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
|
||||
C412.9,272.5,411.4,271.1,411.4,269.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 6.0 KiB |
@@ -1,109 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1034 663.54" style="enable-background:new 0 0 1034 663.54;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st1{fill:#45CFFF;}
|
||||
.st2{fill:#576174;}
|
||||
.st3{fill:#FFFFFF;}
|
||||
.st4{font-family:'Courier-Bold';}
|
||||
.st5{font-size:16.7604px;}
|
||||
.st6{font-family:'Arial-BoldMT';}
|
||||
.st7{font-size:24px;}
|
||||
.st8{fill:#67748A;}
|
||||
.st9{fill:#8B9CBA;}
|
||||
.st10{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st11{fill:#00CF4F;}
|
||||
.st12{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st13{fill:#EA5B0C;}
|
||||
.st14{fill:#414857;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st0" points="498.5,624.21 498.5,628.21 447.9,628.21 447.9,624.21 "/>
|
||||
<g>
|
||||
<path class="st0" d="M491.8,844.81"/>
|
||||
<g>
|
||||
<path class="st1" d="M473.8,636.11c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
|
||||
C477.1,637.61,475.6,636.11,473.8,636.11z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st1" d="M296.7,852.71c-1.8,0-3.2,1.3-3.3,3c0,1.7,1.4,3,3.2,3c1.8,0,3.2-1.3,3.3-3l0,0
|
||||
C299.9,854.01,298.5,852.71,296.7,852.71z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st2" d="M584.6,199.01H8.5c-4.7,0-8.5-3.8-8.5-8.5V60.71c0-4.7,3.8-8.5,8.5-8.5h576.1c4.7,0,8.5,3.8,8.5,8.5v129.8
|
||||
C593.1,195.21,589.3,199.01,584.6,199.01z"/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 28.7 90.8107)" class="st3 st4 st5">struct mg_http_part part;</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 110.9108)" class="st3 st4 st5">size_t pos = 0;</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 151.1107)" class="st3 st4 st5">pos = mg_http_next_multipart(&hm->body, pos, &part);</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 171.3107)" class="st3 st4 st5">pos = mg_http_next_multipart(&hm->body, pos, &part);</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 1.3738 40.559)" class="st6 st7">Source Code</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st8" d="M685.5,646.41H8.5c-4.7,0-8.5-3.8-8.5-8.5v-362.9c0-4.7,3.8-8.5,8.5-8.5h677c4.7,0,8.5,3.8,8.5,8.5v362.9
|
||||
C694,642.61,690.2,646.41,685.5,646.41z"/>
|
||||
</g>
|
||||
<path class="st9" d="M640.2,629.41H26.3c-4.7,0-8.5-3.8-8.5-8.5v-106.5c0-4.7,3.8-8.5,8.5-8.5h613.9c4.7,0,8.5,3.8,8.5,8.5v106.5
|
||||
C648.7,625.61,644.8,629.41,640.2,629.41z"/>
|
||||
<path class="st9" d="M644,490.91H30.1c-4.7,0-8.5-3.8-8.5-8.5v-106.5c0-4.7,3.8-8.5,8.5-8.5H644c4.7,0,8.5,3.8,8.5,8.5v106.5
|
||||
C652.5,487.11,648.7,490.91,644,490.91z"/>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 0.0299 253.0343)" class="st6 st7">HTTP message</text>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 28.7 302.8107)" class="st3 st4 st5">POST /upload HTTP/1.1 </text>
|
||||
<text transform="matrix(1 0 0 1 28.7 322.9107)" class="st3 st4 st5">Content-Type: multipart/form-data; boundary="--xyz"</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 363.1107)" class="st3 st4 st5">--xyz</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 383.3107)" class="st3 st4 st5">Content-Disposition: form-data; name="foo"; filename="a.txt"</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 403.4107)" class="st3 st4 st5">Content-Type: text/plain</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 443.6107)" class="st3 st4 st5">hello world</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 483.8107)" class="st3 st4 st5">--xyz---</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 524.0107)" class="st3 st4 st5">Content-Disposition: form-data; name="bar"; filename="b.txt"</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 544.2108)" class="st3 st4 st5">Content-Type: text/plain</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 584.4108)" class="st3 st4 st5">hello world again</text>
|
||||
<text transform="matrix(1 0 0 1 28.7 624.6107)" class="st3 st4 st5">--xyz--</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st10" points="569.5,162.51 574.5,162.51 574.5,176.11 569.5,176.11 "/>
|
||||
<g>
|
||||
<path class="st0" d="M726.8,392.91"/>
|
||||
<g>
|
||||
<polyline class="st10" points="587.3,169.71 726.7,169.71 726.6,569.31 684.3,569.31 "/>
|
||||
<path class="st11" d="M585,166.41c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
|
||||
C588.2,167.91,586.8,166.41,585,166.41z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st11" d="M685,566.31c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3l0,0C688,567.61,686.6,566.31,685,566.31z"/>
|
||||
</g>
|
||||
<polyline class="st10" points="657.9,501.61 673.9,501.61 673.9,634.21 657.9,634.21 "/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st12" points="569.5,143.21 574.5,143.21 574.5,156.81 569.5,156.81 "/>
|
||||
<g>
|
||||
<path class="st0" d="M726.8,254.61"/>
|
||||
<g>
|
||||
<polyline class="st12" points="587.3,150.41 710.7,150.41 710.6,431.01 684.3,431.01 "/>
|
||||
<path class="st13" d="M585,147.11c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
|
||||
C588.2,148.61,586.8,147.11,585,147.11z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st13" d="M685,428.01c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3l0,0C688,429.31,686.6,428.01,685,428.01z"/>
|
||||
</g>
|
||||
<polyline class="st12" points="657.9,363.31 673.9,363.31 673.9,495.91 657.9,495.91 "/>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 537.9671 462.1467)" class="st14 st6 st7">Part 1</text>
|
||||
<text transform="matrix(1 0 0 1 537.9671 600.4373)" class="st14 st6 st7">Part 2</text>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.5 KiB |
@@ -1,94 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1034 480.6" style="enable-background:new 0 0 1034 480.6;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#67748A;}
|
||||
.st1{fill:#8B9CBA;}
|
||||
.st2{fill:#FFFFFF;}
|
||||
.st3{font-family:'Courier-Bold';}
|
||||
.st4{font-size:16.7604px;}
|
||||
.st5{fill:#414857;}
|
||||
.st6{font-family:'Arial-BoldMT';}
|
||||
.st7{font-size:30px;}
|
||||
.st8{font-size:24px;}
|
||||
.st9{fill:#576174;}
|
||||
.st10{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st11{fill:#45CFFF;}
|
||||
.st12{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st13{fill:#EA5B0C;}
|
||||
.st14{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st15{fill:none;stroke:#FFDE00;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st16{fill:#FFDE00;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<path class="st0" d="M908.4,454.9H272c-4.7,0-8.5-3.8-8.5-8.5V216c0-4.7,3.8-8.5,8.5-8.5h636.4c4.7,0,8.5,3.8,8.5,8.5v230.4
|
||||
C916.9,451.1,913.1,454.9,908.4,454.9z"/>
|
||||
<g>
|
||||
<path class="st1" d="M898.6,430.8H284.7c-4.7,0-8.5-3.8-8.5-8.5V315.9c0-4.7,3.8-8.5,8.5-8.5h613.9c4.7,0,8.5,3.8,8.5,8.5v106.5
|
||||
C907.1,427,903.3,430.8,898.6,430.8z"/>
|
||||
<text transform="matrix(1 0 0 1 295.3688 243.086)" class="st2 st3 st4">POST /upload HTTP/1.1 </text>
|
||||
<text transform="matrix(1 0 0 1 295.3688 263.186)" class="st2 st3 st4">Content-Type: multipart/form-data: boundary="--xyz"</text>
|
||||
<text transform="matrix(1 0 0 1 295.3688 303.386)" class="st2 st3 st4">--xyz</text>
|
||||
<text transform="matrix(1 0 0 1 295.3688 323.586)" class="st2 st3 st4">Content-Disposition: form-data; name="foo"; filename="a.txt"</text>
|
||||
<text transform="matrix(1 0 0 1 295.3688 343.686)" class="st2 st3 st4">Content-Type: text/plain</text>
|
||||
<text transform="matrix(1 0 0 1 295.3688 383.886)" class="st2 st3 st4">hello world</text>
|
||||
<text transform="matrix(1 0 0 1 295.3688 424.086)" class="st2 st3 st4">--xyz---</text>
|
||||
</g>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 739.2766 414.2906)" class="st5 st6 st7">HTTP part</text>
|
||||
<text transform="matrix(1 0 0 1 739.2764 193.4305)" class="st6 st8">HTTP message</text>
|
||||
<path class="st9" d="M304.9,198H8.5c-4.7,0-8.5-3.8-8.5-8.5V64.8c0-4.7,3.8-8.5,8.5-8.5H305c4.7,0,8.5,3.8,8.5,8.5v124.7
|
||||
C313.4,194.2,309.6,198,304.9,198z"/>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 25.2409 91.1617)" class="st2 st3 st4">struct mg_http_part {</text>
|
||||
<text transform="matrix(1 0 0 1 47.0734 113.7079)" class="st2 st3 st4">struct mg_str name;</text>
|
||||
<text transform="matrix(1 0 0 1 47.0734 133.8079)" class="st2 st3 st4">strucy mg_str filename;</text>
|
||||
<text transform="matrix(1 0 0 1 47.0734 153.9079)" class="st2 st3 st4">struct mg_str body;</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<polyline class="st10" points="237.4,159 237.4,163 185.8,163 185.8,159 "/>
|
||||
<g>
|
||||
<polyline class="st10" points="211.7,348.3 349.5,348.4 349.5,355.6 "/>
|
||||
<g>
|
||||
<line class="st10" x1="211.6" y1="174.4" x2="211.6" y2="348.1"/>
|
||||
<path class="st11" d="M211.6,170.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
|
||||
C214.8,171.8,213.4,170.3,211.6,170.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st11" d="M349.6,353.6c-1.8,0-3.2,1.4-3.3,3.2s1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
|
||||
C352.8,355.1,351.4,353.6,349.6,353.6z"/>
|
||||
<polyline class="st10" points="237.4,159 237.4,163 185.8,163 185.8,159 "/>
|
||||
<polyline class="st10" points="407.3,371.1 407.3,367.1 293.3,367.1 293.3,371.1 "/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st12" points="693.7,291.6 693.7,277.7 280.7,278.8 280.5,109.4 248.3,109.4 "/>
|
||||
<path class="st13" d="M696.9,293.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C695.4,290.4,696.9,291.9,696.9,293.6z"/>
|
||||
</g>
|
||||
<path class="st13" d="M243.9,109.5c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
|
||||
C245.3,112.7,243.9,111.3,243.9,109.5z"/>
|
||||
</g>
|
||||
<polyline class="st14" points="707.6,309.2 707.6,305.2 679.9,305.2 679.9,309.2 "/>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 0.8627 37.8099)" class="st6 st8">Source Code</text>
|
||||
<text transform="matrix(1 0 0 1 25.2408 177.7241)" class="st2 st3 st4">};</text>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st15" points="863.8,291.5 863.7,218.6 329.7,218.7 329.6,130.3 298.4,130.3 "/>
|
||||
<path class="st16" d="M867.1,293.6c0,1.8-1.4,3.2-3.2,3.3c-1.8,0-3.2-1.4-3.3-3.2c0-1.8,1.4-3.2,3.2-3.3l0,0
|
||||
C865.6,290.3,867.1,291.8,867.1,293.6z"/>
|
||||
</g>
|
||||
<path class="st16" d="M293,130.1c0-1.8,1.4-3.2,3.2-3.3c1.8,0,3.2,1.4,3.3,3.2c0,1.8-1.4,3.2-3.2,3.3l0,0
|
||||
C294.4,133.3,293,131.9,293,130.1z"/>
|
||||
</g>
|
||||
<polyline class="st15" points="888.7,309.1 888.7,305.1 838.9,305.1 838.9,309.1 "/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.9 KiB |
@@ -1,84 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 1034 331.2" style="enable-background:new 0 0 1034 331.2;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#576174;}
|
||||
.st1{fill:#67748A;}
|
||||
.st2{fill:#FFFFFF;}
|
||||
.st3{font-family:'Courier-Bold';}
|
||||
.st4{font-size:16.7604px;}
|
||||
.st5{font-family:'Arial-BoldMT';}
|
||||
.st6{font-size:24px;}
|
||||
.st7{fill:none;stroke:#45CFFF;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st8{fill:#45CFFF;}
|
||||
.st9{fill:none;stroke:#EA5B0C;stroke-width:2.793;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st10{fill:#EA5B0C;}
|
||||
.st11{fill:none;stroke:#EA5B0C;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st12{fill:none;stroke:#00CF4F;stroke-width:2.7934;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st13{fill:#00CF4F;}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0" d="M541.43,184.2H8.53c-4.7,0-8.5-3.8-8.5-8.5V54.8c0-4.7,3.8-8.5,8.5-8.5h532.9c4.7,0,8.5,3.8,8.5,8.5v120.9
|
||||
C549.93,180.4,546.13,184.2,541.43,184.2z"/>
|
||||
<g>
|
||||
<path class="st1" d="M829.23,315.5h-370c-4.7,0-8.5-3.8-8.5-8.5V157c0-4.7,3.8-8.5,8.5-8.5h370c4.7,0,8.5,3.8,8.5,8.5v150
|
||||
C837.83,311.7,833.93,315.5,829.23,315.5z"/>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 490.6096 184.0905)" class="st2 st3 st4">HTTP/1.1 200 OK</text>
|
||||
<text transform="matrix(1 0 0 1 490.6096 204.1905)" class="st2 st3 st4">Content-Length; 13</text>
|
||||
<text transform="matrix(1 0 0 1 490.6096 224.2905)" class="st2 st3 st4">X-Header-1: additional value 1</text>
|
||||
<text transform="matrix(1 0 0 1 490.6096 244.3905)" class="st2 st3 st4">X-Header-2: additional value 2</text>
|
||||
<text transform="matrix(1 0 0 1 490.8657 293.1559)" class="st2 st3 st4">Hello, world!</text>
|
||||
</g>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 660.5036 137.3383)" class="st5 st6">HTTP message</text>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 20.7331 85.1617)" class="st2 st3 st4">mg_http_reply(c, 200</text>
|
||||
<text transform="matrix(1 0 0 1 159.5657 113.7079)" class="st2 st3 st4">"X-Header-1: additional value 1\r\n"</text>
|
||||
<text transform="matrix(1 0 0 1 159.5657 133.8079)" class="st2 st3 st4">"X-Header-2: additional value 2\r\n",</text>
|
||||
<text transform="matrix(1 0 0 1 159.5657 153.9079)" class="st2 st3 st4">"Hello, %s!", "world");</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<polyline class="st7" points="362.93,159 362.93,163 167.33,163 167.33,159 "/>
|
||||
<g>
|
||||
<polyline class="st7" points="265.93,256.6 552.13,256.7 552.13,264.4 "/>
|
||||
<g>
|
||||
<line class="st7" x1="265.83" y1="174.4" x2="265.83" y2="256.6"/>
|
||||
<path class="st8" d="M265.83,170.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
|
||||
C269.03,171.8,267.53,170.3,265.83,170.3z"/>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st8" d="M552.23,261.6c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2l0,0
|
||||
C555.43,263.1,554.03,261.6,552.23,261.6z"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st9" points="206.33,53.6 206.43,37.6 596.43,38.7 596.53,161.3 "/>
|
||||
<path class="st10" d="M203.23,54.6c0,1.8,1.4,3.2,3.2,3.3c1.8,0,3.2-1.4,3.3-3.2c0-1.8-1.4-3.2-3.2-3.3l0,0
|
||||
C204.63,51.4,203.23,52.8,203.23,54.6z"/>
|
||||
</g>
|
||||
<path class="st10" d="M599.83,164c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
|
||||
C598.33,167.2,599.83,165.8,599.83,164z"/>
|
||||
</g>
|
||||
<polyline class="st11" points="192.43,69.2 192.43,65.2 220.23,65.2 220.23,69.2 "/>
|
||||
</g>
|
||||
<text transform="matrix(1 0 0 1 -1.917133e-04 35.0037)" class="st5 st6">Source Code</text>
|
||||
<g>
|
||||
<polyline class="st12" points="160.13,135.9 156.03,135.9 156.03,100.1 160.13,100.1 "/>
|
||||
<g>
|
||||
<line class="st12" x1="123.93" y1="231" x2="469.73" y2="231"/>
|
||||
<polyline class="st12" points="144.73,117.2 123.83,117.2 123.73,230.8 "/>
|
||||
<path class="st13" d="M147.83,117.2c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
|
||||
C146.33,120.4,147.83,119,147.83,117.2z"/>
|
||||
<path class="st13" d="M474.83,230.8c0-1.8-1.4-3.2-3.2-3.3c-1.8,0-3.2,1.4-3.3,3.2c0,1.8,1.4,3.2,3.2,3.3l0,0
|
||||
C473.43,234,474.83,232.5,474.83,230.8z"/>
|
||||
</g>
|
||||
</g>
|
||||
<polyline class="st7" points="489.03,279.6 489.03,275.6 620.63,275.6 620.63,279.6 "/>
|
||||
<polyline class="st12" points="487.63,248.3 483.63,248.3 483.63,211.5 487.63,211.5 "/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.4 KiB |
@@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 869.6 185.67" style="enable-background:new 0 0 869.6 185.67;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{font-family:'Arial-BoldMT';}
|
||||
.st1{font-size:24px;}
|
||||
.st2{opacity:0.2;fill:#00983A;enable-background:new ;}
|
||||
.st3{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st4{fill:#00983A;}
|
||||
.st5{fill:none;stroke:#576174;stroke-miterlimit:10;}
|
||||
.st6{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st7{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st8{font-family:'Courier-Bold';}
|
||||
.st9{font-size:16.7604px;}
|
||||
.st10{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st11{fill:#576174;}
|
||||
.st12{font-family:'Courier';}
|
||||
.st13{fill:none;}
|
||||
.st14{fill:#7A8387;}
|
||||
</style>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 1.0956 32.4549)" class="st0 st1">Memory</text>
|
||||
<polyline class="st2" points="424.58,115.4 219.88,115.4 219.88,90.7 424.58,90.7 "/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st3" points="458.98,115.4 218.98,115.4 218.98,90.7 458.98,90.7 "/>
|
||||
<polyline class="st4" points="219.18,115.1 2.98,115.1 2.98,91.3 219.18,91.3 "/>
|
||||
<line class="st3" x1="2.98" y1="69.2" x2="2.98" y2="130.4"/>
|
||||
<line class="st5" x1="219.78" y1="69.2" x2="219.78" y2="130.4"/>
|
||||
<line class="st5" x1="425.28" y1="69.2" x2="425.28" y2="130.4"/>
|
||||
<path class="st6" d="M458.98,115.4"/>
|
||||
<path class="st7" d="M33.98,114.6"/>
|
||||
<path class="st7" d="M33.98,90.9"/>
|
||||
<path class="st7" d="M2.98,90.7h216.8v24.9l-216.8-0.2C2.98,115.4,3.18,90.7,2.98,90.7z"/>
|
||||
<line class="st3" x1="425.18" y1="90.8" x2="425.18" y2="115.3"/>
|
||||
<path class="st6" d="M251.98,115.6"/>
|
||||
<path class="st6" d="M251.98,91.9"/>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 -2.290726e-04 175.3858)" class="st4 st8 st9">buf</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st10" x1="2.68" y1="158.2" x2="2.68" y2="137.2"/>
|
||||
<g>
|
||||
<polygon class="st4" points="0.28,137.6 5.08,137.6 2.68,135.1 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 214.6515 175.3858)" class="st4 st8 st9">len</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st10" x1="219.78" y1="158.2" x2="219.78" y2="137.2"/>
|
||||
<g>
|
||||
<polygon class="st4" points="217.38,137.6 222.18,137.6 219.78,135.1 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 421.6186 175.3858)" class="st4 st8 st9">size</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st10" x1="425.38" y1="158.2" x2="425.38" y2="137.2"/>
|
||||
<g>
|
||||
<polygon class="st4" points="422.98,137.6 427.78,137.6 425.38,135.1 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 93.1143 69.4458)" class="st11 st12 st9">data</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 273.8231 69.4458)" class="st11 st12 st9">free space</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st5" x1="132.98" y1="76.3" x2="13.98" y2="76.3"/>
|
||||
<g>
|
||||
<polygon class="st11" points="14.28,78.7 14.28,73.8 11.88,76.3 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<line class="st13" x1="123.88" y1="76.3" x2="210.88" y2="76.3"/>
|
||||
<g>
|
||||
<line class="st5" x1="123.88" y1="76.3" x2="208.78" y2="76.3"/>
|
||||
<g>
|
||||
<polygon class="st11" points="208.48,73.8 208.48,78.7 210.88,76.3 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st5" x1="320.38" y1="76.3" x2="414.28" y2="76.3"/>
|
||||
<g>
|
||||
<polygon class="st14" points="413.98,73.8 413.98,78.7 416.38,76.3 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st5" x1="322.28" y1="76.3" x2="233.28" y2="76.3"/>
|
||||
<g>
|
||||
<polygon class="st14" points="233.68,78.7 233.68,73.8 231.18,76.3 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -1,52 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 869 124.66" style="enable-background:new 0 0 869 124.66;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st1{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st2{fill:#00983A;}
|
||||
.st3{font-family:'Courier-Bold';}
|
||||
.st4{font-size:16.7604px;}
|
||||
.st5{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st6{fill:#7A8387;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st0" points="830.92,78.4 5.52,78.4 5.52,53.7 830.92,53.6 "/>
|
||||
<line class="st1" x1="5.52" y1="32.2" x2="5.52" y2="93.4"/>
|
||||
<path class="st0" d="M830.92,78.4"/>
|
||||
<line class="st1" x1="36.52" y1="53.9" x2="36.52" y2="77.6"/>
|
||||
<line class="st1" x1="68.92" y1="53.9" x2="68.92" y2="77.6"/>
|
||||
<line class="st1" x1="101.42" y1="53.9" x2="101.42" y2="77.6"/>
|
||||
<line class="st1" x1="133.72" y1="53.9" x2="133.72" y2="77.6"/>
|
||||
<line class="st1" x1="166.22" y1="53.9" x2="166.22" y2="77.6"/>
|
||||
<line class="st1" x1="198.52" y1="54.6" x2="198.52" y2="78.3"/>
|
||||
<line class="st1" x1="230.92" y1="54.6" x2="230.92" y2="78.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 59.1908 40.8585)" class="st2 st3 st4">buf=NULL, len=0, size=0 </text>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 -1.811981e-04 109.9024)" class="st2 st3 st4">0</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st5" x1="46.72" y1="37.7" x2="17.72" y2="37.7"/>
|
||||
<g>
|
||||
<polygon class="st2" points="18.12,40.1 18.12,35.2 15.62,37.7 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st6" d="M511.52,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S511.52,65.5,511.52,66.4z"/>
|
||||
<path class="st6" d="M525.32,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S525.32,65.5,525.32,66.4z"/>
|
||||
<path class="st6" d="M539.02,66.4c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S539.02,65.5,539.02,66.4z"/>
|
||||
<path class="st6" d="M552.82,66.4c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6s0.7-1.6,1.6-1.6S552.82,65.5,552.82,66.4z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
@@ -1,185 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 869.6 127.5" style="enable-background:new 0 0 869.6 127.5;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.2;fill:#00983A;enable-background:new ;}
|
||||
.st1{fill:#F2F3F3;}
|
||||
.st2{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st3{fill:#00983A;}
|
||||
.st4{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st5{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st6{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:square;stroke-linejoin:round;}
|
||||
.st7{font-family:'Courier-Bold';}
|
||||
.st8{font-size:16.7604px;}
|
||||
.st9{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st10{fill:#7A8387;}
|
||||
.st11{fill:#576174;}
|
||||
.st12{fill:none;stroke:#576174;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st13{fill:none;stroke:#7A8387;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st14{fill:#333A45;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st0" points="577.2,72.8 282.4,72.8 282.4,48 577.2,48 "/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st1" points="122.6,72.8 5.9,72.8 5.9,48 122.6,48 "/>
|
||||
<polyline class="st2" points="831.51,72.8 5.5,72.8 5.5,48 831.51,48 "/>
|
||||
<polyline class="st3" points="282.7,72.5 122.5,72.5 122.5,47.7 282.7,47.7 "/>
|
||||
<line class="st2" x1="122.5" y1="26.6" x2="122.5" y2="87.8"/>
|
||||
<line class="st2" x1="283.3" y1="26.6" x2="283.3" y2="87.8"/>
|
||||
<line class="st2" x1="576.8" y1="26.6" x2="576.8" y2="87.8"/>
|
||||
<path class="st4" d="M831.51,72.8"/>
|
||||
<line class="st5" x1="153.5" y1="48.3" x2="153.5" y2="72"/>
|
||||
<line class="st2" x1="36.5" y1="48.3" x2="36.5" y2="72"/>
|
||||
<line class="st2" x1="67.6" y1="48.3" x2="67.6" y2="72"/>
|
||||
<line class="st5" x1="186" y1="48.3" x2="186" y2="72"/>
|
||||
<line class="st5" x1="218.4" y1="48.3" x2="218.4" y2="72"/>
|
||||
<line class="st5" x1="250.9" y1="48.3" x2="250.9" y2="72"/>
|
||||
<line class="st2" x1="315.9" y1="48.3" x2="315.9" y2="72"/>
|
||||
<line class="st2" x1="348.4" y1="48.3" x2="348.4" y2="72"/>
|
||||
<line class="st2" x1="381.2" y1="48.3" x2="381.2" y2="72"/>
|
||||
<line class="st2" x1="413.8" y1="48.3" x2="413.8" y2="72"/>
|
||||
<line class="st2" x1="446.3" y1="48.3" x2="446.3" y2="72"/>
|
||||
<line class="st2" x1="478.9" y1="48.3" x2="478.9" y2="72"/>
|
||||
<line class="st5" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
|
||||
<line class="st2" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
|
||||
<line class="st5" x1="544.01" y1="48.3" x2="544.01" y2="72"/>
|
||||
<line class="st2" x1="544.1" y1="48.3" x2="544.1" y2="72"/>
|
||||
<line class="st6" x1="283.3" y1="73" x2="122.5" y2="72.8"/>
|
||||
<line class="st6" x1="122.5" y1="48" x2="283.3" y2="48.1"/>
|
||||
<path class="st4" d="M385.5,73"/>
|
||||
<path class="st4" d="M385.5,49.3"/>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 127.5176 105.8013)" class="st3 st7 st8">buf</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st9" x1="122.2" y1="105.6" x2="122.2" y2="94.6"/>
|
||||
<g>
|
||||
<polygon class="st3" points="119.8,94.9 124.6,94.9 122.2,92.5 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 286.6495 105.8008)" class="st3 st7 st8">len=5</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st9" x1="283.3" y1="105.6" x2="283.3" y2="94.6"/>
|
||||
<g>
|
||||
<polygon class="st3" points="280.9,94.9 285.8,94.9 283.3,92.5 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 581.4624 105.8013)" class="st3 st7 st8">size=16</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st9" x1="576.9" y1="105.6" x2="576.9" y2="94.6"/>
|
||||
<g>
|
||||
<polygon class="st3" points="574.51,94.9 579.4,94.9 576.9,92.5 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st10" d="M687.51,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S687.51,59.9,687.51,60.7z"/>
|
||||
<path class="st10" d="M701.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,59.9,701.2,60.7z"/>
|
||||
<path class="st10" d="M714.9,60.7c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
|
||||
C714.2,59.1,714.9,59.9,714.9,60.7z"/>
|
||||
<path class="st10" d="M728.7,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
|
||||
C728.01,59.1,728.7,59.9,728.7,60.7z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st10" d="M82.8,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,59.9,82.8,60.7z"/>
|
||||
<path class="st10" d="M96.5,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6C95.8,59.1,96.5,59.9,96.5,60.7
|
||||
z"/>
|
||||
<path class="st10" d="M110.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,59.9,110.2,60.7z"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 180.6541 26.8123)" class="st11 st7 st8">data</text>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 387.363 26.8123)" class="st10 st7 st8">free space</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st12" x1="272.2" y1="33.6" x2="133.5" y2="33.6"/>
|
||||
<g>
|
||||
<polygon class="st11" points="271.9,36.2 273.5,33.6 271.9,31.1 271.8,31.1 271.8,36.2 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st11" points="133.8,36.1 133.8,31.2 131.4,33.6 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st13" x1="563.7" y1="33.6" x2="295.9" y2="33.6"/>
|
||||
<g>
|
||||
<polygon class="st10" points="563.4,36.1 563.4,31.2 565.8,33.6 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st10" points="296.2,36.1 296.2,31.2 293.7,33.6 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 615.4679 25.1898)" class="st10 st7 st8">non-allocated space</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st13" x1="593.7" y1="33.6" x2="829.7" y2="33.6"/>
|
||||
<g>
|
||||
<polygon class="st10" points="829.4,31.2 829.4,36.1 831.8,33.6 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st13" x1="678.7" y1="33.6" x2="589.7" y2="33.6"/>
|
||||
<g>
|
||||
<polygon class="st10" points="590.01,36.1 590.01,31.2 587.6,33.6 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 133.1212 64.9593)" class="st14 st7 st8">h</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 165.1564 64.9593)" class="st14 st7 st8">e</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 196.8744 64.9593)" class="st14 st7 st8">l</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 229.8611 64.9593)" class="st14 st7 st8">l</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 262.2135 64.9593)" class="st14 st7 st8">o</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 1.811981e-04 105.8011)" class="st3 st7 st8">0</text>
|
||||
</g>
|
||||
<line class="st2" x1="5.5" y1="26.4" x2="5.5" y2="87.6"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.1 KiB |
@@ -1,347 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 26.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 869.6 247.73" style="enable-background:new 0 0 869.6 247.73;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.2;fill:#00983A;enable-background:new ;}
|
||||
.st1{fill:#00983A;}
|
||||
.st2{fill:#FF80A4;}
|
||||
.st3{fill:#F2F3F3;}
|
||||
.st4{fill:none;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st5{fill:#F2F3F3;stroke:#7A8387;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st6{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st7{fill:none;stroke:#576174;stroke-width:1.2;stroke-linejoin:round;}
|
||||
.st8{fill:none;stroke:#576174;stroke-width:1.2;stroke-linecap:square;stroke-linejoin:round;}
|
||||
.st9{font-family:'Courier-Bold';}
|
||||
.st10{font-size:16.7604px;}
|
||||
.st11{fill:none;stroke:#00983A;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st12{fill:#7A8387;}
|
||||
.st13{fill:#576174;}
|
||||
.st14{fill:none;stroke:#576174;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st15{fill:none;stroke:#7A8387;stroke-linecap:round;stroke-linejoin:round;}
|
||||
.st16{fill:#333A45;}
|
||||
</style>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st0" points="577.2,72.8 282.4,72.8 282.4,48 577.2,48 "/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<rect x="250.9" y="47.7" class="st1" width="32.4" height="24.8"/>
|
||||
<rect x="153.5" y="47.7" class="st2" width="97.3" height="24.8"/>
|
||||
<polyline class="st3" points="122.6,72.8 5.9,72.8 5.9,48 122.6,48 "/>
|
||||
<polyline class="st4" points="831.51,72.8 5.5,72.8 5.5,48 831.51,48 "/>
|
||||
<rect x="122.5" y="47.7" class="st1" width="31" height="24.8"/>
|
||||
<line class="st4" x1="122.5" y1="26.6" x2="122.5" y2="87.8"/>
|
||||
<line class="st4" x1="576.8" y1="26.6" x2="576.8" y2="87.8"/>
|
||||
<path class="st5" d="M831.51,72.8"/>
|
||||
<line class="st6" x1="153.5" y1="48.3" x2="153.5" y2="72"/>
|
||||
<line class="st4" x1="36.5" y1="48.3" x2="36.5" y2="72"/>
|
||||
<line class="st4" x1="67.6" y1="48.3" x2="67.6" y2="72"/>
|
||||
<line class="st6" x1="186" y1="48.3" x2="186" y2="72"/>
|
||||
<line class="st6" x1="218.4" y1="48.3" x2="218.4" y2="72"/>
|
||||
<line class="st7" x1="250.9" y1="73" x2="250.81" y2="47.7"/>
|
||||
<line class="st4" x1="315.9" y1="48.3" x2="315.9" y2="72"/>
|
||||
<line class="st4" x1="348.4" y1="48.3" x2="348.4" y2="72"/>
|
||||
<line class="st4" x1="381.2" y1="48.3" x2="381.2" y2="72"/>
|
||||
<line class="st4" x1="413.8" y1="48.3" x2="413.8" y2="72"/>
|
||||
<line class="st4" x1="446.3" y1="48.3" x2="446.3" y2="72"/>
|
||||
<line class="st4" x1="478.9" y1="48.3" x2="478.9" y2="72"/>
|
||||
<line class="st6" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
|
||||
<line class="st4" x1="511.51" y1="48.3" x2="511.51" y2="72"/>
|
||||
<line class="st6" x1="544.01" y1="48.3" x2="544.01" y2="72"/>
|
||||
<line class="st4" x1="544.1" y1="48.3" x2="544.1" y2="72"/>
|
||||
<line class="st8" x1="283.3" y1="73" x2="122.5" y2="72.8"/>
|
||||
<line class="st8" x1="122.5" y1="48" x2="283.3" y2="48.1"/>
|
||||
<path class="st5" d="M385.5,73"/>
|
||||
<path class="st5" d="M385.5,49.3"/>
|
||||
<line class="st4" x1="283.3" y1="26.6" x2="283.3" y2="87.8"/>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 127.5176 105.8013)" class="st1 st9 st10">buf</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st11" x1="122.2" y1="105.6" x2="122.2" y2="94.6"/>
|
||||
<g>
|
||||
<polygon class="st1" points="119.8,94.9 124.6,94.9 122.2,92.5 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 286.6495 105.8008)" class="st1 st9 st10">len=5</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st11" x1="283.3" y1="105.6" x2="283.3" y2="94.6"/>
|
||||
<g>
|
||||
<polygon class="st1" points="280.9,94.9 285.8,94.9 283.3,92.5 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 581.4624 105.8013)" class="st1 st9 st10">size=16</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st11" x1="576.9" y1="105.6" x2="576.9" y2="94.6"/>
|
||||
<g>
|
||||
<polygon class="st1" points="574.51,94.9 579.4,94.9 576.9,92.5 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st12" d="M687.51,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S687.51,59.9,687.51,60.7z"/>
|
||||
<path class="st12" d="M701.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,59.9,701.2,60.7z"/>
|
||||
<path class="st12" d="M714.9,60.7c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
|
||||
C714.2,59.1,714.9,59.9,714.9,60.7z"/>
|
||||
<path class="st12" d="M728.7,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
|
||||
C728.01,59.1,728.7,59.9,728.7,60.7z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st12" d="M82.8,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,59.9,82.8,60.7z"/>
|
||||
<path class="st12" d="M96.5,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6C95.8,59.1,96.5,59.9,96.5,60.7
|
||||
z"/>
|
||||
<path class="st12" d="M110.2,60.7c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,59.9,110.2,60.7z"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 180.6541 26.8123)" class="st13 st9 st10">data</text>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 387.363 26.8123)" class="st12 st9 st10">free space</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st14" x1="272.2" y1="33.6" x2="133.5" y2="33.6"/>
|
||||
<g>
|
||||
<polygon class="st13" points="271.9,36.2 273.5,33.6 271.9,31.1 271.8,31.1 271.8,36.2 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st13" points="133.8,36.1 133.8,31.2 131.4,33.6 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st15" x1="563.7" y1="33.6" x2="295.9" y2="33.6"/>
|
||||
<g>
|
||||
<polygon class="st12" points="563.4,36.1 563.4,31.2 565.8,33.6 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st12" points="296.2,36.1 296.2,31.2 293.7,33.6 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 615.4679 25.1898)" class="st12 st9 st10">non-allocated space</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st15" x1="593.7" y1="33.6" x2="829.7" y2="33.6"/>
|
||||
<g>
|
||||
<polygon class="st12" points="829.4,31.2 829.4,36.1 831.8,33.6 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st15" x1="678.7" y1="33.6" x2="589.7" y2="33.6"/>
|
||||
<g>
|
||||
<polygon class="st12" points="590.01,36.1 590.01,31.2 587.6,33.6 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 133.1212 64.9593)" class="st16 st9 st10">h</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 165.1564 64.9593)" class="st16 st9 st10">e</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 196.8744 64.9593)" class="st16 st9 st10">l</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 229.8611 64.9593)" class="st16 st9 st10">l</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 262.2135 64.9593)" class="st16 st9 st10">o</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 1.811981e-04 105.8011)" class="st1 st9 st10">0</text>
|
||||
</g>
|
||||
<line class="st4" x1="5.5" y1="26.4" x2="5.5" y2="87.6"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st0" points="577.2,207.99 186.3,207.99 186.3,183.19 577.2,183.19 "/>
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
<polyline class="st3" points="122.6,207.99 5.9,207.99 5.9,183.19 122.6,183.19 "/>
|
||||
<polyline class="st4" points="831.51,207.99 5.5,207.99 5.5,183.19 831.51,183.19 "/>
|
||||
<polyline class="st1" points="186.3,207.69 122.5,207.69 122.5,182.89 186.3,182.89 "/>
|
||||
<line class="st4" x1="122.5" y1="161.79" x2="122.5" y2="222.99"/>
|
||||
<line class="st4" x1="186" y1="161.79" x2="186" y2="222.99"/>
|
||||
<line class="st4" x1="576.8" y1="161.79" x2="576.8" y2="222.99"/>
|
||||
<path class="st5" d="M831.51,207.99"/>
|
||||
<line class="st6" x1="153.5" y1="183.49" x2="153.5" y2="207.19"/>
|
||||
<line class="st4" x1="36.5" y1="183.49" x2="36.5" y2="207.19"/>
|
||||
<line class="st4" x1="67.6" y1="183.49" x2="67.6" y2="207.19"/>
|
||||
<line class="st6" x1="186" y1="183.49" x2="186" y2="207.99"/>
|
||||
<line class="st4" x1="218.4" y1="183.49" x2="218.4" y2="207.19"/>
|
||||
<line class="st4" x1="250.9" y1="183.49" x2="250.9" y2="207.19"/>
|
||||
<line class="st4" x1="283.3" y1="183.49" x2="283.3" y2="207.19"/>
|
||||
<line class="st4" x1="315.9" y1="183.49" x2="315.9" y2="207.19"/>
|
||||
<line class="st4" x1="348.4" y1="183.49" x2="348.4" y2="207.19"/>
|
||||
<line class="st4" x1="381.2" y1="183.49" x2="381.2" y2="207.19"/>
|
||||
<line class="st4" x1="413.8" y1="183.49" x2="413.8" y2="207.19"/>
|
||||
<line class="st4" x1="446.3" y1="183.49" x2="446.3" y2="207.19"/>
|
||||
<line class="st4" x1="478.9" y1="183.49" x2="478.9" y2="207.19"/>
|
||||
<line class="st6" x1="511.51" y1="183.49" x2="511.51" y2="207.19"/>
|
||||
<line class="st4" x1="511.51" y1="183.49" x2="511.51" y2="207.19"/>
|
||||
<line class="st6" x1="544.01" y1="183.49" x2="544.01" y2="207.19"/>
|
||||
<line class="st4" x1="544.1" y1="183.49" x2="544.1" y2="207.19"/>
|
||||
<line class="st8" x1="186" y1="208.19" x2="122.5" y2="207.99"/>
|
||||
<line class="st8" x1="122.5" y1="183.19" x2="186" y2="183.29"/>
|
||||
<path class="st5" d="M385.5,208.19"/>
|
||||
<path class="st5" d="M385.5,184.49"/>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 127.5176 240.9952)" class="st1 st9 st10">buf</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st11" x1="122.2" y1="240.79" x2="122.2" y2="229.79"/>
|
||||
<g>
|
||||
<polygon class="st1" points="119.8,230.09 124.6,230.09 122.2,227.69 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 189.2273 240.9947)" class="st1 st9 st10">len=2</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st11" x1="185.88" y1="240.79" x2="185.88" y2="229.79"/>
|
||||
<g>
|
||||
<polygon class="st1" points="183.48,230.09 188.38,230.09 185.88,227.69 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 581.4624 240.9952)" class="st1 st9 st10">size=16</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st11" x1="576.9" y1="240.79" x2="576.9" y2="229.79"/>
|
||||
<g>
|
||||
<polygon class="st1" points="574.51,230.09 579.4,230.09 576.9,227.69 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st12" d="M687.51,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
|
||||
S687.51,195.09,687.51,195.89z"/>
|
||||
<path class="st12" d="M701.2,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S701.2,195.09,701.2,195.89z
|
||||
"/>
|
||||
<path class="st12" d="M714.9,195.89c0,0.9-0.7,1.6-1.6,1.6c-0.9,0-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
|
||||
S714.9,195.09,714.9,195.89z"/>
|
||||
<path class="st12" d="M728.7,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
|
||||
C728.01,194.29,728.7,195.09,728.7,195.89z"/>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st12" d="M82.8,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S82.8,195.09,82.8,195.89z"/>
|
||||
<path class="st12" d="M96.5,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6
|
||||
C95.8,194.29,96.5,195.09,96.5,195.89z"/>
|
||||
<path class="st12" d="M110.2,195.89c0,0.9-0.7,1.6-1.6,1.6s-1.6-0.7-1.6-1.6c0-0.9,0.7-1.6,1.6-1.6S110.2,195.09,110.2,195.89z
|
||||
"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 133.6541 162.0062)" class="st13 st9 st10">data</text>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 327.363 162.0062)" class="st12 st9 st10">free space</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st14" x1="175.2" y1="168.79" x2="133.5" y2="168.79"/>
|
||||
<g>
|
||||
<polygon class="st13" points="174.9,171.39 176.5,168.79 174.9,166.29 174.8,166.29 174.8,171.39 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st13" points="133.8,171.29 133.8,166.39 131.4,168.79 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st15" x1="563.7" y1="168.79" x2="197.49" y2="168.79"/>
|
||||
<g>
|
||||
<polygon class="st12" points="563.4,171.29 563.4,166.39 565.8,168.79 "/>
|
||||
</g>
|
||||
<g>
|
||||
<polygon class="st12" points="197.79,171.29 197.79,166.39 195.29,168.79 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 615.4679 160.3837)" class="st12 st9 st10">non-allocated space</text>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st15" x1="593.7" y1="168.79" x2="829.7" y2="168.79"/>
|
||||
<g>
|
||||
<polygon class="st12" points="829.4,166.39 829.4,171.29 831.8,168.79 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<line class="st15" x1="678.7" y1="168.79" x2="589.7" y2="168.79"/>
|
||||
<g>
|
||||
<polygon class="st12" points="590.01,171.29 590.01,166.39 587.6,168.79 "/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 133.1212 200.1532)" class="st16 st9 st10">h</text>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 165.1565 200.1532)" class="st16 st9 st10">o</text>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<text transform="matrix(1 0 0 1 1.811981e-04 240.995)" class="st1 st9 st10">0</text>
|
||||
</g>
|
||||
<line class="st4" x1="5.5" y1="161.59" x2="5.5" y2="222.79"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 13 KiB |
@@ -9,7 +9,7 @@ struct mg_tcpip_spi spi = {
|
||||
[](void *) { digitalWrite(SS_PIN, HIGH); }, // end transaction
|
||||
[](void *, uint8_t c) { return SPI.transfer(c); }, // execute transaction
|
||||
};
|
||||
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // MIP network interface
|
||||
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5}}; // network interface
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
@@ -1,30 +1,10 @@
|
||||
# A UART to network bridge for ESP32
|
||||
|
||||
This example is a demonstration of how Mongoose Library could be integrated
|
||||
into an embedded device and provide a UART-to-Network bridge capability:
|
||||
|
||||
- A device opens listening TCP port and Websocket port and waits for connections
|
||||
- When a client connects, data is exchanged with the device's UART
|
||||
- Everything that client send, is sent to the UART
|
||||
- Everything that is read from the UART, gets sent to the client
|
||||
- Multiple clients are allowed
|
||||
- Live UART console allows to talk to the UART from the web page
|
||||
- Web UI is hardcoded into the binary and does not need a filesystem
|
||||
|
||||
# Screenshots
|
||||
|
||||

|
||||
|
||||
# Build and flash
|
||||
- See detailed tutorial at https://mongoose.ws/tutorials/esp32/uart-bridge/
|
||||
|
||||
Build requires Docker installed, and uses Espressif's ESP-IDF docker image:
|
||||
|
||||
```sh
|
||||
make build
|
||||
make flash PORT=/dev/YOURSERIAL
|
||||
```
|
||||
|
||||
# Flash pre-built firmware
|
||||
## Flash pre-built firmware
|
||||
|
||||
You can flash a pre-built firmware to the ESP32 device using the following
|
||||
instructions:
|
||||
|
||||
@@ -1,22 +1 @@
|
||||
# An example ESP8266 application
|
||||
|
||||
To build this application, follow these steps:
|
||||
|
||||
1. Make sure you have Docker installed
|
||||
2. Clone whole mongoose repository on your machine:
|
||||
```sh
|
||||
git clone https://github.com/cesanta/mongoose.git
|
||||
```
|
||||
3. Start command line or terminal, and go into the example's directory:
|
||||
```sh
|
||||
cd mongoose/examples/esp8266
|
||||
```
|
||||
4. Run `make`. This invokes a Docker-based build. A firmware will be built
|
||||
in the `src/build/` directory:
|
||||
```sh
|
||||
make build
|
||||
```
|
||||
5. Flash your ESP8266. If you have esptool.py installed, the build process will end telling you the command to flash your device. You can just run `make` again to use Docker:
|
||||
```sh
|
||||
make flash PORT=/your/serial
|
||||
```
|
||||
See detailed tutorial at https://mongoose.ws/tutorials/esp8266/http-client-server/
|
||||
@@ -24,10 +24,10 @@ int main(void) {
|
||||
stdio_init_all();
|
||||
|
||||
struct mg_mgr mgr; // Initialise Mongoose event manager
|
||||
mg_mgr_init(&mgr); // and attach it to the MIP interface
|
||||
mg_mgr_init(&mgr); // and attach it to the interface
|
||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||
|
||||
MG_INFO(("Init MIP"));
|
||||
MG_INFO(("Init TCP/IP"));
|
||||
// Initialise Mongoose network stack and specific driver
|
||||
// Set consecutive GPIOs for RMII (tx and rx) and SMI function groups
|
||||
struct mg_tcpip_driver_rp2040_rmii_data driver_data = {
|
||||
|
||||
@@ -53,7 +53,7 @@ int main(void) {
|
||||
stdio_init_all();
|
||||
|
||||
struct mg_mgr mgr; // Initialise Mongoose event manager
|
||||
mg_mgr_init(&mgr); // and attach it to the MIP interface
|
||||
mg_mgr_init(&mgr); // and attach it to the interface
|
||||
mg_timer_add(&mgr, 500, MG_TIMER_REPEAT, blink_cb, &mgr);
|
||||
|
||||
struct mg_tcpip_driver driver = {.tx = usb_tx, .up = usb_up};
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "hardware/spi.h"
|
||||
#include "pico/rand.h"
|
||||
#include "pico/stdlib.h"
|
||||
#include "pico/unique_id.h"
|
||||
|
||||
#include "mongoose.h"
|
||||
|
||||
@@ -31,42 +32,58 @@ void mg_random(void *buf, size_t len) {
|
||||
}
|
||||
}
|
||||
|
||||
static void timer_cb(void *arg) {
|
||||
gpio_put(PICO_DEFAULT_LED_PIN, !gpio_get_out_level(PICO_DEFAULT_LED_PIN));
|
||||
bool up = ((struct mg_tcpip_if *) arg)->state == MIP_STATE_READY;
|
||||
MG_INFO(("Ethernet: %s", up ? "up" : "down")); // Show network status
|
||||
static void timer_fn(void *arg) {
|
||||
gpio_put(PICO_DEFAULT_LED_PIN,
|
||||
!gpio_get_out_level(PICO_DEFAULT_LED_PIN)); // Blink LED
|
||||
struct mg_tcpip_if *ifp = arg; // And show
|
||||
const char *names[] = {"down", "up", "ready"}; // network stats
|
||||
MG_INFO(("Ethernet: %s, IP: %M, rx:%u, tx:%u, dr:%u, er:%u",
|
||||
names[ifp->state], mg_print_ip4, &ifp->ip, ifp->nrecv, ifp->nsent,
|
||||
ifp->ndrop, ifp->nerr));
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
stdio_init_all();
|
||||
MG_INFO(("Starting ..."));
|
||||
|
||||
// Init LED
|
||||
gpio_init(LED);
|
||||
gpio_set_dir(LED, GPIO_OUT);
|
||||
|
||||
static void eth_spi_init(void) {
|
||||
// Init SPI pins
|
||||
spi_init(spi0, 500 * 1000);
|
||||
gpio_set_function(SPI_RX, GPIO_FUNC_SPI); // MISO
|
||||
gpio_set_function(SPI_TX, GPIO_FUNC_SPI); // MOSI
|
||||
gpio_set_function(SPI_CLK, GPIO_FUNC_SPI); // CLK
|
||||
gpio_init(SPI_CS); // CS
|
||||
gpio_set_dir(SPI_CS, GPIO_OUT); // Set CS it to output
|
||||
gpio_set_dir(SPI_CS, GPIO_OUT); // Set CS to output
|
||||
gpio_put(SPI_CS, 1); // And drive CS high (inactive)
|
||||
}
|
||||
|
||||
// Init Mongoose
|
||||
// Helper macro for MAC generation
|
||||
#define GENERATE_LOCALLY_ADMINISTERED_MAC(id) \
|
||||
{ 2, id[3], id[4], id[5], id[6], id[7] }
|
||||
|
||||
int main(void) {
|
||||
stdio_init_all();
|
||||
gpio_init(LED); // Setup board LED
|
||||
gpio_set_dir(LED, GPIO_OUT);
|
||||
eth_spi_init(); // Initialise SPI pins
|
||||
MG_INFO(("Starting ..."));
|
||||
|
||||
pico_unique_board_id_t board_id;
|
||||
pico_get_unique_board_id(&board_id);
|
||||
uint8_t *id = board_id.id;
|
||||
|
||||
struct mg_mgr mgr; // Initialise
|
||||
mg_mgr_init(&mgr); // Mongoose event manager
|
||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||
|
||||
// Initialise Mongoose network stack
|
||||
// Specify MAC address, and IP/mask/GW in network byte order for static
|
||||
// IP configuration. If IP/mask/GW are unset, DHCP is going to be used
|
||||
struct mg_tcpip_spi spi = {NULL, spi_begin, spi_end, spi_txn};
|
||||
struct mg_tcpip_if mif = {.mac = {2, 0, 1, 2, 3, 5},
|
||||
struct mg_tcpip_if mif = {.mac = GENERATE_LOCALLY_ADMINISTERED_MAC(id),
|
||||
.driver = &mg_tcpip_driver_w5500,
|
||||
.driver_data = &spi};
|
||||
struct mg_mgr mgr; // Declare event manager
|
||||
mg_mgr_init(&mgr); // Init event manager
|
||||
mg_log_set(MG_LL_DEBUG); // Set DEBUG log level
|
||||
mg_tcpip_init(&mgr, &mif); // Init TCP/IP stack
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_cb, &mif);
|
||||
mg_tcpip_init(&mgr, &mif);
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||
|
||||
MG_INFO(("Waiting until network is up..."));
|
||||
while (mif.state != MIP_STATE_READY) {
|
||||
MG_INFO(("MAC: %M. Waiting for IP...", mg_print_mac, mif.mac));
|
||||
while (mif.state != MG_TCPIP_STATE_READY) {
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ int main(void) {
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||
|
||||
MG_INFO(("MAC: %M. Waiting for IP...", mg_print_mac, mif.mac));
|
||||
while (mif.state != MIP_STATE_READY) {
|
||||
while (mif.state != MG_TCPIP_STATE_READY) {
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ static void ethernet_init(void) {
|
||||
|
||||
static void server(void *args) {
|
||||
struct mg_mgr mgr; // Initialise Mongoose event manager
|
||||
mg_mgr_init(&mgr); // and attach it to the MIP interface
|
||||
mg_mgr_init(&mgr); // and attach it to the interface
|
||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||
|
||||
// Initialise Mongoose network stack
|
||||
@@ -60,7 +60,7 @@ static void server(void *args) {
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||
|
||||
MG_INFO(("MAC: %M. Waiting for IP...", mg_print_mac, mif.mac));
|
||||
while (mif.state != MIP_STATE_READY) {
|
||||
while (mif.state != MG_TCPIP_STATE_READY) {
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <errno.h> // we are not using lwIP
|
||||
|
||||
// See https://mongoose.ws/documentation/#build-options
|
||||
#define MG_ARCH MG_ARCH_FREERTOS
|
||||
#define MG_ENABLE_TCPIP 1
|
||||
|
||||
@@ -73,7 +73,7 @@ int main(void) {
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||
|
||||
MG_INFO(("MAC: %M. Waiting for IP...", mg_print_mac, mif.mac));
|
||||
while (mif.state != MIP_STATE_READY) {
|
||||
while (mif.state != MG_TCPIP_STATE_READY) {
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ static void ethernet_init(void) {
|
||||
|
||||
static void server(void *args) {
|
||||
struct mg_mgr mgr; // Initialise Mongoose event manager
|
||||
mg_mgr_init(&mgr); // and attach it to the MIP interface
|
||||
mg_mgr_init(&mgr); // and attach it to the interface
|
||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||
|
||||
// Initialise Mongoose network stack
|
||||
@@ -60,7 +60,7 @@ static void server(void *args) {
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||
|
||||
MG_INFO(("MAC: %M. Waiting for IP...", mg_print_mac, mif.mac));
|
||||
while (mif.state != MIP_STATE_READY) {
|
||||
while (mif.state != MG_TCPIP_STATE_READY) {
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <errno.h> // we are not using lwIP
|
||||
|
||||
// See https://mongoose.ws/documentation/#build-options
|
||||
#define MG_ARCH MG_ARCH_FREERTOS
|
||||
#define MG_ENABLE_TCPIP 1
|
||||
|
||||
@@ -8,7 +8,7 @@ LDFLAGS ?= -Tlink.ld -nostdlib -nostartfiles --specs nano.specs -lc -lgcc -Wl,--
|
||||
SOURCES = main.c syscalls.c sysinit.c
|
||||
SOURCES += cmsis_h7/Source/Templates/gcc/startup_stm32h743xx.s # ST startup file. Compiler-dependent!
|
||||
|
||||
# Mongoose-specific source code files and build options. See https://mongoose.ws/documentation/#build-options
|
||||
# Mongoose-specific. See https://mongoose.ws/documentation/#build-options
|
||||
SOURCES += mongoose.c net.c packed_fs.c
|
||||
CFLAGS += -DMG_ENABLE_TCPIP=1 -DMG_ARCH=MG_ARCH_NEWLIB -DMG_ENABLE_PACKED_FS=1
|
||||
CFLAGS += -DMG_ENABLE_CUSTOM_RANDOM=1 -DMG_ENABLE_CUSTOM_MILLIS=1
|
||||
@@ -41,11 +41,11 @@ DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/6
|
||||
update: firmware.bin
|
||||
curl --fail-with-body -su :$(VCON_API_KEY) $(DEVICE_URL)/ota --data-binary @$<
|
||||
|
||||
update test: CFLAGS_EXTRA += -DUART_DEBUG=USART1
|
||||
test update: CFLAGS_EXTRA += -DUART_DEBUG=USART1
|
||||
test: update
|
||||
curl --fail-with-body -su :$(VCON_API_KEY) $(DEVICE_URL)/tx?t=5 | tee /tmp/output.txt
|
||||
grep 'READY, IP:' /tmp/output.txt # Check for network init
|
||||
grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success
|
||||
|
||||
clean:
|
||||
@rm -rf firmware.* *.su cmsis_core cmsis_h7
|
||||
$(RM) firmware.* *.su cmsis_core cmsis_h7
|
||||
|
||||
@@ -75,7 +75,7 @@ int main(void) {
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||
|
||||
MG_INFO(("MAC: %M. Waiting for IP...", mg_print_mac, mif.mac));
|
||||
while (mif.state != MIP_STATE_READY) {
|
||||
while (mif.state != MG_TCPIP_STATE_READY) {
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/1
|
||||
update: firmware.bin
|
||||
curl --fail-with-body -su :$(VCON_API_KEY) $(DEVICE_URL)/ota --data-binary @$<
|
||||
|
||||
test update: CFLAGS_EXTRA += -DUART_DEBUG=UART1
|
||||
test update: CFLAGS_EXTRA += -DUART_DEBUG=UART0
|
||||
test: update
|
||||
curl --fail-with-body -su :$(VCON_API_KEY) $(DEVICE_URL)/tx?t=5 | tee /tmp/output.txt
|
||||
grep 'READY, IP:' /tmp/output.txt # Check for network init
|
||||
grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success
|
||||
# grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success
|
||||
|
||||
clean:
|
||||
$(RM) firmware.* *.su cmsis_core cmsis_tm4c
|
||||
|
||||
@@ -1,47 +1 @@
|
||||
# Baremetal webserver on EK-TM4C1294XL
|
||||
|
||||
This firmware uses experimental TCP/IP stack of the Mongoose Network Library,
|
||||
which implements the following:
|
||||
|
||||
- A complete [HTTP device dashboard](../../device-dashboard) with:
|
||||
- User authentication
|
||||
- Real-time device data graph
|
||||
- Coninfiguration display and update
|
||||
- MQTT communication with a remote MQTT server
|
||||
- No dependencies: no HAL, no CMSIS, no RTOS
|
||||
- Hand-written [mcu.h](mcu.h) header based on the [datasheet](https://www.ti.com/lit/pdf/spms433)
|
||||
- Interrupt-driven Ethernet driver
|
||||
- LED blinky, based on SysTick interrupt
|
||||
- User button handler, turns off/on an LED, based on GPIO IRQs (interrupt-driven)
|
||||
- HardFault handler alternate blinks LEDs
|
||||
- Debug log on UART0 (ICDI)
|
||||
|
||||
## Requirements
|
||||
|
||||
- [GNU make](http://mongoose.ws/tutorials/tools/#gnu-make)
|
||||
- [ARM GCC](http://mongoose.ws/tutorials/tools/#arm-gcc)
|
||||
- [Uniflash](https://mongoose.ws/tutorials/ti/ek-tm4c1294xl-baremetal/#build-and-run) for flashing
|
||||
|
||||
The links above will send you to tutorials on how to install each of those tools in your workstation for Linux, Mac, and Windows.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
Plugin your board into USB, and attach an Ethernet cable.
|
||||
To build:
|
||||
|
||||
```sh
|
||||
$ make clean build
|
||||
```
|
||||
|
||||
To flash: use Uniflash
|
||||
|
||||
To see debug log, use any serial monitor program like `picocom` at 115200 bps and configure it to insert carriage returns after line feeds:
|
||||
|
||||
```sh
|
||||
$ picocom /dev/ttyACM0 -i -b 115200 --imap=lfcrlf
|
||||
```
|
||||
|
||||
There is also a [detailed tutorial on this example](https://mongoose.ws/tutorials/ti/ek-tm4c1294xl-baremetal/)
|
||||
|
||||
For more details and benchmark data on MIP, check the [F746ZG example](../../stm32/nucleo-f746zg-baremetal/)
|
||||
See detailed tutorial at https://mongoose.ws/tutorials/ti/ek-tm4c1294xl-baremetal/
|
||||
|
||||
@@ -133,22 +133,18 @@ static inline void gpio_irq_attach(uint16_t pin) {
|
||||
#define UARTNO(u) ((uint8_t) (((unsigned int) (u) -UART0_BASE) / UART_OFFSET))
|
||||
|
||||
static inline void uart_init(UART0_Type *uart, unsigned long baud) {
|
||||
struct uarthw {
|
||||
uint16_t rx, tx; // pins
|
||||
uint8_t af; // Alternate function
|
||||
};
|
||||
// rx, tx, af for UART0,1,2
|
||||
struct uarthw uarthw[3] = {{PIN('A', 0), PIN('A', 1), 1},
|
||||
{PIN('B', 0), PIN('B', 1), 1},
|
||||
{PIN('A', 6), PIN('A', 7), 1}}; // or PD4, PD5...
|
||||
|
||||
uint8_t af = 1; // Alternate function
|
||||
uint16_t rx = 0, tx = 0; // pins
|
||||
uint8_t uartno = UARTNO(uart);
|
||||
|
||||
SYSCTL->RCGCUART |= BIT(uartno); // Enable peripheral clock
|
||||
|
||||
gpio_init(uarthw[uartno].tx, GPIO_MODE_AF, GPIO_OTYPE_PUSH_PULL,
|
||||
GPIO_SPEED_HIGH, 0, uarthw[uartno].af);
|
||||
gpio_init(uarthw[uartno].rx, GPIO_MODE_AF, GPIO_OTYPE_PUSH_PULL,
|
||||
GPIO_SPEED_HIGH, 0, uarthw[uartno].af);
|
||||
if (uart == UART0) tx = PIN('A', 0), rx = PIN('A', 1);
|
||||
if (uart == UART1) tx = PIN('B', 0), rx = PIN('B', 1);
|
||||
if (uart == UART2) tx = PIN('A', 6), rx = PIN('A', 7); // or PD4, PD5...
|
||||
|
||||
gpio_init(tx, GPIO_MODE_AF, GPIO_OTYPE_PUSH_PULL, GPIO_SPEED_HIGH, 0, af);
|
||||
gpio_init(rx, GPIO_MODE_AF, GPIO_OTYPE_PUSH_PULL, GPIO_SPEED_HIGH, 0, af);
|
||||
// (16.3.2) ClkDiv = 16 (HSE=0)
|
||||
// BRD = BRDI + BRDF = UARTSysClk / (ClkDiv * Baud Rate)
|
||||
// UARTFBRD[DIVFRAC] = integer(BRDF * 64 + 0.5)
|
||||
|
||||
@@ -84,7 +84,7 @@ int main(void) {
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||
|
||||
MG_INFO(("MAC: %M. Waiting for IP...", mg_print_mac, mif.mac));
|
||||
while (mif.state != MIP_STATE_READY) {
|
||||
while (mif.state != MG_TCPIP_STATE_READY) {
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@ DEVICE_URL ?= https://dash.vcon.io/api/v3/devices/1
|
||||
update: firmware.bin
|
||||
curl --fail-with-body -su :$(VCON_API_KEY) $(DEVICE_URL)/ota --data-binary @$<
|
||||
|
||||
test update: CFLAGS_EXTRA += -DUART_DEBUG=UART1
|
||||
test update: CFLAGS_EXTRA += -DUART_DEBUG=UART0
|
||||
test: update
|
||||
curl --fail-with-body -su :$(VCON_API_KEY) $(DEVICE_URL)/tx?t=5 | tee /tmp/output.txt
|
||||
grep 'READY, IP:' /tmp/output.txt # Check for network init
|
||||
grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success
|
||||
# grep 'MQTT connected' /tmp/output.txt # Check for MQTT connection success
|
||||
|
||||
clean:
|
||||
$(RM) firmware.* *.su cmsis_core cmsis_tm4c FreeRTOS-Kernel
|
||||
|
||||
@@ -48,7 +48,7 @@ static void ethernet_init(void) {
|
||||
|
||||
static void server(void *args) {
|
||||
struct mg_mgr mgr; // Initialise Mongoose event manager
|
||||
mg_mgr_init(&mgr); // and attach it to the MIP interface
|
||||
mg_mgr_init(&mgr); // and attach it to the interface
|
||||
mg_log_set(MG_LL_DEBUG); // Set log level
|
||||
|
||||
// Initialise Mongoose network stack
|
||||
@@ -69,7 +69,7 @@ static void server(void *args) {
|
||||
mg_timer_add(&mgr, BLINK_PERIOD_MS, MG_TIMER_REPEAT, timer_fn, &mif);
|
||||
|
||||
MG_INFO(("MAC: %M. Waiting for IP...", mg_print_mac, mif.mac));
|
||||
while (mif.state != MIP_STATE_READY) {
|
||||
while (mif.state != MG_TCPIP_STATE_READY) {
|
||||
mg_mgr_poll(&mgr, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <errno.h> // we are not using lwIP
|
||||
|
||||
// See https://mongoose.ws/documentation/#build-options
|
||||
#define MG_ARCH MG_ARCH_FREERTOS
|
||||
#define MG_ENABLE_TCPIP 1
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
# Zephyr Project examples
|
||||
|
||||
## Building
|
||||
- See detailed tutorial at https://mongoose.ws/tutorials/zephyr/device-dashboard/
|
||||
|
||||
- Run `make zephyr`, this will clone the Zephyr Project repo or update it if you've already done it before
|
||||
- Now you can build the project, follow one of this options:
|
||||
The tutorial is specific for the Device Dashboard example but [build instructions](https://mongoose.ws/tutorials/zephyr/device-dashboard/#build-and-run) are generic
|
||||
|
||||
### Trying on a simulated board
|
||||
|
||||
The default board is an x86 machine that can be simulated with QEMU, and runs inside a _Docker_ container, you only need to have _Docker_ installed. Its Ethernet is also simulated and uses the TUN/TAP interface.
|
||||
You'll need a TUN/TAP interface (default name is _tap0_) on your host machine; follow the instructions [here](https://github.com/cesanta/mongoose/tree/master/examples/mip-tap#linux-setup) to configure your network to provide a suitable networking environment.
|
||||
- Run `make build`. The interface configuration on the simulated machine side is in the file _overlay-e1000.conf_, and defaults to _tap0_. You can change this overlay file adding an `OVERLAY` argument (e.g.: *make build OVERLAY="-DOVERLAY_CONFIG=something"*).
|
||||
- Once the build succeeds, run `make run` to run the target. The default _Docker_ configuration is to share _/dev/net/tun_; if this does not work for you, pass the necessary _Docker_ parameters inside `SHARETUN` (e.g.: *make run SHARETUN=something*).
|
||||
## Optional: Using a simulated board
|
||||
|
||||
### Using a real board
|
||||
For testing purposes, we build for an x86 target that can be simulated with QEMU, and runs inside a _Docker_ container. Its Ethernet interface is also simulated, and uses the TUN/TAP interface. You can use this to try the examples or for your own development with Zephyr, without the need to have an actual board connected; you only need to have _Docker_ installed as the Zephyr Docker image handles the emulation for you.
|
||||
|
||||
- Run `make build BOARD=yourboardname` (e.g.: *make build BOARD=nucleo_f746zg*)
|
||||
- Once the build succeeds, run `make flash`. The Makefile shares the USB bus with the _Docker_ container, this works well with ST-Link and J-Link devices. If this does not work for you, pass the necessary _Docker_ parameters inside `SHAREUSB` (e.g.: *make flash SHAREUSB=something*)
|
||||
- The generated ELF file is at _build/zephyr_
|
||||
|
||||
## Cleaning up
|
||||
|
||||
- You can run `make clean` to clean up the build files but keep the configuration files, which speeds the next build
|
||||
- If you do major changes (like compiling for a different board...), run `make pristine` to clean up everything under the _build_ directory.
|
||||
- You'll need a TUN/TAP interface (default name is _tap0_) on your host machine; follow the instructions [here](https://github.com/cesanta/mongoose/tree/master/examples/mip-tap#linux-setup) to configure your network to provide a suitable networking environment.
|
||||
- Run `make build BUILD_ARGS="-b qemu_x86" OVERLAY="-DOVERLAY_CONFIG=overlay-e1000.conf"`.
|
||||
- The interface configuration on the simulated machine side is in the file _overlay-e1000.conf_, and defaults to _tap0_. You can change this file or specify a different one by changing the `OVERLAY_CONFIG` argument above.
|
||||
- Once the build succeeds, run `make run` to run the target. The default _Docker_ configuration is to share _/dev/net/tun_; if this does not work for you, pass the necessary _Docker_ parameters to _make_ with a `DOCKER_ARGS=` argument.
|
||||
|
||||
@@ -1,61 +1,46 @@
|
||||
MONGOOSE_ROOT ?= $(realpath $(CURDIR)/../../..)
|
||||
DOCKER_PROJECT_DIR ?= /workdir
|
||||
ZEPHYR_DIR ?= zephyrproject
|
||||
PROJECT_NAME = $(notdir $(CURDIR))
|
||||
PROJECT_PATH = $(realpath $(CURDIR))
|
||||
ZEPHYR_PATH = $(realpath $(CURDIR)/..)/$(ZEPHYR_DIR)
|
||||
DOCKER_PROJECT_PATH = $(DOCKER_PROJECT_DIR)/$(PROJECT_NAME)
|
||||
DOCKER_ZEPHYR_PATH = $(DOCKER_PROJECT_DIR)/$(ZEPHYR_DIR)
|
||||
|
||||
BOARD ?= qemu_x86
|
||||
ifeq "$(BOARD)" "qemu_x86"
|
||||
OVERLAY ?= -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
else
|
||||
OVERLAY ?=
|
||||
endif
|
||||
|
||||
SHAREUSB ?= --privileged -v /dev/bus/usb/:/dev/bus/usb
|
||||
SHARETUN ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host
|
||||
DOCKER ?= docker run --rm -v $(PROJECT_PATH):$(DOCKER_PROJECT_PATH) -v $(ZEPHYR_PATH):$(DOCKER_ZEPHYR_PATH)
|
||||
REPO ?= zephyrprojectrtos/ci
|
||||
|
||||
TOP_DIR ?= $(realpath $(CURDIR)/../../..)
|
||||
ZEPHYR_DIR ?= $(realpath $(CURDIR)/..)/zephyrproject
|
||||
DOCKER ?= docker run --rm \
|
||||
-v $(TOP_DIR):$(TOP_DIR) \
|
||||
-w $(realpath $(CURDIR)) \
|
||||
-e ZEPHYR_BASE=$(ZEPHYR_DIR)/zephyr \
|
||||
$(DOCKER_ARGS) zephyrprojectrtos/ci
|
||||
BUILD_ARGS ?= -b nucleo_f746zg
|
||||
.PHONY: build
|
||||
|
||||
example:
|
||||
true
|
||||
|
||||
build:
|
||||
cp $(MONGOOSE_ROOT)/mongoose.[ch] src/
|
||||
cp $(MONGOOSE_ROOT)/examples/device-dashboard/net.c src/
|
||||
cp $(MONGOOSE_ROOT)/examples/device-dashboard/packed_fs.c src/
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH)/zephyr && \
|
||||
west build -b $(BOARD) -p auto $(DOCKER_PROJECT_PATH) $(OVERLAY) --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
zephyr:
|
||||
test -d $(ZEPHYR_DIR) || ( mkdir -p $(ZEPHYR_DIR) ; $(DOCKER) west init $(ZEPHYR_DIR))
|
||||
$(DOCKER) sh -c 'cd $(ZEPHYR_DIR) && west update'
|
||||
|
||||
build:
|
||||
cp $(TOP_DIR)/mongoose.[ch] src/
|
||||
cp $(TOP_DIR)/examples/device-dashboard/net.c src/
|
||||
cp $(TOP_DIR)/examples/device-dashboard/packed_fs.c src/
|
||||
$(DOCKER) west build $(BUILD_ARGS) -p auto $(realpath $(CURDIR)) $(OVERLAY)
|
||||
|
||||
run: DOCKER_ARGS ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host -it
|
||||
run:
|
||||
$(DOCKER) -it $(SHARETUN) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t run --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west build -t run
|
||||
|
||||
clean:
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t clean --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
-$(DOCKER) west build -t clean
|
||||
|
||||
pristine:
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t pristine --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
-$(DOCKER) west build -t pristine
|
||||
|
||||
purge: clean pristine
|
||||
rm -rf $(TOP_DIR)/.west $(ZEPHYR_DIR) build
|
||||
|
||||
flash debug: DOCKER_ARGS ?= --privileged -v /dev/bus/usb/:/dev/bus/usb -it
|
||||
flash:
|
||||
$(DOCKER) $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west flash --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west flash --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
debug:
|
||||
$(DOCKER) -it $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west debug --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west debug --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
.PHONY: build flash zephyr clean pristine run
|
||||
|
||||
zephyr:
|
||||
ifeq ($(wildcard $(ZEPHYR_PATH)/.*),)
|
||||
mkdir $(ZEPHYR_PATH)
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_PROJECT_DIR) && west init ./$(ZEPHYR_DIR)'
|
||||
endif
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && west update'
|
||||
test: BUILD_ARGS = -b qemu_x86
|
||||
test: OVERLAY = -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
test: build run
|
||||
|
||||
@@ -5,8 +5,7 @@ DOCKER ?= docker run --rm \
|
||||
-w $(realpath $(CURDIR)) \
|
||||
-e ZEPHYR_BASE=$(ZEPHYR_DIR)/zephyr \
|
||||
$(DOCKER_ARGS) zephyrprojectrtos/ci
|
||||
#BUILD_ARGS ?= -b qemu_x86 -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
BUILD_ARGS ?= -b nucleo_f429zi
|
||||
BUILD_ARGS ?= -b nucleo_f746zg
|
||||
.PHONY: build
|
||||
|
||||
example:
|
||||
@@ -18,7 +17,7 @@ zephyr:
|
||||
|
||||
build:
|
||||
cp $(TOP_DIR)/mongoose.[ch] src/
|
||||
$(DOCKER) west build $(BUILD_ARGS) -p auto $(realpath $(CURDIR))
|
||||
$(DOCKER) west build $(BUILD_ARGS) -p auto $(realpath $(CURDIR)) $(OVERLAY)
|
||||
|
||||
run: DOCKER_ARGS ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host -it
|
||||
run:
|
||||
@@ -39,3 +38,7 @@ flash:
|
||||
|
||||
debug:
|
||||
$(DOCKER) west debug --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
test: BUILD_ARGS = -b qemu_x86
|
||||
test: OVERLAY = -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
test: build run
|
||||
|
||||
@@ -1,59 +1,44 @@
|
||||
MONGOOSE_ROOT ?= $(realpath $(CURDIR)/../../..)
|
||||
DOCKER_PROJECT_DIR ?= /workdir
|
||||
ZEPHYR_DIR ?= zephyrproject
|
||||
PROJECT_NAME = $(notdir $(CURDIR))
|
||||
PROJECT_PATH = $(realpath $(CURDIR))
|
||||
ZEPHYR_PATH = $(realpath $(CURDIR)/..)/$(ZEPHYR_DIR)
|
||||
DOCKER_PROJECT_PATH = $(DOCKER_PROJECT_DIR)/$(PROJECT_NAME)
|
||||
DOCKER_ZEPHYR_PATH = $(DOCKER_PROJECT_DIR)/$(ZEPHYR_DIR)
|
||||
|
||||
BOARD ?= qemu_x86
|
||||
ifeq "$(BOARD)" "qemu_x86"
|
||||
OVERLAY ?= -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
else
|
||||
OVERLAY ?=
|
||||
endif
|
||||
|
||||
SHAREUSB ?= --privileged -v /dev/bus/usb/:/dev/bus/usb
|
||||
SHARETUN ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host
|
||||
DOCKER ?= docker run --rm -v $(PROJECT_PATH):$(DOCKER_PROJECT_PATH) -v $(ZEPHYR_PATH):$(DOCKER_ZEPHYR_PATH)
|
||||
REPO ?= zephyrprojectrtos/ci
|
||||
|
||||
TOP_DIR ?= $(realpath $(CURDIR)/../../..)
|
||||
ZEPHYR_DIR ?= $(realpath $(CURDIR)/..)/zephyrproject
|
||||
DOCKER ?= docker run --rm \
|
||||
-v $(TOP_DIR):$(TOP_DIR) \
|
||||
-w $(realpath $(CURDIR)) \
|
||||
-e ZEPHYR_BASE=$(ZEPHYR_DIR)/zephyr \
|
||||
$(DOCKER_ARGS) zephyrprojectrtos/ci
|
||||
BUILD_ARGS ?= -b nucleo_f746zg
|
||||
.PHONY: build
|
||||
|
||||
example:
|
||||
true
|
||||
|
||||
build:
|
||||
cp $(MONGOOSE_ROOT)/mongoose.[ch] src/
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH)/zephyr && \
|
||||
west build -b $(BOARD) -p auto $(DOCKER_PROJECT_PATH) $(OVERLAY) --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
zephyr:
|
||||
test -d $(ZEPHYR_DIR) || ( mkdir -p $(ZEPHYR_DIR) ; $(DOCKER) west init $(ZEPHYR_DIR))
|
||||
$(DOCKER) sh -c 'cd $(ZEPHYR_DIR) && west update'
|
||||
|
||||
build:
|
||||
cp $(TOP_DIR)/mongoose.[ch] src/
|
||||
$(DOCKER) west build $(BUILD_ARGS) -p auto $(realpath $(CURDIR)) $(OVERLAY)
|
||||
|
||||
run: DOCKER_ARGS ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host -it
|
||||
run:
|
||||
$(DOCKER) -it $(SHARETUN) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t run --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west build -t run
|
||||
|
||||
clean:
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t clean --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
-$(DOCKER) west build -t clean
|
||||
|
||||
pristine:
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t pristine --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
-$(DOCKER) west build -t pristine
|
||||
|
||||
purge: clean pristine
|
||||
rm -rf $(TOP_DIR)/.west $(ZEPHYR_DIR) build
|
||||
|
||||
flash debug: DOCKER_ARGS ?= --privileged -v /dev/bus/usb/:/dev/bus/usb -it
|
||||
flash:
|
||||
$(DOCKER) $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west flash --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west flash --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
debug:
|
||||
$(DOCKER) -it $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west debug --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west debug --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
.PHONY: build flash zephyr clean pristine run
|
||||
|
||||
zephyr:
|
||||
ifeq ($(wildcard $(ZEPHYR_PATH)/.*),)
|
||||
mkdir $(ZEPHYR_PATH)
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_PROJECT_DIR) && west init ./$(ZEPHYR_DIR)'
|
||||
endif
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && west update'
|
||||
test: BUILD_ARGS = -b qemu_x86
|
||||
test: OVERLAY = -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
test: build run
|
||||
|
||||
@@ -1,59 +1,44 @@
|
||||
MONGOOSE_ROOT ?= $(realpath $(CURDIR)/../../..)
|
||||
DOCKER_PROJECT_DIR ?= /workdir
|
||||
ZEPHYR_DIR ?= zephyrproject
|
||||
PROJECT_NAME = $(notdir $(CURDIR))
|
||||
PROJECT_PATH = $(realpath $(CURDIR))
|
||||
ZEPHYR_PATH = $(realpath $(CURDIR)/..)/$(ZEPHYR_DIR)
|
||||
DOCKER_PROJECT_PATH = $(DOCKER_PROJECT_DIR)/$(PROJECT_NAME)
|
||||
DOCKER_ZEPHYR_PATH = $(DOCKER_PROJECT_DIR)/$(ZEPHYR_DIR)
|
||||
|
||||
BOARD ?= qemu_x86
|
||||
ifeq "$(BOARD)" "qemu_x86"
|
||||
OVERLAY ?= -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
else
|
||||
OVERLAY ?=
|
||||
endif
|
||||
|
||||
SHAREUSB ?= --privileged -v /dev/bus/usb/:/dev/bus/usb
|
||||
SHARETUN ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host
|
||||
DOCKER ?= docker run --rm -v $(PROJECT_PATH):$(DOCKER_PROJECT_PATH) -v $(ZEPHYR_PATH):$(DOCKER_ZEPHYR_PATH)
|
||||
REPO ?= zephyrprojectrtos/ci
|
||||
|
||||
TOP_DIR ?= $(realpath $(CURDIR)/../../..)
|
||||
ZEPHYR_DIR ?= $(realpath $(CURDIR)/..)/zephyrproject
|
||||
DOCKER ?= docker run --rm \
|
||||
-v $(TOP_DIR):$(TOP_DIR) \
|
||||
-w $(realpath $(CURDIR)) \
|
||||
-e ZEPHYR_BASE=$(ZEPHYR_DIR)/zephyr \
|
||||
$(DOCKER_ARGS) zephyrprojectrtos/ci
|
||||
BUILD_ARGS ?= -b nucleo_f746zg
|
||||
.PHONY: build
|
||||
|
||||
example:
|
||||
true
|
||||
|
||||
build:
|
||||
cp $(MONGOOSE_ROOT)/mongoose.[ch] src/
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH)/zephyr && \
|
||||
west build -b $(BOARD) -p auto $(DOCKER_PROJECT_PATH) $(OVERLAY) --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
zephyr:
|
||||
test -d $(ZEPHYR_DIR) || ( mkdir -p $(ZEPHYR_DIR) ; $(DOCKER) west init $(ZEPHYR_DIR))
|
||||
$(DOCKER) sh -c 'cd $(ZEPHYR_DIR) && west update'
|
||||
|
||||
build:
|
||||
cp $(TOP_DIR)/mongoose.[ch] src/
|
||||
$(DOCKER) west build $(BUILD_ARGS) -p auto $(realpath $(CURDIR)) $(OVERLAY)
|
||||
|
||||
run: DOCKER_ARGS ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host -it
|
||||
run:
|
||||
$(DOCKER) -it $(SHARETUN) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t run --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west build -t run
|
||||
|
||||
clean:
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t clean --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
-$(DOCKER) west build -t clean
|
||||
|
||||
pristine:
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t pristine --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
-$(DOCKER) west build -t pristine
|
||||
|
||||
purge: clean pristine
|
||||
rm -rf $(TOP_DIR)/.west $(ZEPHYR_DIR) build
|
||||
|
||||
flash debug: DOCKER_ARGS ?= --privileged -v /dev/bus/usb/:/dev/bus/usb -it
|
||||
flash:
|
||||
$(DOCKER) $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west flash --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west flash --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
debug:
|
||||
$(DOCKER) -it $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west debug --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west debug --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
.PHONY: build flash zephyr clean pristine run
|
||||
|
||||
zephyr:
|
||||
ifeq ($(wildcard $(ZEPHYR_PATH)/.*),)
|
||||
mkdir $(ZEPHYR_PATH)
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_PROJECT_DIR) && west init ./$(ZEPHYR_DIR)'
|
||||
endif
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && west update'
|
||||
test: BUILD_ARGS = -b qemu_x86
|
||||
test: OVERLAY = -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
test: build run
|
||||
|
||||
@@ -1,59 +1,44 @@
|
||||
MONGOOSE_ROOT ?= $(realpath $(CURDIR)/../../..)
|
||||
DOCKER_PROJECT_DIR ?= /workdir
|
||||
ZEPHYR_DIR ?= zephyrproject
|
||||
PROJECT_NAME = $(notdir $(CURDIR))
|
||||
PROJECT_PATH = $(realpath $(CURDIR))
|
||||
ZEPHYR_PATH = $(realpath $(CURDIR)/..)/$(ZEPHYR_DIR)
|
||||
DOCKER_PROJECT_PATH = $(DOCKER_PROJECT_DIR)/$(PROJECT_NAME)
|
||||
DOCKER_ZEPHYR_PATH = $(DOCKER_PROJECT_DIR)/$(ZEPHYR_DIR)
|
||||
|
||||
BOARD ?= qemu_x86
|
||||
ifeq "$(BOARD)" "qemu_x86"
|
||||
OVERLAY ?= -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
else
|
||||
OVERLAY ?=
|
||||
endif
|
||||
|
||||
SHAREUSB ?= --privileged -v /dev/bus/usb/:/dev/bus/usb
|
||||
SHARETUN ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host
|
||||
DOCKER ?= docker run --rm -v $(PROJECT_PATH):$(DOCKER_PROJECT_PATH) -v $(ZEPHYR_PATH):$(DOCKER_ZEPHYR_PATH)
|
||||
REPO ?= zephyrprojectrtos/ci
|
||||
|
||||
TOP_DIR ?= $(realpath $(CURDIR)/../../..)
|
||||
ZEPHYR_DIR ?= $(realpath $(CURDIR)/..)/zephyrproject
|
||||
DOCKER ?= docker run --rm \
|
||||
-v $(TOP_DIR):$(TOP_DIR) \
|
||||
-w $(realpath $(CURDIR)) \
|
||||
-e ZEPHYR_BASE=$(ZEPHYR_DIR)/zephyr \
|
||||
$(DOCKER_ARGS) zephyrprojectrtos/ci
|
||||
BUILD_ARGS ?= -b nucleo_f746zg
|
||||
.PHONY: build
|
||||
|
||||
example:
|
||||
true
|
||||
|
||||
build:
|
||||
cp $(MONGOOSE_ROOT)/mongoose.[ch] src/
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH)/zephyr && \
|
||||
west build -b $(BOARD) -p auto $(DOCKER_PROJECT_PATH) $(OVERLAY) --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
zephyr:
|
||||
test -d $(ZEPHYR_DIR) || ( mkdir -p $(ZEPHYR_DIR) ; $(DOCKER) west init $(ZEPHYR_DIR))
|
||||
$(DOCKER) sh -c 'cd $(ZEPHYR_DIR) && west update'
|
||||
|
||||
build:
|
||||
cp $(TOP_DIR)/mongoose.[ch] src/
|
||||
$(DOCKER) west build $(BUILD_ARGS) -p auto $(realpath $(CURDIR)) $(OVERLAY)
|
||||
|
||||
run: DOCKER_ARGS ?= --cap-add=NET_ADMIN --device /dev/net/tun --net=host -it
|
||||
run:
|
||||
$(DOCKER) -it $(SHARETUN) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t run --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west build -t run
|
||||
|
||||
clean:
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t clean --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
-$(DOCKER) west build -t clean
|
||||
|
||||
pristine:
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west build -t pristine --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
-$(DOCKER) west build -t pristine
|
||||
|
||||
purge: clean pristine
|
||||
rm -rf $(TOP_DIR)/.west $(ZEPHYR_DIR) build
|
||||
|
||||
flash debug: DOCKER_ARGS ?= --privileged -v /dev/bus/usb/:/dev/bus/usb -it
|
||||
flash:
|
||||
$(DOCKER) $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west flash --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west flash --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
debug:
|
||||
$(DOCKER) -it $(SHAREUSB) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && \
|
||||
west debug --build-dir $(DOCKER_PROJECT_PATH)/build'
|
||||
$(DOCKER) west debug --build-dir $(realpath $(CURDIR))/build
|
||||
|
||||
.PHONY: build flash zephyr clean pristine run
|
||||
|
||||
zephyr:
|
||||
ifeq ($(wildcard $(ZEPHYR_PATH)/.*),)
|
||||
mkdir $(ZEPHYR_PATH)
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_PROJECT_DIR) && west init ./$(ZEPHYR_DIR)'
|
||||
endif
|
||||
$(DOCKER) $(REPO) /bin/sh -c 'cd $(DOCKER_ZEPHYR_PATH) && west update'
|
||||
test: BUILD_ARGS = -b qemu_x86
|
||||
test: OVERLAY = -DOVERLAY_CONFIG=overlay-e1000.conf
|
||||
test: build run
|
||||
|
||||
@@ -4250,7 +4250,7 @@ static void mg_set_non_blocking_mode(MG_SOCKET_TYPE fd) {
|
||||
#elif MG_ARCH == MG_ARCH_WIN32 && MG_ENABLE_WINSOCK
|
||||
unsigned long on = 1;
|
||||
ioctlsocket(fd, FIONBIO, &on);
|
||||
#elif MG_ARCH == MG_ARCH_RTX
|
||||
#elif MG_ENABLE_RL
|
||||
unsigned long on = 1;
|
||||
ioctlsocket(fd, FIONBIO, &on);
|
||||
#elif MG_ENABLE_FREERTOS_TCP
|
||||
@@ -4598,8 +4598,9 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
|
||||
EventBits_t bits = FreeRTOS_FD_ISSET(c->fd, mgr->ss);
|
||||
c->is_readable = bits & (eSELECT_READ | eSELECT_EXCEPT) ? 1U : 0;
|
||||
c->is_writable = bits & eSELECT_WRITE ? 1U : 0;
|
||||
FreeRTOS_FD_CLR(c->fd, mgr->ss,
|
||||
eSELECT_READ | eSELECT_EXCEPT | eSELECT_WRITE);
|
||||
if (c->fd != MG_INVALID_SOCKET)
|
||||
FreeRTOS_FD_CLR(c->fd, mgr->ss,
|
||||
eSELECT_READ | eSELECT_EXCEPT | eSELECT_WRITE);
|
||||
}
|
||||
#elif MG_ENABLE_EPOLL
|
||||
size_t max = 1;
|
||||
@@ -5734,6 +5735,10 @@ uint64_t mg_millis(void) {
|
||||
return (uint64_t) Clock_getTicks();
|
||||
#elif MG_ARCH == MG_ARCH_ZEPHYR
|
||||
return (uint64_t) k_uptime_get();
|
||||
#elif MG_ARCH == MG_ARCH_CMSIS_RTOS1
|
||||
return (uint64_t)rt_time_get();
|
||||
#elif MG_ARCH == MG_ARCH_CMSIS_RTOS2
|
||||
return (uint64_t)((osKernelGetTickCount() * 1000) / osKernelGetTickFreq());
|
||||
#elif MG_ARCH == MG_ARCH_UNIX && defined(__APPLE__)
|
||||
// Apple CLOCK_MONOTONIC_RAW is equivalent to CLOCK_BOOTTIME on linux
|
||||
// Apple CLOCK_UPTIME_RAW is equivalent to CLOCK_MONOTONIC_RAW on linux
|
||||
@@ -6511,7 +6516,7 @@ static size_t mg_tcpip_driver_stm32_tx(const void *buf, size_t len,
|
||||
static bool mg_tcpip_driver_stm32_up(struct mg_tcpip_if *ifp) {
|
||||
uint32_t bsr = eth_read_phy(PHY_ADDR, PHY_BSR);
|
||||
bool up = bsr & BIT(2) ? 1 : 0;
|
||||
if ((ifp->state == MIP_STATE_DOWN) && up) { // link state just went up
|
||||
if ((ifp->state == MG_TCPIP_STATE_DOWN) && up) { // link state just went up
|
||||
uint32_t scsr = eth_read_phy(PHY_ADDR, PHY_CSCR);
|
||||
uint32_t maccr = ETH->MACCR | BIT(14) | BIT(11); // 100M, Full-duplex
|
||||
if ((scsr & BIT(3)) == 0) maccr &= ~BIT(14); // 10M
|
||||
@@ -6787,7 +6792,7 @@ static size_t mg_tcpip_driver_stm32h_tx(const void *buf, size_t len,
|
||||
static bool mg_tcpip_driver_stm32h_up(struct mg_tcpip_if *ifp) {
|
||||
uint32_t bsr = eth_read_phy(PHY_ADDR, PHY_BSR);
|
||||
bool up = bsr & BIT(2) ? 1 : 0;
|
||||
if ((ifp->state == MIP_STATE_DOWN) && up) { // link state just went up
|
||||
if ((ifp->state == MG_TCPIP_STATE_DOWN) && up) { // link state just went up
|
||||
uint32_t scsr = eth_read_phy(PHY_ADDR, PHY_CSCR);
|
||||
uint32_t maccr = ETH->MACCR | BIT(14) | BIT(13); // 100M, Full-duplex
|
||||
if ((scsr & BIT(3)) == 0) maccr &= ~BIT(14); // 10M
|
||||
@@ -7042,7 +7047,7 @@ static size_t mg_tcpip_driver_tm4c_tx(const void *buf, size_t len,
|
||||
static bool mg_tcpip_driver_tm4c_up(struct mg_tcpip_if *ifp) {
|
||||
uint32_t bmsr = emac_read_phy(EPHY_ADDR, EPHYBMSR);
|
||||
bool up = (bmsr & BIT(2)) ? 1 : 0;
|
||||
if ((ifp->state == MIP_STATE_DOWN) && up) { // link state just went up
|
||||
if ((ifp->state == MG_TCPIP_STATE_DOWN) && up) { // link state just went up
|
||||
uint32_t sts = emac_read_phy(EPHY_ADDR, EPHYSTS);
|
||||
uint32_t emaccfg = EMAC->EMACCFG | BIT(14) | BIT(11); // 100M, Full-duplex
|
||||
if (sts & BIT(1)) emaccfg &= ~BIT(14); // 10M
|
||||
@@ -7352,7 +7357,7 @@ static void arp_ask(struct mg_tcpip_if *ifp, uint32_t ip) {
|
||||
}
|
||||
|
||||
static void onstatechange(struct mg_tcpip_if *ifp) {
|
||||
if (ifp->state == MIP_STATE_READY) {
|
||||
if (ifp->state == MG_TCPIP_STATE_READY) {
|
||||
MG_INFO(("READY, IP: %M", mg_print_ip4, &ifp->ip));
|
||||
MG_INFO((" GW: %M", mg_print_ip4, &ifp->gw));
|
||||
if (ifp->lease_expire > ifp->now) {
|
||||
@@ -7360,10 +7365,10 @@ static void onstatechange(struct mg_tcpip_if *ifp) {
|
||||
(" Lease: %lld sec", (ifp->lease_expire - ifp->now) / 1000));
|
||||
}
|
||||
arp_ask(ifp, ifp->gw);
|
||||
} else if (ifp->state == MIP_STATE_UP) {
|
||||
} else if (ifp->state == MG_TCPIP_STATE_UP) {
|
||||
MG_ERROR(("Link up"));
|
||||
srand((unsigned int) mg_millis());
|
||||
} else if (ifp->state == MIP_STATE_DOWN) {
|
||||
} else if (ifp->state == MG_TCPIP_STATE_DOWN) {
|
||||
MG_ERROR(("Link down"));
|
||||
}
|
||||
}
|
||||
@@ -7533,7 +7538,7 @@ static void rx_dhcp_client(struct mg_tcpip_if *ifp, struct pkt *pkt) {
|
||||
if (ip && mask && gw && ifp->ip == 0) {
|
||||
memcpy(ifp->gwmac, pkt->eth->src, sizeof(ifp->gwmac));
|
||||
ifp->ip = ip, ifp->gw = gw, ifp->mask = mask;
|
||||
ifp->state = MIP_STATE_READY;
|
||||
ifp->state = MG_TCPIP_STATE_READY;
|
||||
onstatechange(ifp);
|
||||
tx_dhcp_request(ifp, pkt->eth->src, ip, pkt->dhcp->siaddr);
|
||||
uint64_t rand;
|
||||
@@ -7916,16 +7921,16 @@ static void mg_tcpip_poll(struct mg_tcpip_if *ifp, uint64_t uptime_ms) {
|
||||
// Handle physical interface up/down status
|
||||
if (expired_1000ms && ifp->driver->up) {
|
||||
bool up = ifp->driver->up(ifp);
|
||||
bool current = ifp->state != MIP_STATE_DOWN;
|
||||
bool current = ifp->state != MG_TCPIP_STATE_DOWN;
|
||||
if (up != current) {
|
||||
ifp->state = up == false ? MIP_STATE_DOWN
|
||||
: ifp->enable_dhcp_client ? MIP_STATE_UP
|
||||
: MIP_STATE_READY;
|
||||
ifp->state = up == false ? MG_TCPIP_STATE_DOWN
|
||||
: ifp->enable_dhcp_client ? MG_TCPIP_STATE_UP
|
||||
: MG_TCPIP_STATE_READY;
|
||||
if (!up && ifp->enable_dhcp_client) ifp->ip = 0;
|
||||
onstatechange(ifp);
|
||||
}
|
||||
}
|
||||
if (ifp->state == MIP_STATE_DOWN) return;
|
||||
if (ifp->state == MG_TCPIP_STATE_DOWN) return;
|
||||
|
||||
// If IP not configured, send DHCP
|
||||
if (ifp->ip == 0 && expired_1000ms) tx_dhcp_discover(ifp);
|
||||
@@ -8109,7 +8114,7 @@ void mg_mgr_poll(struct mg_mgr *mgr, int ms) {
|
||||
bool mg_send(struct mg_connection *c, const void *buf, size_t len) {
|
||||
struct mg_tcpip_if *ifp = (struct mg_tcpip_if *) c->mgr->priv;
|
||||
bool res = false;
|
||||
if (ifp->ip == 0 || ifp->state != MIP_STATE_READY) {
|
||||
if (ifp->ip == 0 || ifp->state != MG_TCPIP_STATE_READY) {
|
||||
mg_error(c, "net down");
|
||||
} else if (c->is_udp) {
|
||||
struct connstate *s = (struct connstate *) (c + 1);
|
||||
|
||||
@@ -27,18 +27,20 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define MG_ARCH_CUSTOM 0 // User creates its own mongoose_custom.h
|
||||
#define MG_ARCH_UNIX 1 // Linux, BSD, Mac, ...
|
||||
#define MG_ARCH_WIN32 2 // Windows
|
||||
#define MG_ARCH_ESP32 3 // ESP32
|
||||
#define MG_ARCH_ESP8266 4 // ESP8266
|
||||
#define MG_ARCH_FREERTOS 5 // FreeRTOS
|
||||
#define MG_ARCH_AZURERTOS 6 // MS Azure RTOS
|
||||
#define MG_ARCH_ZEPHYR 7 // Zephyr RTOS
|
||||
#define MG_ARCH_NEWLIB 8 // Bare metal ARM
|
||||
#define MG_ARCH_RTX 9 // Keil MDK RTX
|
||||
#define MG_ARCH_TIRTOS 10 // Texas Semi TI-RTOS
|
||||
#define MG_ARCH_RP2040 11 // Raspberry Pi RP2040
|
||||
#define MG_ARCH_CUSTOM 0 // User creates its own mongoose_custom.h
|
||||
#define MG_ARCH_UNIX 1 // Linux, BSD, Mac, ...
|
||||
#define MG_ARCH_WIN32 2 // Windows
|
||||
#define MG_ARCH_ESP32 3 // ESP32
|
||||
#define MG_ARCH_ESP8266 4 // ESP8266
|
||||
#define MG_ARCH_FREERTOS 5 // FreeRTOS
|
||||
#define MG_ARCH_AZURERTOS 6 // MS Azure RTOS
|
||||
#define MG_ARCH_ZEPHYR 7 // Zephyr RTOS
|
||||
#define MG_ARCH_NEWLIB 8 // Bare metal ARM
|
||||
#define MG_ARCH_CMSIS_RTOS1 9 // CMSIS-RTOS API v1 (Keil RTX)
|
||||
#define MG_ARCH_TIRTOS 10 // Texas Semi TI-RTOS
|
||||
#define MG_ARCH_RP2040 11 // Raspberry Pi RP2040
|
||||
#define MG_ARCH_ARMCC 12 // Keil MDK-Core with Configuration Wizard
|
||||
#define MG_ARCH_CMSIS_RTOS2 13 // CMSIS-RTOS API v2 (Keil RTX5, FreeRTOS)
|
||||
|
||||
#if !defined(MG_ARCH)
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
@@ -58,10 +60,14 @@ extern "C" {
|
||||
#define MG_ARCH MG_ARCH_AZURERTOS
|
||||
#elif defined(PICO_TARGET_NAME)
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
#elif defined(__ARMCC_VERSION)
|
||||
#define MG_ARCH MG_ARCH_ARMCC
|
||||
#endif
|
||||
#endif // !defined(MG_ARCH)
|
||||
|
||||
#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM)
|
||||
// if the user did not specify an MG_ARCH, or specified a custom one, OR
|
||||
// we guessed a known IDE, pull the customized config (Configuration Wizard)
|
||||
#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM) || MG_ARCH == MG_ARCH_ARMCC
|
||||
#include "mongoose_custom.h" // keep this include
|
||||
#endif
|
||||
|
||||
@@ -166,7 +172,9 @@ extern "C" {
|
||||
#if MG_ARCH == MG_ARCH_FREERTOS
|
||||
|
||||
#include <ctype.h>
|
||||
// #include <errno.h> // Cannot include errno - might conflict with lwip!
|
||||
#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP
|
||||
#include <errno.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -174,7 +182,12 @@ extern "C" {
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // rand(), strtol(), atoi()
|
||||
#include <string.h>
|
||||
#if defined(__ARMCC_VERSION)
|
||||
#define mode_t size_t
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
@@ -242,7 +255,8 @@ int mkdir(const char *, mode_t);
|
||||
#endif
|
||||
|
||||
|
||||
#if MG_ARCH == MG_ARCH_RTX
|
||||
#if MG_ARCH == MG_ARCH_ARMCC || MG_ARCH == MG_ARCH_CMSIS_RTOS1 || \
|
||||
MG_ARCH == MG_ARCH_CMSIS_RTOS2
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@@ -254,8 +268,28 @@ int mkdir(const char *, mode_t);
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#if MG_ARCH == MG_ARCH_CMSIS_RTOS1
|
||||
#include "cmsis_os.h" // keep this include
|
||||
// https://developer.arm.com/documentation/ka003821/latest
|
||||
extern uint32_t rt_time_get(void);
|
||||
#elif MG_ARCH == MG_ARCH_CMSIS_RTOS2
|
||||
#include "cmsis_os2.h" // keep this include
|
||||
#endif
|
||||
|
||||
#if !defined MG_ENABLE_RL && (!defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP)
|
||||
#define strdup(s) ((char *) mg_strdup(mg_str(s)).ptr)
|
||||
|
||||
#if defined(__ARMCC_VERSION)
|
||||
#define mode_t size_t
|
||||
#define mkdir(a, b) mg_mkdir(a, b)
|
||||
static inline int mg_mkdir(const char *path, mode_t mode) {
|
||||
(void) path, (void) mode;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (MG_ARCH == MG_ARCH_CMSIS_RTOS1 || MG_ARCH == MG_ARCH_CMSIS_RTOS2) && \
|
||||
!defined MG_ENABLE_RL && (!defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP) && \
|
||||
(!defined(MG_ENABLE_TCPIP) || !MG_ENABLE_TCPIP)
|
||||
#define MG_ENABLE_RL 1
|
||||
#endif
|
||||
|
||||
@@ -482,24 +516,12 @@ int sscanf(const char *, const char *, ...);
|
||||
|
||||
#if defined(MG_ENABLE_FREERTOS_TCP) && MG_ENABLE_FREERTOS_TCP
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <list.h>
|
||||
#include <task.h>
|
||||
|
||||
#include <FreeRTOS_IP.h>
|
||||
#include <FreeRTOS_Sockets.h>
|
||||
#include <FreeRTOS_errno_TCP.h> // contents to be moved and file removed, some day
|
||||
|
||||
#define MG_SOCKET_TYPE Socket_t
|
||||
#define MG_INVALID_SOCKET FREERTOS_INVALID_SOCKET
|
||||
@@ -515,6 +537,20 @@ int sscanf(const char *, const char *, ...);
|
||||
#define SO_ERROR 0
|
||||
#define SOL_SOCKET 0
|
||||
#define SO_REUSEADDR 0
|
||||
|
||||
#define MG_SOCK_ERR(errcode) ((errcode) < 0 ? (errcode) : 0)
|
||||
|
||||
#define MG_SOCK_PENDING(errcode) \
|
||||
((errcode) == -pdFREERTOS_ERRNO_EWOULDBLOCK || \
|
||||
(errcode) == -pdFREERTOS_ERRNO_EISCONN || \
|
||||
(errcode) == -pdFREERTOS_ERRNO_EINPROGRESS || \
|
||||
(errcode) == -pdFREERTOS_ERRNO_EAGAIN)
|
||||
|
||||
#define MG_SOCK_RESET(errcode) ((errcode) == -pdFREERTOS_ERRNO_ENOTCONN)
|
||||
|
||||
// actually only if optional timeout is enabled
|
||||
#define MG_SOCK_INTR(fd) (fd == NULL)
|
||||
|
||||
#define sockaddr_in freertos_sockaddr
|
||||
#define sockaddr freertos_sockaddr
|
||||
#define accept(a, b, c) FreeRTOS_accept((a), (b), (c))
|
||||
@@ -546,8 +582,17 @@ static inline int mg_getpeername(MG_SOCKET_TYPE fd, void *buf, socklen_t *len) {
|
||||
|
||||
|
||||
#if defined(MG_ENABLE_LWIP) && MG_ENABLE_LWIP
|
||||
#if defined(__GNUC__)
|
||||
|
||||
#if defined(__GNUC__) && !defined(__ARMCC_VERSION)
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
struct timeval;
|
||||
|
||||
#include <lwip/sockets.h>
|
||||
|
||||
#if !LWIP_TIMEVAL_PRIVATE
|
||||
#if defined(__GNUC__) && !defined(__ARMCC_VERSION) // armclang sets both
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
struct timeval {
|
||||
@@ -555,8 +600,7 @@ struct timeval {
|
||||
long tv_usec;
|
||||
};
|
||||
#endif
|
||||
|
||||
#include <lwip/sockets.h>
|
||||
#endif
|
||||
|
||||
#if LWIP_SOCKET != 1
|
||||
// Sockets support disabled in LWIP by default
|
||||
@@ -568,9 +612,7 @@ struct timeval {
|
||||
#if defined(MG_ENABLE_RL) && MG_ENABLE_RL
|
||||
#include <rl_net.h>
|
||||
|
||||
#define MG_ENABLE_CUSTOM_MILLIS 1
|
||||
#define closesocket(x) closesocket(x)
|
||||
#define mkdir(a, b) (-1)
|
||||
|
||||
#define TCP_NODELAY SO_KEEPALIVE
|
||||
|
||||
@@ -1514,32 +1556,32 @@ struct mg_tcpip_driver {
|
||||
|
||||
// Network interface
|
||||
struct mg_tcpip_if {
|
||||
uint8_t mac[6]; // MAC address. Must be set to a valid MAC
|
||||
uint32_t ip, mask, gw; // IP address, mask, default gateway
|
||||
struct mg_str tx; // Output (TX) buffer
|
||||
bool enable_dhcp_client; // Enable DCHP client
|
||||
bool enable_dhcp_server; // Enable DCHP server
|
||||
bool enable_crc32_check; // Do a CRC check on rx frames and strip it
|
||||
bool enable_mac_check; // Do a MAC check on rx frames
|
||||
uint8_t mac[6]; // MAC address. Must be set to a valid MAC
|
||||
uint32_t ip, mask, gw; // IP address, mask, default gateway
|
||||
struct mg_str tx; // Output (TX) buffer
|
||||
bool enable_dhcp_client; // Enable DCHP client
|
||||
bool enable_dhcp_server; // Enable DCHP server
|
||||
bool enable_crc32_check; // Do a CRC check on rx frames and strip it
|
||||
bool enable_mac_check; // Do a MAC check on rx frames
|
||||
struct mg_tcpip_driver *driver; // Low level driver
|
||||
void *driver_data; // Driver-specific data
|
||||
struct mg_mgr *mgr; // Mongoose event manager
|
||||
struct mg_queue recv_queue; // Receive queue
|
||||
|
||||
// Internal state, user can use it but should not change it
|
||||
uint8_t gwmac[6]; // Router's MAC
|
||||
uint64_t now; // Current time
|
||||
uint64_t timer_1000ms; // 1000 ms timer: for DHCP and link state
|
||||
uint64_t lease_expire; // Lease expiration time
|
||||
uint16_t eport; // Next ephemeral port
|
||||
volatile uint32_t ndrop; // Number of received, but dropped frames
|
||||
volatile uint32_t nrecv; // Number of received frames
|
||||
volatile uint32_t nsent; // Number of transmitted frames
|
||||
volatile uint32_t nerr; // Number of driver errors
|
||||
uint8_t state; // Current state
|
||||
#define MIP_STATE_DOWN 0 // Interface is down
|
||||
#define MIP_STATE_UP 1 // Interface is up
|
||||
#define MIP_STATE_READY 2 // Interface is up and has IP
|
||||
uint8_t gwmac[6]; // Router's MAC
|
||||
uint64_t now; // Current time
|
||||
uint64_t timer_1000ms; // 1000 ms timer: for DHCP and link state
|
||||
uint64_t lease_expire; // Lease expiration time
|
||||
uint16_t eport; // Next ephemeral port
|
||||
volatile uint32_t ndrop; // Number of received, but dropped frames
|
||||
volatile uint32_t nrecv; // Number of received frames
|
||||
volatile uint32_t nsent; // Number of transmitted frames
|
||||
volatile uint32_t nerr; // Number of driver errors
|
||||
uint8_t state; // Current state
|
||||
#define MG_TCPIP_STATE_DOWN 0 // Interface is down
|
||||
#define MG_TCPIP_STATE_UP 1 // Interface is up
|
||||
#define MG_TCPIP_STATE_READY 2 // Interface is up and has IP
|
||||
};
|
||||
|
||||
void mg_tcpip_init(struct mg_mgr *, struct mg_tcpip_if *);
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#define MG_ARCH_CUSTOM 0 // User creates its own mongoose_custom.h
|
||||
#define MG_ARCH_UNIX 1 // Linux, BSD, Mac, ...
|
||||
#define MG_ARCH_WIN32 2 // Windows
|
||||
#define MG_ARCH_ESP32 3 // ESP32
|
||||
#define MG_ARCH_ESP8266 4 // ESP8266
|
||||
#define MG_ARCH_FREERTOS 5 // FreeRTOS
|
||||
#define MG_ARCH_AZURERTOS 6 // MS Azure RTOS
|
||||
#define MG_ARCH_ZEPHYR 7 // Zephyr RTOS
|
||||
#define MG_ARCH_NEWLIB 8 // Bare metal ARM
|
||||
#define MG_ARCH_RTX 9 // Keil MDK RTX
|
||||
#define MG_ARCH_TIRTOS 10 // Texas Semi TI-RTOS
|
||||
#define MG_ARCH_RP2040 11 // Raspberry Pi RP2040
|
||||
#define MG_ARCH_CUSTOM 0 // User creates its own mongoose_custom.h
|
||||
#define MG_ARCH_UNIX 1 // Linux, BSD, Mac, ...
|
||||
#define MG_ARCH_WIN32 2 // Windows
|
||||
#define MG_ARCH_ESP32 3 // ESP32
|
||||
#define MG_ARCH_ESP8266 4 // ESP8266
|
||||
#define MG_ARCH_FREERTOS 5 // FreeRTOS
|
||||
#define MG_ARCH_AZURERTOS 6 // MS Azure RTOS
|
||||
#define MG_ARCH_ZEPHYR 7 // Zephyr RTOS
|
||||
#define MG_ARCH_NEWLIB 8 // Bare metal ARM
|
||||
#define MG_ARCH_CMSIS_RTOS1 9 // CMSIS-RTOS API v1 (Keil RTX)
|
||||
#define MG_ARCH_TIRTOS 10 // Texas Semi TI-RTOS
|
||||
#define MG_ARCH_RP2040 11 // Raspberry Pi RP2040
|
||||
#define MG_ARCH_ARMCC 12 // Keil MDK-Core with Configuration Wizard
|
||||
#define MG_ARCH_CMSIS_RTOS2 13 // CMSIS-RTOS API v2 (Keil RTX5, FreeRTOS)
|
||||
|
||||
#if !defined(MG_ARCH)
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
@@ -31,10 +33,14 @@
|
||||
#define MG_ARCH MG_ARCH_AZURERTOS
|
||||
#elif defined(PICO_TARGET_NAME)
|
||||
#define MG_ARCH MG_ARCH_RP2040
|
||||
#elif defined(__ARMCC_VERSION)
|
||||
#define MG_ARCH MG_ARCH_ARMCC
|
||||
#endif
|
||||
#endif // !defined(MG_ARCH)
|
||||
|
||||
#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM)
|
||||
// if the user did not specify an MG_ARCH, or specified a custom one, OR
|
||||
// we guessed a known IDE, pull the customized config (Configuration Wizard)
|
||||
#if !defined(MG_ARCH) || (MG_ARCH == MG_ARCH_CUSTOM) || MG_ARCH == MG_ARCH_ARMCC
|
||||
#include "mongoose_custom.h" // keep this include
|
||||
#endif
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
#if MG_ARCH == MG_ARCH_FREERTOS
|
||||
|
||||
#include <ctype.h>
|
||||
// #include <errno.h> // Cannot include errno - might conflict with lwip!
|
||||
#if !defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP
|
||||
#include <errno.h>
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
@@ -11,7 +13,12 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h> // rand(), strtol(), atoi()
|
||||
#include <string.h>
|
||||
#if defined(__ARMCC_VERSION)
|
||||
#define mode_t size_t
|
||||
#include <time.h>
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <task.h>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#if MG_ARCH == MG_ARCH_RTX
|
||||
#if MG_ARCH == MG_ARCH_ARMCC || MG_ARCH == MG_ARCH_CMSIS_RTOS1 || \
|
||||
MG_ARCH == MG_ARCH_CMSIS_RTOS2
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@@ -12,8 +13,28 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#if MG_ARCH == MG_ARCH_CMSIS_RTOS1
|
||||
#include "cmsis_os.h" // keep this include
|
||||
// https://developer.arm.com/documentation/ka003821/latest
|
||||
extern uint32_t rt_time_get(void);
|
||||
#elif MG_ARCH == MG_ARCH_CMSIS_RTOS2
|
||||
#include "cmsis_os2.h" // keep this include
|
||||
#endif
|
||||
|
||||
#if !defined MG_ENABLE_RL && (!defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP)
|
||||
#define strdup(s) ((char *) mg_strdup(mg_str(s)).ptr)
|
||||
|
||||
#if defined(__ARMCC_VERSION)
|
||||
#define mode_t size_t
|
||||
#define mkdir(a, b) mg_mkdir(a, b)
|
||||
static inline int mg_mkdir(const char *path, mode_t mode) {
|
||||
(void) path, (void) mode;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (MG_ARCH == MG_ARCH_CMSIS_RTOS1 || MG_ARCH == MG_ARCH_CMSIS_RTOS2) && \
|
||||
!defined MG_ENABLE_RL && (!defined(MG_ENABLE_LWIP) || !MG_ENABLE_LWIP) && \
|
||||
(!defined(MG_ENABLE_TCPIP) || !MG_ENABLE_TCPIP)
|
||||
#define MG_ENABLE_RL 1
|
||||
#endif
|
||||
|
||||
|
||||
@@ -2,24 +2,12 @@
|
||||
|
||||
#if defined(MG_ENABLE_FREERTOS_TCP) && MG_ENABLE_FREERTOS_TCP
|
||||
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <FreeRTOS.h>
|
||||
#include <list.h>
|
||||
#include <task.h>
|
||||
|
||||
#include <FreeRTOS_IP.h>
|
||||
#include <FreeRTOS_Sockets.h>
|
||||
#include <FreeRTOS_errno_TCP.h> // contents to be moved and file removed, some day
|
||||
|
||||
#define MG_SOCKET_TYPE Socket_t
|
||||
#define MG_INVALID_SOCKET FREERTOS_INVALID_SOCKET
|
||||
@@ -35,6 +23,20 @@
|
||||
#define SO_ERROR 0
|
||||
#define SOL_SOCKET 0
|
||||
#define SO_REUSEADDR 0
|
||||
|
||||
#define MG_SOCK_ERR(errcode) ((errcode) < 0 ? (errcode) : 0)
|
||||
|
||||
#define MG_SOCK_PENDING(errcode) \
|
||||
((errcode) == -pdFREERTOS_ERRNO_EWOULDBLOCK || \
|
||||
(errcode) == -pdFREERTOS_ERRNO_EISCONN || \
|
||||
(errcode) == -pdFREERTOS_ERRNO_EINPROGRESS || \
|
||||
(errcode) == -pdFREERTOS_ERRNO_EAGAIN)
|
||||
|
||||
#define MG_SOCK_RESET(errcode) ((errcode) == -pdFREERTOS_ERRNO_ENOTCONN)
|
||||
|
||||
// actually only if optional timeout is enabled
|
||||
#define MG_SOCK_INTR(fd) (fd == NULL)
|
||||
|
||||
#define sockaddr_in freertos_sockaddr
|
||||
#define sockaddr freertos_sockaddr
|
||||
#define accept(a, b, c) FreeRTOS_accept((a), (b), (c))
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#if defined(MG_ENABLE_LWIP) && MG_ENABLE_LWIP
|
||||
#if defined(__GNUC__)
|
||||
|
||||
#if defined(__GNUC__) && !defined(__ARMCC_VERSION)
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
struct timeval;
|
||||
|
||||
#include <lwip/sockets.h>
|
||||
|
||||
#if !LWIP_TIMEVAL_PRIVATE
|
||||
#if defined(__GNUC__) && !defined(__ARMCC_VERSION) // armclang sets both
|
||||
#include <sys/time.h>
|
||||
#else
|
||||
struct timeval {
|
||||
@@ -10,8 +19,7 @@ struct timeval {
|
||||
long tv_usec;
|
||||
};
|
||||
#endif
|
||||
|
||||
#include <lwip/sockets.h>
|
||||
#endif
|
||||
|
||||
#if LWIP_SOCKET != 1
|
||||
// Sockets support disabled in LWIP by default
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
#if defined(MG_ENABLE_RL) && MG_ENABLE_RL
|
||||
#include <rl_net.h>
|
||||
|
||||
#define MG_ENABLE_CUSTOM_MILLIS 1
|
||||
#define closesocket(x) closesocket(x)
|
||||
#define mkdir(a, b) (-1)
|
||||
|
||||
#define TCP_NODELAY SO_KEEPALIVE
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ static void mg_set_non_blocking_mode(MG_SOCKET_TYPE fd) {
|
||||
#elif MG_ARCH == MG_ARCH_WIN32 && MG_ENABLE_WINSOCK
|
||||
unsigned long on = 1;
|
||||
ioctlsocket(fd, FIONBIO, &on);
|
||||
#elif MG_ARCH == MG_ARCH_RTX
|
||||
#elif MG_ENABLE_RL
|
||||
unsigned long on = 1;
|
||||
ioctlsocket(fd, FIONBIO, &on);
|
||||
#elif MG_ENABLE_FREERTOS_TCP
|
||||
@@ -499,8 +499,9 @@ static void mg_iotest(struct mg_mgr *mgr, int ms) {
|
||||
EventBits_t bits = FreeRTOS_FD_ISSET(c->fd, mgr->ss);
|
||||
c->is_readable = bits & (eSELECT_READ | eSELECT_EXCEPT) ? 1U : 0;
|
||||
c->is_writable = bits & eSELECT_WRITE ? 1U : 0;
|
||||
FreeRTOS_FD_CLR(c->fd, mgr->ss,
|
||||
eSELECT_READ | eSELECT_EXCEPT | eSELECT_WRITE);
|
||||
if (c->fd != MG_INVALID_SOCKET)
|
||||
FreeRTOS_FD_CLR(c->fd, mgr->ss,
|
||||
eSELECT_READ | eSELECT_EXCEPT | eSELECT_WRITE);
|
||||
}
|
||||
#elif MG_ENABLE_EPOLL
|
||||
size_t max = 1;
|
||||
|
||||
@@ -178,7 +178,7 @@ static size_t mg_tcpip_driver_stm32_tx(const void *buf, size_t len,
|
||||
static bool mg_tcpip_driver_stm32_up(struct mg_tcpip_if *ifp) {
|
||||
uint32_t bsr = eth_read_phy(PHY_ADDR, PHY_BSR);
|
||||
bool up = bsr & BIT(2) ? 1 : 0;
|
||||
if ((ifp->state == MIP_STATE_DOWN) && up) { // link state just went up
|
||||
if ((ifp->state == MG_TCPIP_STATE_DOWN) && up) { // link state just went up
|
||||
uint32_t scsr = eth_read_phy(PHY_ADDR, PHY_CSCR);
|
||||
uint32_t maccr = ETH->MACCR | BIT(14) | BIT(11); // 100M, Full-duplex
|
||||
if ((scsr & BIT(3)) == 0) maccr &= ~BIT(14); // 10M
|
||||
|
||||
@@ -233,7 +233,7 @@ static size_t mg_tcpip_driver_stm32h_tx(const void *buf, size_t len,
|
||||
static bool mg_tcpip_driver_stm32h_up(struct mg_tcpip_if *ifp) {
|
||||
uint32_t bsr = eth_read_phy(PHY_ADDR, PHY_BSR);
|
||||
bool up = bsr & BIT(2) ? 1 : 0;
|
||||
if ((ifp->state == MIP_STATE_DOWN) && up) { // link state just went up
|
||||
if ((ifp->state == MG_TCPIP_STATE_DOWN) && up) { // link state just went up
|
||||
uint32_t scsr = eth_read_phy(PHY_ADDR, PHY_CSCR);
|
||||
uint32_t maccr = ETH->MACCR | BIT(14) | BIT(13); // 100M, Full-duplex
|
||||
if ((scsr & BIT(3)) == 0) maccr &= ~BIT(14); // 10M
|
||||
|
||||
@@ -209,7 +209,7 @@ static size_t mg_tcpip_driver_tm4c_tx(const void *buf, size_t len,
|
||||
static bool mg_tcpip_driver_tm4c_up(struct mg_tcpip_if *ifp) {
|
||||
uint32_t bmsr = emac_read_phy(EPHY_ADDR, EPHYBMSR);
|
||||
bool up = (bmsr & BIT(2)) ? 1 : 0;
|
||||
if ((ifp->state == MIP_STATE_DOWN) && up) { // link state just went up
|
||||
if ((ifp->state == MG_TCPIP_STATE_DOWN) && up) { // link state just went up
|
||||
uint32_t sts = emac_read_phy(EPHY_ADDR, EPHYSTS);
|
||||
uint32_t emaccfg = EMAC->EMACCFG | BIT(14) | BIT(11); // 100M, Full-duplex
|
||||
if (sts & BIT(1)) emaccfg &= ~BIT(14); // 10M
|
||||
|
||||
@@ -173,7 +173,7 @@ static void arp_ask(struct mg_tcpip_if *ifp, uint32_t ip) {
|
||||
}
|
||||
|
||||
static void onstatechange(struct mg_tcpip_if *ifp) {
|
||||
if (ifp->state == MIP_STATE_READY) {
|
||||
if (ifp->state == MG_TCPIP_STATE_READY) {
|
||||
MG_INFO(("READY, IP: %M", mg_print_ip4, &ifp->ip));
|
||||
MG_INFO((" GW: %M", mg_print_ip4, &ifp->gw));
|
||||
if (ifp->lease_expire > ifp->now) {
|
||||
@@ -181,10 +181,10 @@ static void onstatechange(struct mg_tcpip_if *ifp) {
|
||||
(" Lease: %lld sec", (ifp->lease_expire - ifp->now) / 1000));
|
||||
}
|
||||
arp_ask(ifp, ifp->gw);
|
||||
} else if (ifp->state == MIP_STATE_UP) {
|
||||
} else if (ifp->state == MG_TCPIP_STATE_UP) {
|
||||
MG_ERROR(("Link up"));
|
||||
srand((unsigned int) mg_millis());
|
||||
} else if (ifp->state == MIP_STATE_DOWN) {
|
||||
} else if (ifp->state == MG_TCPIP_STATE_DOWN) {
|
||||
MG_ERROR(("Link down"));
|
||||
}
|
||||
}
|
||||
@@ -354,7 +354,7 @@ static void rx_dhcp_client(struct mg_tcpip_if *ifp, struct pkt *pkt) {
|
||||
if (ip && mask && gw && ifp->ip == 0) {
|
||||
memcpy(ifp->gwmac, pkt->eth->src, sizeof(ifp->gwmac));
|
||||
ifp->ip = ip, ifp->gw = gw, ifp->mask = mask;
|
||||
ifp->state = MIP_STATE_READY;
|
||||
ifp->state = MG_TCPIP_STATE_READY;
|
||||
onstatechange(ifp);
|
||||
tx_dhcp_request(ifp, pkt->eth->src, ip, pkt->dhcp->siaddr);
|
||||
uint64_t rand;
|
||||
@@ -737,16 +737,16 @@ static void mg_tcpip_poll(struct mg_tcpip_if *ifp, uint64_t uptime_ms) {
|
||||
// Handle physical interface up/down status
|
||||
if (expired_1000ms && ifp->driver->up) {
|
||||
bool up = ifp->driver->up(ifp);
|
||||
bool current = ifp->state != MIP_STATE_DOWN;
|
||||
bool current = ifp->state != MG_TCPIP_STATE_DOWN;
|
||||
if (up != current) {
|
||||
ifp->state = up == false ? MIP_STATE_DOWN
|
||||
: ifp->enable_dhcp_client ? MIP_STATE_UP
|
||||
: MIP_STATE_READY;
|
||||
ifp->state = up == false ? MG_TCPIP_STATE_DOWN
|
||||
: ifp->enable_dhcp_client ? MG_TCPIP_STATE_UP
|
||||
: MG_TCPIP_STATE_READY;
|
||||
if (!up && ifp->enable_dhcp_client) ifp->ip = 0;
|
||||
onstatechange(ifp);
|
||||
}
|
||||
}
|
||||
if (ifp->state == MIP_STATE_DOWN) return;
|
||||
if (ifp->state == MG_TCPIP_STATE_DOWN) return;
|
||||
|
||||
// If IP not configured, send DHCP
|
||||
if (ifp->ip == 0 && expired_1000ms) tx_dhcp_discover(ifp);
|
||||
@@ -930,7 +930,7 @@ void mg_mgr_poll(struct mg_mgr *mgr, int ms) {
|
||||
bool mg_send(struct mg_connection *c, const void *buf, size_t len) {
|
||||
struct mg_tcpip_if *ifp = (struct mg_tcpip_if *) c->mgr->priv;
|
||||
bool res = false;
|
||||
if (ifp->ip == 0 || ifp->state != MIP_STATE_READY) {
|
||||
if (ifp->ip == 0 || ifp->state != MG_TCPIP_STATE_READY) {
|
||||
mg_error(c, "net down");
|
||||
} else if (c->is_udp) {
|
||||
struct connstate *s = (struct connstate *) (c + 1);
|
||||
|
||||
@@ -15,32 +15,32 @@ struct mg_tcpip_driver {
|
||||
|
||||
// Network interface
|
||||
struct mg_tcpip_if {
|
||||
uint8_t mac[6]; // MAC address. Must be set to a valid MAC
|
||||
uint32_t ip, mask, gw; // IP address, mask, default gateway
|
||||
struct mg_str tx; // Output (TX) buffer
|
||||
bool enable_dhcp_client; // Enable DCHP client
|
||||
bool enable_dhcp_server; // Enable DCHP server
|
||||
bool enable_crc32_check; // Do a CRC check on rx frames and strip it
|
||||
bool enable_mac_check; // Do a MAC check on rx frames
|
||||
uint8_t mac[6]; // MAC address. Must be set to a valid MAC
|
||||
uint32_t ip, mask, gw; // IP address, mask, default gateway
|
||||
struct mg_str tx; // Output (TX) buffer
|
||||
bool enable_dhcp_client; // Enable DCHP client
|
||||
bool enable_dhcp_server; // Enable DCHP server
|
||||
bool enable_crc32_check; // Do a CRC check on rx frames and strip it
|
||||
bool enable_mac_check; // Do a MAC check on rx frames
|
||||
struct mg_tcpip_driver *driver; // Low level driver
|
||||
void *driver_data; // Driver-specific data
|
||||
struct mg_mgr *mgr; // Mongoose event manager
|
||||
struct mg_queue recv_queue; // Receive queue
|
||||
|
||||
// Internal state, user can use it but should not change it
|
||||
uint8_t gwmac[6]; // Router's MAC
|
||||
uint64_t now; // Current time
|
||||
uint64_t timer_1000ms; // 1000 ms timer: for DHCP and link state
|
||||
uint64_t lease_expire; // Lease expiration time
|
||||
uint16_t eport; // Next ephemeral port
|
||||
volatile uint32_t ndrop; // Number of received, but dropped frames
|
||||
volatile uint32_t nrecv; // Number of received frames
|
||||
volatile uint32_t nsent; // Number of transmitted frames
|
||||
volatile uint32_t nerr; // Number of driver errors
|
||||
uint8_t state; // Current state
|
||||
#define MIP_STATE_DOWN 0 // Interface is down
|
||||
#define MIP_STATE_UP 1 // Interface is up
|
||||
#define MIP_STATE_READY 2 // Interface is up and has IP
|
||||
uint8_t gwmac[6]; // Router's MAC
|
||||
uint64_t now; // Current time
|
||||
uint64_t timer_1000ms; // 1000 ms timer: for DHCP and link state
|
||||
uint64_t lease_expire; // Lease expiration time
|
||||
uint16_t eport; // Next ephemeral port
|
||||
volatile uint32_t ndrop; // Number of received, but dropped frames
|
||||
volatile uint32_t nrecv; // Number of received frames
|
||||
volatile uint32_t nsent; // Number of transmitted frames
|
||||
volatile uint32_t nerr; // Number of driver errors
|
||||
uint8_t state; // Current state
|
||||
#define MG_TCPIP_STATE_DOWN 0 // Interface is down
|
||||
#define MG_TCPIP_STATE_UP 1 // Interface is up
|
||||
#define MG_TCPIP_STATE_READY 2 // Interface is up and has IP
|
||||
};
|
||||
|
||||
void mg_tcpip_init(struct mg_mgr *, struct mg_tcpip_if *);
|
||||
|
||||
@@ -109,6 +109,10 @@ uint64_t mg_millis(void) {
|
||||
return (uint64_t) Clock_getTicks();
|
||||
#elif MG_ARCH == MG_ARCH_ZEPHYR
|
||||
return (uint64_t) k_uptime_get();
|
||||
#elif MG_ARCH == MG_ARCH_CMSIS_RTOS1
|
||||
return (uint64_t)rt_time_get();
|
||||
#elif MG_ARCH == MG_ARCH_CMSIS_RTOS2
|
||||
return (uint64_t)((osKernelGetTickCount() * 1000) / osKernelGetTickFreq());
|
||||
#elif MG_ARCH == MG_ARCH_UNIX && defined(__APPLE__)
|
||||
// Apple CLOCK_MONOTONIC_RAW is equivalent to CLOCK_BOOTTIME on linux
|
||||
// Apple CLOCK_UPTIME_RAW is equivalent to CLOCK_MONOTONIC_RAW on linux
|
||||
|
||||
@@ -22,7 +22,7 @@ static void test_statechange(void) {
|
||||
struct mg_tcpip_if iface;
|
||||
memset(&iface, 0, sizeof(iface));
|
||||
iface.ip = mg_htonl(0x01020304);
|
||||
iface.state = MIP_STATE_READY;
|
||||
iface.state = MG_TCPIP_STATE_READY;
|
||||
iface.tx.ptr = tx, iface.tx.len = sizeof(tx);
|
||||
iface.driver = &mg_tcpip_driver_mock;
|
||||
onstatechange(&iface);
|
||||
|
||||