Go to the documentation of this file.
77 #define XSDEVICEID_PRODUCT_CODE_LEN 24
78 #define XSDEVICEID_PRODUCT_CODE_INIT "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
81 #define XSDEVICEID_INITIALIZER { 0, XSDEVICEID_PRODUCT_CODE_INIT, 0, 0, 0 }
196 inline XsDeviceId(
const char* productCode, uint16_t hardwareVersion,
uint32_t productVariant, uint64_t serialNumber, uint16_t subDevice = 0)
223 memcpy(
static_cast<void*
>(
this),
static_cast<void const*
>(&parent),
sizeof(
XsDeviceId));
230 memcpy(
static_cast<void*
>(
this),
static_cast<void const*
>(&other),
sizeof(
XsDeviceId));
236 memcpy(
static_cast<void*
>(
this),
static_cast<void const*
>(&other),
sizeof(
XsDeviceId));
241 static inline uint64_t legacyBit()
246 inline bool isLegacyDeviceId()
const
251 inline uint64_t toInt()
const
262 inline uint32_t productVariant()
const
267 inline uint16_t hardwareVersion()
const
275 inline uint16_t subDevice()
const
280 inline uint32_t legacyDeviceId()
const
285 inline bool isMtiX()
const
290 inline bool isMtiX0()
const
295 inline bool isMtiX00()
const
300 inline bool isMtigX00()
const
305 inline bool isMtigX10()
const
310 inline bool isMti3X0()
const
315 inline bool isMti6X0()
const
320 inline bool isMti8X0()
const
325 inline bool isGlove()
const
335 inline bool isDot()
const
340 inline bool isRugged()
const
345 inline bool isMtw()
const
350 inline bool isMtw2()
const
355 inline bool isMtx()
const
360 inline bool isMtx2()
const
365 inline bool isBodyPack()
const
370 inline bool isBodyPackV1()
const
375 inline bool isBodyPackV2()
const
380 inline bool isWirelessMaster()
const
385 inline bool isAwindaX()
const
390 inline bool isAwindaXStation()
const
395 inline bool isAwindaXDongle()
const
400 inline bool isAwindaXOem()
const
405 inline bool isAwinda2()
const
410 inline bool isAwinda2Station()
const
415 inline bool isAwinda2Dongle()
const
420 inline bool isAwinda2Oem()
const
425 inline bool isSyncStationX()
const
430 inline bool isSyncStation2()
const
435 inline bool isHilDevice()
const
440 inline bool isImu()
const
445 inline bool isVru()
const
450 inline bool isAhrs()
const
455 inline bool isGnss()
const
460 inline bool isRtk()
const
465 inline bool hasInternalGnss()
const
470 inline bool isContainerDevice()
const
475 inline bool isMt()
const
480 inline bool isMti()
const
485 inline bool isMtig()
const
490 inline bool isMtMark4()
const
495 inline bool isMtMark5()
const
507 inline void fromString(
const XsString& str)
516 inline XsString toDeviceTypeString(
bool makeType =
true)
const
525 inline void fromDeviceTypeString(
const XsString& str)
531 inline bool isValid()
const
536 inline bool contains(
const XsDeviceId& other)
const
541 inline bool isType()
const
563 inline XsDeviceId deviceType(
bool detailed =
true)
const
573 inline XsDeviceId deviceTypeMask(
bool detailed =
true)
const
583 if (isLegacyDeviceId() || other.isLegacyDeviceId())
584 return toInt() == other.toInt();
587 return (toInt() == other.toInt() &&
596 inline bool operator!=(
const XsDeviceId& other)
const
598 return !(*
this == other);
601 inline bool operator<(
const XsDeviceId& other)
const
603 if (isLegacyDeviceId() || other.isLegacyDeviceId())
604 return toInt() < other.toInt();
626 if (toInt() < other.toInt())
628 else if (toInt() > other.toInt())
638 inline bool operator<=(
const XsDeviceId& other)
const
640 if (isLegacyDeviceId())
641 return toInt() <= other.toInt();
657 if (toInt() < other.toInt())
659 else if (toInt() > other.toInt())
671 if (isLegacyDeviceId())
672 return toInt() > other.toInt();
694 if (toInt() > other.toInt())
696 else if (toInt() < other.toInt())
706 inline bool operator>=(
const XsDeviceId& other)
const
708 if (isLegacyDeviceId())
709 return toInt() >= other.toInt();
725 if (toInt() > other.toInt())
727 else if (toInt() < other.toInt())
914 #if defined(__cplusplus) && !defined(XSENS_NO_STL)
917 template<
typename _CharT,
typename _Traits>
918 basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& o,
XsDeviceId const& xd)
920 return (o << xd.toString());
926 o.append(xd.toString());
935 static std::string makeNiceProductCode(
char const* pc,
int maxSz = 20)
937 if (maxSz <= 0 && pc)
939 std::string result(pc ? pc :
"", (
unsigned int) maxSz);
940 std::string::size_type thingy = result.find(
" ");
941 if (thingy != std::string::npos && (
int) thingy < maxSz)
942 result.erase(result.begin() + (
unsigned)thingy, result.end());
950 inline static std::string makeNiceProductCode(uint8_t
const* pc,
int maxSz = 20)
952 return makeNiceProductCode((
char const*) pc, maxSz);
XSTYPES_DLL_API int XsDeviceId_isMtMk5_10(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 10.
XSTYPES_DLL_API int XsDeviceId_isAwindaX(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Awinda device.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_100(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 100.
XSTYPES_DLL_API int XsDeviceId_isMt(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MT device (any Mti, Mtig, Mtx or Mtw)
XSTYPES_DLL_API int XsDeviceId_isMtMk5_X0(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 10 series.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_X(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 1 series.
XSTYPES_DLL_API int XsDeviceId_isAwindaXDongle(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Awinda Dongle.
char m_productCode[XSDEVICEID_PRODUCT_CODE_LEN]
The productcode of a device.
XSTYPES_DLL_API void XsDeviceId_deviceTypeMask(struct XsDeviceId const *thisPtr, int detailed, struct XsDeviceId *type)
Returns the mask which can be used to get the detailed device type (eg 10, 300 and Awinda2 Master)
XSTYPES_DLL_API int XsDeviceId_isBodyPackV2(struct XsDeviceId const *thisPtr)
Test if this device ID represents a bodypack V2 device.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_10(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 10.
XSTYPES_DLL_API int XsDeviceId_isLegacyDeviceId(struct XsDeviceId const *thisPtr)
Test if the device ID represents a legacy device identification.
XSTYPES_DLL_API int XsDeviceId_isMtMk5_300(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 300.
XSTYPES_DLL_API int XsDeviceId_isAwinda2Station(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Awinda2 Station.
XSTYPES_DLL_API void XsDeviceId_swap(struct XsDeviceId *a, struct XsDeviceId *b)
Swap the contents of a with those of b.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_500(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 500.
XSTYPES_DLL_API int XsDeviceId_isAwindaXOem(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Awinda OEM board.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_700(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 700.
XSTYPES_DLL_API int XsDeviceId_isBodyPackV1(struct XsDeviceId const *thisPtr)
Test if this device ID represents a bodypack V1 device.
XSTYPES_DLL_API int XsDeviceId_isMtx(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTx.
XSTYPES_DLL_API int XsDeviceId_isSyncStation2(struct XsDeviceId const *thisPtr)
Test if this device ID represents a SyncStation v2.
XSTYPES_DLL_API int XsDeviceId_isMti3X0(struct XsDeviceId const *thisPtr)
Test if the device ID represents an MTi-3X0 device.
XSTYPES_DLL_API int XsDeviceId_isType(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isMtMk5_710(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 710.
XsHandId
This is an enumerator that contains the left and right hand.
XSTYPES_DLL_API void XsDeviceId_toString(struct XsDeviceId const *thisPtr, XsString *str)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_300(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 300.
XSTYPES_DLL_API int XsDeviceId_isMti(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTi device (1, 10 or 100 series, 1 includes MTi-7)
XSTYPES_DLL_API int XsDeviceId_isMtMk5_30(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 30.
XSTYPES_DLL_API int XsDeviceId_isMtiX0(struct XsDeviceId const *thisPtr)
Test if the device ID represents an Mti 10-series device.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_200(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 200.
XSTYPES_DLL_API int XsDeviceId_isBodyPack(struct XsDeviceId const *thisPtr)
Test if this device ID represents a bodypack (any version) device.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_400(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 400.
XSTYPES_DLL_API int XsDeviceId_isMtMark4(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Mk4 generation MT device.
XSTYPES_DLL_API void XsDeviceId_deviceType(struct XsDeviceId const *thisPtr, int detailed, struct XsDeviceId *type)
Returns the device type identified by this id (eg 10, 300 and Awinda2 Master)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_X0(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 10 series.
XSTYPES_DLL_API int XsDeviceId_isMtMk4(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4.
XSTYPES_DLL_API int XsDeviceId_isAwinda2(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Awinda2 device.
XSTYPES_DLL_API int XsDeviceId_isMtw2(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTw2.
XSTYPES_DLL_API int XsDeviceId_isRtk(struct XsDeviceId const *thisPtr)
Test if this device ID represents an RTK (capable) device.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_900(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 900.
XSTYPES_DLL_API int XsDeviceId_isWirelessMaster(struct XsDeviceId const *thisPtr)
Test if this device ID represents a Wireless Master device (Awinda Station, Awinda Dongle,...
XSTYPES_DLL_API int XsDeviceId_isImu(struct XsDeviceId const *thisPtr)
Test if this device ID represents an IMU.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_7(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 7.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_600(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 600.
XSTYPES_DLL_API int XsDeviceId_isAwinda2Oem(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Awinda2 OEM board.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_20(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 20.
bool operator==(const XsFilterProfile &lhs, const XsFilterProfile &rhs)
Returns true if lhs has the same type as rhs.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_1(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 1.
XSTYPES_DLL_API uint64_t XsDeviceId_legacyBit(struct XsDeviceId const *thisPtr)
XSTYPES_DLL_API int XsDeviceId_isValid(struct XsDeviceId const *thisPtr)
Test if the device ID is a valid id (not 0).
XSTYPES_DLL_API int XsDeviceId_isMtMark5(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Mk5 generation MT device.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_X00(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 100 series (including 700 and 710)
XSTYPES_DLL_API int XsDeviceId_isAwindaXStation(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Awinda Station.
uint32_t m_productVariant
The product variant of a device.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_710(struct XsDeviceId const *thisPtr)
Test if this device ID represents either an MTMk4 710 or Mk5 710.
XSTYPES_DLL_API int XsDeviceId_isAhrs(struct XsDeviceId const *thisPtr)
Test if this device ID represents an AHRS.
bool operator>(const TransformStorage &lhs, const TransformStorage &rhs)
XSTYPES_DLL_API int XsDeviceId_isMti6X0(struct XsDeviceId const *thisPtr)
Test if the device ID represents an MTi-600 series device.
XSTYPES_DLL_API int XsDeviceId_isMtx2(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTx2.
XSTYPES_DLL_API int XsDeviceId_isMtMk5_200(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 200.
XSTYPES_DLL_API int XsDeviceId_isMtMk5_20(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 20.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_800(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 800.
XSTYPES_DLL_API int XsDeviceId_isSyncStationX(struct XsDeviceId const *thisPtr)
Test if this device ID represents a SyncStation.
XSTYPES_DLL_API int XsDeviceId_isMtMk5(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5.
XSTYPES_DLL_API int XsDeviceId_isMtig(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTig device (700 or 710 series)
struct XsDeviceId XsDeviceId
XSTYPES_DLL_API XsHandId XsDeviceId_side(struct XsDeviceId const *thisPtr)
Return the side the device should be worn on.
XSTYPES_DLL_API int XsDeviceId_isDot(struct XsDeviceId const *thisPtr)
Test if the device ID represents a Dot series device.
XSTYPES_DLL_API int XsDeviceId_isMtMk5_100(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 100.
Contains an Xsens device ID and provides operations for determining the type of device.
XSTYPES_DLL_API void XsDeviceId_fromDeviceTypeString(struct XsDeviceId *thisPtr, XsString const *str)
Read a device ID from the supplied string.
XSTYPES_DLL_API void XsDeviceId_type(struct XsDeviceId const *thisPtr, struct XsDeviceId *type)
Returns the type of device identified by this id.
XSTYPES_DLL_API int XsDeviceId_isMtMk4_30(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 30.
XSTYPES_DLL_API int XsDeviceId_isMtMk5_X00(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk5 100 series.
XSTYPES_DLL_API int XsDeviceId_isHilDevice(struct XsDeviceId const *thisPtr)
Test if this device ID represents a Hardware In the Loop test device.
XSTYPES_DLL_API int XsDeviceId_isRugged(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Rugged Version.
uint16_t m_subDevice
The index of a sub-device, ie a finger in an Xsens Glove. 1-based, 0 = the whole device (default)
XSTYPES_DLL_API int XsDeviceId_isMtMk4_2(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 2.
XSTYPES_DLL_API int XsDeviceId_isContainerDevice(struct XsDeviceId const *thisPtr)
Test if this device ID represents any of the container devices such as Bodypack and Awinda Station.
XSTYPES_DLL_API void XsDeviceId_typeName(struct XsDeviceId const *thisPtr, XsString *str)
XSTYPES_DLL_API int XsDeviceId_contains(struct XsDeviceId const *a, struct XsDeviceId const *b)
std::ostream & operator<<(std::ostream &os, JlHexLogger< char > const &hex)
uint16_t m_hardwareVersion
The hardware version of a device.
XSTYPES_DLL_API void XsDeviceId_toDeviceTypeString(struct XsDeviceId const *thisPtr, XsString *str, int makeType)
uint64_t m_deviceId
The serialnumber of a device.
XSTYPES_DLL_API int XsDeviceId_isMtiX(struct XsDeviceId const *thisPtr)
Test if the device ID represents an Mti 1-series device.
XSTYPES_DLL_API int XsDeviceId_hasInternalGnss(struct XsDeviceId const *thisPtr)
Test if this device ID represents a device with internal GNSS receiver.
XSTYPES_DLL_API int XsDeviceId_isGnss(struct XsDeviceId const *thisPtr)
Test if this device ID represents an GNSS (capable) device.
#define XSDEVICEID_PRODUCT_CODE_LEN
XSTYPES_DLL_API int XsDeviceId_isAwinda2Dongle(struct XsDeviceId const *thisPtr)
Test if this device ID represents an Awinda2 Dongle.
#define XSENS_MSC_WARNING_SUPPRESS(...)
XSTYPES_DLL_API int XsDeviceId_isVru(struct XsDeviceId const *thisPtr)
Test if this device ID represents a VRU.
XSTYPES_DLL_API int XsDeviceId_isMtw(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTw.
XSTYPES_DLL_API int XsDeviceId_isGlove(struct XsDeviceId const *thisPtr)
Test if the device ID represents a Glove series device.
A 0-terminated managed string of characters.
XSTYPES_DLL_API int XsDeviceId_isMtiX00(struct XsDeviceId const *thisPtr)
Test if the device ID represents an Mti 100-series device.
XSTYPES_DLL_API int XsDeviceId_isMtigX10(struct XsDeviceId const *thisPtr)
Test if the device ID represents an Mtig 710 device.
XSTYPES_DLL_API void XsDeviceId_fromString(struct XsDeviceId *thisPtr, XsString const *str)
Read a device ID from the supplied string.
XSTYPES_DLL_API int XsDeviceId_isMti8X0(struct XsDeviceId const *thisPtr)
Test if the device ID represents an MTi-800 series device.
XSTYPES_DLL_API int XsDeviceId_isMtigX00(struct XsDeviceId const *thisPtr)
Test if the device ID represents an Mtig 700 device.
#define XSDEPRECATED_START
XSTYPES_DLL_API int XsDeviceId_isMtMk4_3(struct XsDeviceId const *thisPtr)
Test if this device ID represents an MTMk4 3.