kozukata-toa/src/servers/aimedb/types/felica-conversion.ts

41 lines
1.1 KiB
TypeScript

import Struct from "typed-struct";
export const FelicaLookupRequestStruct = new Struct("FelicaLookupRequest")
.BigUInt64LE("idm")
.UInt8("chipCode")
.UInt8("osVer")
.UInt8Array("timing", 6)
.compile();
export const FelicaLookupResponseStruct = new Struct("FelicaLookupResponse")
.UInt32LE("felicaIndex")
.UInt8Array("accessCode", 10)
.UInt16LE("padding")
.compile();
export const FelicaExtendedLookupRequestStruct = new Struct("FelicaExtendedLookupRequest")
.UInt8Array("randomChallenge", 16)
.BigUInt64LE("idm")
.UInt8("chipCode")
.UInt8("osVer")
.UInt8Array("timing", 6)
.UInt8Array("cardKeyVersion", 16)
.UInt8Array("writeCount", 16)
.BigUInt64LE("maca")
.UInt8("companyCode")
.UInt8("readerFirmwareVersion")
.UInt16LE("DFC")
.UInt8Array("padding", 4)
.compile();
export const FelicaExtendedLookupResponseStruct = new Struct("FelicaExtendedLookupResponse")
.UInt32LE("accountId")
.UInt32LE("relationId1")
.UInt32LE("relationId2")
.UInt8Array("accessCode", 10)
.UInt8("portalRegistered")
.UInt8("companyCode")
.UInt8Array("padding", 8)
.UInt8Array("authKey", 256)
.compile();