Win32 API 日本語リファレンス
ホームDevices.Geolocation › GNSS_NMEA_DATA

GNSS_NMEA_DATA

構造体
サイズx64: 264 バイト / x86: 264 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0この構造体のサイズをバイト単位で示すDWORD。
VersionDWORD4+4+4構造体のバージョンを示すDWORD。
NmeaSentencesCHAR256+8+8NMEA形式のセンテンス文字列を保持するANSI文字配列。

各言語での定義

#include <windows.h>

// GNSS_NMEA_DATA  (x64 264 / x86 264 バイト)
typedef struct GNSS_NMEA_DATA {
    DWORD Size;
    DWORD Version;
    CHAR NmeaSentences[256];
} GNSS_NMEA_DATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GNSS_NMEA_DATA
{
    public uint Size;
    public uint Version;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public sbyte[] NmeaSentences;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GNSS_NMEA_DATA
    Public Size As UInteger
    Public Version As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public NmeaSentences() As SByte
End Structure
import ctypes
from ctypes import wintypes

class GNSS_NMEA_DATA(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("Version", wintypes.DWORD),
        ("NmeaSentences", ctypes.c_byte * 256),
    ]
#[repr(C)]
pub struct GNSS_NMEA_DATA {
    pub Size: u32,
    pub Version: u32,
    pub NmeaSentences: [i8; 256],
}
import "golang.org/x/sys/windows"

type GNSS_NMEA_DATA struct {
	Size uint32
	Version uint32
	NmeaSentences [256]int8
}
type
  GNSS_NMEA_DATA = record
    Size: DWORD;
    Version: DWORD;
    NmeaSentences: array[0..255] of Shortint;
  end;
const GNSS_NMEA_DATA = extern struct {
    Size: u32,
    Version: u32,
    NmeaSentences: [256]i8,
};
type
  GNSS_NMEA_DATA {.bycopy.} = object
    Size: uint32
    Version: uint32
    NmeaSentences: array[256, int8]
struct GNSS_NMEA_DATA
{
    uint Size;
    uint Version;
    byte[256] NmeaSentences;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GNSS_NMEA_DATA サイズ: 264 バイト(x64)
dim st, 66    ; 4byte整数×66(構造体サイズ 264 / 4 切り上げ)
; Size : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; NmeaSentences : CHAR (+8, 256byte)  varptr(st)+8 を基点に操作(256byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GNSS_NMEA_DATA
    #field int Size
    #field int Version
    #field byte NmeaSentences 256
#endstruct

stdim st, GNSS_NMEA_DATA        ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size