Skip to content
Version 6.1.0
Contact Us

BACnetStack_SendWhoAmI

bool BACnetStack_SendWhoAmI(
const uint16_t vendorId,
const char * modelName,
const uint32_t modelNameLength,
const char * serialNumber,
const uint32_t serialNumberLength,
const uint8_t * connectionString,
const uint8_t connectionStringLength,
const uint32_t networkPortInstance,
const bool broadcast,
const uint16_t destinationNetwork,
const uint8_t * destinationAddress,
const uint8_t destinationAddressLength,
const uint8_t modelNameEncoding,
const uint8_t serialNumberEncoding);

Sends an unconfirmed Who-Am-I request (cl. 16.11, unconfirmed-service-choice 13).

A device uses this to announce its vendorId / modelName / serialNumber, typically to solicit a You-Are that assigns its device instance. When such a You-Are arrives, the stack asks the host through the callback registered with BACnetStack_RegisterCallbackSetPropertyObjectIdentifier() before applying the new instance.

Returns false if Who-Am-I / You-Are support was not compiled (STACK_OPTION_WHO_AM_I_YOU_ARE).

BACnet reference: ANSI/ASHRAE 135-2024 clause 16.11 (Who-Am-I and You-Are Services); clause 19.7 (Unconfigured Device Discovery and Address Assignment).

Parameter Direction Description
vendorId in The BACnet vendor identifier of this device.
modelName, modelNameLength in The device model name and its length.
serialNumber, serialNumberLength in The device serial number and its length.
connectionString, connectionStringLength in The datalink address to send TO (the destination) - not the local address to send from. For IPv4 this is 6 bytes: 4 octets of IPv4 address followed by 2 octets of port, big-endian (e.g. 0xC0,0xA8,0x01,0x05,0xBA,0xC0 = 192.168.1.5:47808; see BACnetStack_SendRegisterForeignDevice() for a worked example); on BACnet/IPv4 the stack refuses to send to a connection string of any other length, except that a broadcast from a device registered as a foreign device goes to its BBMD and does not use the connection string. MS/TP and BACnet/SC use a different connection-string shape; see their respective Set/Send exports.
networkPortInstance in The Network Port object instance to send the message on, or BACNET_NETWORK_PORT_DEFAULT (4194303) for the default/single port.
broadcast, destinationNetwork, destinationAddress, destinationAddressLength in broadcast selects a broadcast or a unicast where the data link has the choice: on BACnet/IP an Original-Broadcast-NPDU or an Original-Unicast-NPDU (a broadcast from a device registered as a foreign device goes to its BBMD as a Distribute-Broadcast-To-Network); on BACnet/SC the broadcast VMAC; on MS/TP it is ignored and connectionString decides. destinationNetwork 0 keeps the message on the local network; 1 to 65534 routes it to that network, to the device whose MAC address is destinationAddress/destinationAddressLength or, with NULL and 0 there, to every device on that network; 65535 is a global broadcast to every network.
modelNameEncoding, serialNumberEncoding in The character set (cl. 20.2.9) the strings are encoded in: 0 = UTF-8, 1 = IBM/Microsoft DBCS, 2 = JIS C 6226, 3 = ISO 10646 (UCS-4), 4 = ISO 10646 (UCS-2), 5 = ISO 8859-1.

True if the request was sent; false on a missing send callback / connection string or a build failure.

Topic: Client requests. Declared in CASBACnetStackDLL.h.