ホーム › Devices.Geolocation › GNSS_V2UPL_CONFIG
GNSS_V2UPL_CONFIG
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | この構造体のバイトサイズ。 |
| Version | DWORD | 4 | +4 | +4 | 構造体のバージョン番号。 |
| MPC | CHAR | 260 | +8 | +8 | V2 UPLのMPC(モバイル測位センター)アドレスを示すASCII文字列。 |
| PDE | CHAR | 260 | +268 | +268 | V2 UPLのPDE(位置決定エンティティ)アドレスを示すASCII文字列。 |
| ApplicationTypeIndicator_MR | BYTE | 1 | +528 | +528 | アプリケーション種別/モバイル発信を示す指標値。 |
| Unused | BYTE | 512 | +529 | +529 | アライメント用の予約バイト。 |
各言語での定義
#include <windows.h>
// GNSS_V2UPL_CONFIG (x64 1044 / x86 1044 バイト)
typedef struct GNSS_V2UPL_CONFIG {
DWORD Size;
DWORD Version;
CHAR MPC[260];
CHAR PDE[260];
BYTE ApplicationTypeIndicator_MR;
BYTE Unused[512];
} GNSS_V2UPL_CONFIG;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct GNSS_V2UPL_CONFIG
{
public uint Size;
public uint Version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] public sbyte[] MPC;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] public sbyte[] PDE;
public byte ApplicationTypeIndicator_MR;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public byte[] Unused;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure GNSS_V2UPL_CONFIG
Public Size As UInteger
Public Version As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=260)> Public MPC() As SByte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=260)> Public PDE() As SByte
Public ApplicationTypeIndicator_MR As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=512)> Public Unused() As Byte
End Structureimport ctypes
from ctypes import wintypes
class GNSS_V2UPL_CONFIG(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Version", wintypes.DWORD),
("MPC", ctypes.c_byte * 260),
("PDE", ctypes.c_byte * 260),
("ApplicationTypeIndicator_MR", ctypes.c_ubyte),
("Unused", ctypes.c_ubyte * 512),
]#[repr(C)]
pub struct GNSS_V2UPL_CONFIG {
pub Size: u32,
pub Version: u32,
pub MPC: [i8; 260],
pub PDE: [i8; 260],
pub ApplicationTypeIndicator_MR: u8,
pub Unused: [u8; 512],
}import "golang.org/x/sys/windows"
type GNSS_V2UPL_CONFIG struct {
Size uint32
Version uint32
MPC [260]int8
PDE [260]int8
ApplicationTypeIndicator_MR byte
Unused [512]byte
}type
GNSS_V2UPL_CONFIG = record
Size: DWORD;
Version: DWORD;
MPC: array[0..259] of Shortint;
PDE: array[0..259] of Shortint;
ApplicationTypeIndicator_MR: Byte;
Unused: array[0..511] of Byte;
end;const GNSS_V2UPL_CONFIG = extern struct {
Size: u32,
Version: u32,
MPC: [260]i8,
PDE: [260]i8,
ApplicationTypeIndicator_MR: u8,
Unused: [512]u8,
};type
GNSS_V2UPL_CONFIG {.bycopy.} = object
Size: uint32
Version: uint32
MPC: array[260, int8]
PDE: array[260, int8]
ApplicationTypeIndicator_MR: uint8
Unused: array[512, uint8]struct GNSS_V2UPL_CONFIG
{
uint Size;
uint Version;
byte[260] MPC;
byte[260] PDE;
ubyte ApplicationTypeIndicator_MR;
ubyte[512] Unused;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; GNSS_V2UPL_CONFIG サイズ: 1044 バイト(x64)
dim st, 261 ; 4byte整数×261(構造体サイズ 1044 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Version : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; MPC : CHAR (+8, 260byte) varptr(st)+8 を基点に操作(260byte:入れ子/配列)
; PDE : CHAR (+268, 260byte) varptr(st)+268 を基点に操作(260byte:入れ子/配列)
; ApplicationTypeIndicator_MR : BYTE (+528, 1byte) poke st,528,値 / 値 = peek(st,528)
; Unused : BYTE (+529, 512byte) varptr(st)+529 を基点に操作(512byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global GNSS_V2UPL_CONFIG
#field int Size
#field int Version
#field byte MPC 260
#field byte PDE 260
#field byte ApplicationTypeIndicator_MR
#field byte Unused 512
#endstruct
stdim st, GNSS_V2UPL_CONFIG ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size