Date: Fri, 29 Mar 2024 08:29:08 +0100 (CET) Message-ID: <1649892481.5374.1711697348936@confluence-server> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_5373_637451601.1711697348935" ------=_Part_5373_637451601.1711697348935 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<= em>. If you are using an old= er version of LM-X, refer to documentation for earl= ier versions. |
The LMX_HostidSimple function retr= ieves the HostID from the computer system and returns it as a NULL-terminat= ed string.
LMX_STAT= US LMX_HostidSimple ( LMX_HANDLE LmxHandle, LMX_HOSTID_TYPE eHostidType, char *szHostid );
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_BIO= S_HOSTID |
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 |
Amazon = Google Compute Engine ID |
LMX_HOS= TID_AZURE_ID |
Amazon = Azure ID |
LMX_HOS= TID_RPI_SN |
Raspber= ry Pi serial number |
LMX_HOS= TID_ALL |
All Hos= tIDs |
szHostid[out] Pointer to a string that will= hold the HostID(s). The length of the string can be up to LMX_MAX_LONG_STR= ING_LENGTH.
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.
If there are no HostIDs of the req= uested type, the string will be empty. If there is more than one of the req= uested type, the HostIDs are separated by commas.
When using LMX_HOSTID_ALL, all Hos= tIDs are returned, with the HostID type prefixing the HostID; for example:<= /span>
"ETHERNET=3D0123456789012345=
,ETHERNET=3D54321009876543210,USERNAME=3DMyUserName1,USERNAME=3DMyUserName2=
,HOSTNAME=3DMyHostName,..."
For single HostIDs, the HostID is = returned with multiple HostIDs of that type separated by commas; for exampl= e:
ETHERNET=3D0123456789012345,ETHERNET=3D54321009876543210,.=
.."
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 all the HostIDs with the LMX_HOSTID_IPADDRESS type that are currently in use and displ= ay them on success.
#include= <lmx.h> #include <stdio.h> LMX_HANDLE h; int main()=20 { char s[LMX_MAX_LONG_STRING_LENGTH]; exit_on_error(LMX_Init(&h)); exit_on_error(LMX_HostidSimple(h, LMX_HOSTID_IPADDRESS, s)); printf("HostIDs found: %s\n", s); =20 return 0; }