ホーム › NetworkManagement.WiFi › DOT11_POWER_MGMT_MODE
DOT11_POWER_MGMT_MODE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dot11PowerMode | DOT11_POWER_MODE | 4 | +0 | +0 | 電源管理モード(アクティブ/省電力)を示す列挙値。 |
| uPowerSaveLevel | DWORD | 4 | +4 | +4 | 省電力レベルを表す値。 |
| usListenInterval | WORD | 2 | +8 | +8 | ビーコン受信間隔(リッスンインターバル)を表す。 |
| usAID | WORD | 2 | +10 | +10 | アソシエーション識別子(AID)を表す。 |
| bReceiveDTIMs | BOOLEAN | 1 | +12 | +12 | DTIM を受信するか示すフラグ。 |
各言語での定義
#include <windows.h>
// DOT11_POWER_MGMT_MODE (x64 16 / x86 16 バイト)
typedef struct DOT11_POWER_MGMT_MODE {
DOT11_POWER_MODE dot11PowerMode;
DWORD uPowerSaveLevel;
WORD usListenInterval;
WORD usAID;
BOOLEAN bReceiveDTIMs;
} DOT11_POWER_MGMT_MODE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DOT11_POWER_MGMT_MODE
{
public int dot11PowerMode;
public uint uPowerSaveLevel;
public ushort usListenInterval;
public ushort usAID;
[MarshalAs(UnmanagedType.U1)] public bool bReceiveDTIMs;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DOT11_POWER_MGMT_MODE
Public dot11PowerMode As Integer
Public uPowerSaveLevel As UInteger
Public usListenInterval As UShort
Public usAID As UShort
<MarshalAs(UnmanagedType.U1)> Public bReceiveDTIMs As Boolean
End Structureimport ctypes
from ctypes import wintypes
class DOT11_POWER_MGMT_MODE(ctypes.Structure):
_fields_ = [
("dot11PowerMode", ctypes.c_int),
("uPowerSaveLevel", wintypes.DWORD),
("usListenInterval", ctypes.c_ushort),
("usAID", ctypes.c_ushort),
("bReceiveDTIMs", ctypes.c_byte),
]#[repr(C)]
pub struct DOT11_POWER_MGMT_MODE {
pub dot11PowerMode: i32,
pub uPowerSaveLevel: u32,
pub usListenInterval: u16,
pub usAID: u16,
pub bReceiveDTIMs: u8,
}import "golang.org/x/sys/windows"
type DOT11_POWER_MGMT_MODE struct {
dot11PowerMode int32
uPowerSaveLevel uint32
usListenInterval uint16
usAID uint16
bReceiveDTIMs byte
}type
DOT11_POWER_MGMT_MODE = record
dot11PowerMode: Integer;
uPowerSaveLevel: DWORD;
usListenInterval: Word;
usAID: Word;
bReceiveDTIMs: ByteBool;
end;const DOT11_POWER_MGMT_MODE = extern struct {
dot11PowerMode: i32,
uPowerSaveLevel: u32,
usListenInterval: u16,
usAID: u16,
bReceiveDTIMs: u8,
};type
DOT11_POWER_MGMT_MODE {.bycopy.} = object
dot11PowerMode: int32
uPowerSaveLevel: uint32
usListenInterval: uint16
usAID: uint16
bReceiveDTIMs: uint8struct DOT11_POWER_MGMT_MODE
{
int dot11PowerMode;
uint uPowerSaveLevel;
ushort usListenInterval;
ushort usAID;
ubyte bReceiveDTIMs;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DOT11_POWER_MGMT_MODE サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; dot11PowerMode : DOT11_POWER_MODE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; uPowerSaveLevel : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; usListenInterval : WORD (+8, 2byte) wpoke st,8,値 / 値 = wpeek(st,8)
; usAID : WORD (+10, 2byte) wpoke st,10,値 / 値 = wpeek(st,10)
; bReceiveDTIMs : BOOLEAN (+12, 1byte) poke st,12,値 / 値 = peek(st,12)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DOT11_POWER_MGMT_MODE
#field int dot11PowerMode
#field int uPowerSaveLevel
#field short usListenInterval
#field short usAID
#field bool1 bReceiveDTIMs
#endstruct
stdim st, DOT11_POWER_MGMT_MODE ; NSTRUCT 変数を確保
st->dot11PowerMode = 100
mes "dot11PowerMode=" + st->dot11PowerMode