-1
item = -35519      
data_in = ctypes.c_int16(item)
data_pkd = (ctypes.c_int32(0) | data_in)

エラーを下回っています

data_pkd = (ctypes.c_int32(0) | data_in)
TypeError: unsupported operand type(s) for |: 'c_long' and 'c_short'
|31||30|    29  28  27  26  25  24  23  22  21  20  19  18  17  16| 15  14  13  12  11  10  9   8   7   6   5   4   3   2   1   0|
|P|M|------------------unused-------------------------------------|------------------------------item----------------------------|

I 32 ビットのテスト データを、入力として int32 を受け入れる C アプリケーションに送信します。これは、上記のデータ形式で説明されています。

ありがとう

4

1 に答える 1