久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='0dvYP'></bdo><ul id='0dvYP'></ul>

<small id='0dvYP'></small><noframes id='0dvYP'>

<tfoot id='0dvYP'></tfoot>
<i id='0dvYP'><tr id='0dvYP'><dt id='0dvYP'><q id='0dvYP'><span id='0dvYP'><b id='0dvYP'><form id='0dvYP'><ins id='0dvYP'></ins><ul id='0dvYP'></ul><sub id='0dvYP'></sub></form><legend id='0dvYP'></legend><bdo id='0dvYP'><pre id='0dvYP'><center id='0dvYP'></center></pre></bdo></b><th id='0dvYP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0dvYP'><tfoot id='0dvYP'></tfoot><dl id='0dvYP'><fieldset id='0dvYP'></fieldset></dl></div>
<legend id='0dvYP'><style id='0dvYP'><dir id='0dvYP'><q id='0dvYP'></q></dir></style></legend>

      1. 使用 Python ctypes 調用 rs232.c 時如何解決分段錯誤

        How to solve the segmentation fault issue when I use Python ctypes to call rs232.c?(使用 Python ctypes 調用 rs232.c 時如何解決分段錯誤問題?)

      2. <i id='zGoOI'><tr id='zGoOI'><dt id='zGoOI'><q id='zGoOI'><span id='zGoOI'><b id='zGoOI'><form id='zGoOI'><ins id='zGoOI'></ins><ul id='zGoOI'></ul><sub id='zGoOI'></sub></form><legend id='zGoOI'></legend><bdo id='zGoOI'><pre id='zGoOI'><center id='zGoOI'></center></pre></bdo></b><th id='zGoOI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zGoOI'><tfoot id='zGoOI'></tfoot><dl id='zGoOI'><fieldset id='zGoOI'></fieldset></dl></div>

              <tbody id='zGoOI'></tbody>
              <tfoot id='zGoOI'></tfoot>
              • <legend id='zGoOI'><style id='zGoOI'><dir id='zGoOI'><q id='zGoOI'></q></dir></style></legend>
                  <bdo id='zGoOI'></bdo><ul id='zGoOI'></ul>
                • <small id='zGoOI'></small><noframes id='zGoOI'>

                  本文介紹了使用 Python ctypes 調用 rs232.c 時如何解決分段錯誤問題?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我將 rs232.c 構建為共享庫并嘗試使用 python3 調用它.但是我得到了分段錯誤";嘗試獲取 com 端口 tcgetattr() 的屬性時出錯.有誰知道這是什么問題?我的操作系統是樹莓派 p3.

                  I build the rs232.c as a shared library and try to use python3 to call it. But I got the "Segmentation fault" error when try to get the attributes of com port, tcgetattr(). Anyone know what's this problem? my os system is raspberry pi p3.

                  testcom.py

                  from ctypes import *
                  comdll = cdll.LoadLibrary("rs232.so")
                  comdll.RS232_OpenComport(c_int(22),c_int(115200),c_char_p(b'8N1'))
                  

                  rs232.c

                  #include <termios.h>
                  #include <unistd.h>
                  #define RS232_PORTNR  39
                  int Cport[RS232_PORTNR],error;
                  struct termios old_port_settings[RS232_PORTNR];
                  
                  int RS232_OpenComport(int comport_number, int baudrate, const char *mode)
                  {
                      error = tcgetattr(Cport[comport_number], old_port_settings + comport_number); //segmentation fault at this line
                      return error;
                  }
                  

                  推薦答案

                  問題是您將變量命名為 error 并使其成為全局變量.作為 GNU 擴展,glibc 添加了一個名為error,你的庫最終混淆了兩者,并試圖將 tcgetattr 的返回值寫入名為 error 的函數上.要修復它,請將 error 重命名為其他名稱,將其聲明為 static,或將其聲明移至 RS232_OpenCompport.

                  The problem is that you named your variable error and made it global. As a GNU extension, glibc adds a function named error, and your library ends up confusing the two and trying to write the return value of tcgetattr over the function called error. To fix it, either rename error to something else, declare it static, or move its declaration inside RS232_OpenComport.

                  這篇關于使用 Python ctypes 調用 rs232.c 時如何解決分段錯誤問題?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)

                      <tbody id='PghjO'></tbody>
                  1. <legend id='PghjO'><style id='PghjO'><dir id='PghjO'><q id='PghjO'></q></dir></style></legend>
                        <bdo id='PghjO'></bdo><ul id='PghjO'></ul>
                        <tfoot id='PghjO'></tfoot>

                        • <i id='PghjO'><tr id='PghjO'><dt id='PghjO'><q id='PghjO'><span id='PghjO'><b id='PghjO'><form id='PghjO'><ins id='PghjO'></ins><ul id='PghjO'></ul><sub id='PghjO'></sub></form><legend id='PghjO'></legend><bdo id='PghjO'><pre id='PghjO'><center id='PghjO'></center></pre></bdo></b><th id='PghjO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='PghjO'><tfoot id='PghjO'></tfoot><dl id='PghjO'><fieldset id='PghjO'></fieldset></dl></div>

                            <small id='PghjO'></small><noframes id='PghjO'>

                            主站蜘蛛池模板: 欧美成人aaa级毛片在线视频 | 欧美精品1区 | 91精品国产91久久久久久吃药 | 中文字幕亚洲在线 | 久久av资源网 | 黄色av一区 | 久久综合色综合 | 日韩毛片免费看 | www.日日夜夜 | 国产一区 | 国产h视频 | 日韩精品在线播放 | 精品国产一区二区三区久久久久久 | 欧美成人精品一区 | 亚洲一区二区三区在线视频 | 日韩欧美中文 | 男女免费网站 | 91精品国产91久久久久久最新 | 久久伊人精品 | 三级特黄特色视频 | 国产色播av在线 | 久久久久久久综合色一本 | 亚州精品天堂中文字幕 | 九九热国产精品视频 | 亚洲欧美成人影院 | 欧美在线一区视频 | 色爱区综合 | 中文字幕在线视频一区二区三区 | 亚洲二区精品 | 国产女人精品视频 | 天天射视频 | 国产日产久久高清欧美一区 | 亚洲欧美国产一区二区三区 | 国产区久久| 青青青伊人 | 欧美日韩亚洲二区 | 亚洲在线 | 久久精品国产v日韩v亚洲 | 亚洲三级在线 | 国产香蕉视频在线播放 | 欧美成人不卡 |