Date: Thu, 28 Mar 2024 09:40:46 +0100 (CET) Message-ID: <784948072.5206.1711615246284@confluence-server> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_5205_1063490173.1711615246284" ------=_Part_5205_1063490173.1711615246284 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
The in= formation on this page refers to LM-X v5.3.= 1 and newer, which added support for Raspberry Pi HostIDs. If you are using an older= version of LM-X, refer to documentation for earlie= r versions.<= /span> |
The LMX_Hostid function retrieves = the HostID values from the computer system.
LMX_STAT= US LMX_Hostid ( LMX_HANDLE LmxHandle, LMX_HOSTID_TYPE eHostidType, LMX_HOSTID *lpHostid, int *npHostids );
LmxHandle<= br>[in/out] LM-X handle.
eHostidType
[in] Value that specifies the H=
ostID type to be retrieved.
Possible values are:
HostID Type |
Description |
LMX_HOS= TID_ETHERNET |
Network= card HostID |
LMX_HOS= TID_USERNAME |
Usernam= e HostID |
LMX_HOS= TID_HOSTNAME |
Hostnam= e HostID |
LMX_HOS= TID_IPADDRESS |
IP addr= ess HostID |
LMX_HOS= TID_CUSTOM |
Custom = HostID |
LMX_HOS= TID_DONGLE_HASPHL |
HaspHL = Dongle HostID |
LMX_HOS= TID_HARDDISK |
HostID = of physical harddisk |
LMX_HOS= TID_LONG |
System-= specific HostID |
LMX_HOS= TID_BIOS |
Bios Ho= stID |
LMX_HOS= TID_WIN_PRODUCT_ID |
Windows= product ID |
LMX_HOS= TID_AWS_INSTANCE_ID |
Amazon = EC2 Instance ID |
LMX_HOS= TID_GCE_ID |
Google = Compute Engine ID |
LMX_HOS= TID_AZURE_ID |
Microso= ft Azure ID |
LMX_HOSTID= _RPI_SN |
Raspberry = Pi serial number |
LMX_HOS= TID_ALL |
All Hos= tIDs |
lpHostid[out] Pointer to array of LMX_HOSTI= D structures. See lmx.h for a description of LMX_HOSTID. The array must be = of size LMX_MAX_HOSTIDS.
npHostids<= br>[out] Pointer to a variable that w= ill hold the number of HostIDs of a specific type retrieved. If no HostIDs = are available of the type requested, this variable will be set to zero.
On success, this function returns = the status code LMX_SUCCESS.
On failure, this function returns = an error code in the format described in Return codes.
To make use of custom HostIDs= span>, you must set a callback function using LMX_SetOption with the flag LMX_OPT_CUSTOM_HOSTID_FUNCTION.
Example
You can use the following code to = retrieve the HostIDs that are currently in use and list information contain= ed in LMX_HOSTID.
#include= <lmx.h> #include <stdio.h> LMX_HANDLE h; int main()=20 { LMX_HOSTID hostID[LMX_MAX_HOSTIDS]; int nbHosts, i; exit_on_error(LMX_Init(&h)); exit_on_error(LMX_Hostid(h, LMX_HOSTID_ALL, hostID, &nbHosts)); printf("HostIDs found: %d\n", nbHosts); =20 for(i =3D 0; i < nbHosts; ++i)=20 { printf("Host Type: %d\n", hostID[i].eHostidType); printf("Description: %s\n", hostID[i].szDescription); printf("Value: %s\n\n", hostID[i].szValue); } return 0; }