BACnetStack_SendReadProperty
bool BACnetStack_SendReadProperty( uint8_t * sentInvokeId, const uint8_t serviceType, const uint8_t * connectionString, const uint8_t connectionStringLength, const uint32_t networkPortInstance, const uint16_t destinationNetwork, const uint8_t * destinationAddress, const uint8_t destinationAddressLength, const uint32_t propertyArraysCount, const void * propertyArrays, const uint32_t propertyArraysLength);Sends a ReadProperty or ReadPropertyMultiple request.
BACnetStack_SendReadProperty()
One call serves both ReadProperty and ReadPropertyMultiple, selected by serviceType: serviceType = 12 (ReadProperty) -> propertyArraysCount must be 1 serviceType = 14 (ReadPropertyMultiple) -> propertyArraysCount >= 1
propertyArrays: propertyArraysCount packed elements, each CASBACnetStack::BACnetStackReadPropertyAsync::SIZE_OF_ARRAY bytes. Multi-byte fields are little-endian, the byte order of every host the stack supports:
* +-[0]-----------*-[1][2]--------------*-[3][4][5][6]------------*-[7][8][9][10]---------------*-[11][12][13][14]------------** | uint8_t flags | uint16_t objectType | uint32_t objectInstance | uint32_t propertyIdentifier | uint32_t propertyArrayIndex |* +---------------*---------------------*-------------------------*-----------------------------*-----------------------------**uint8_t flags 1 (0) = Use propertyArrayIndex 2 (1) = (Reserved) 4 (2) = (Reserved) 8 (3) = (Reserved) 16 (4) = (Reserved) 32 (5) = (Reserved) 64 (6) = (Reserved)128 (7) = (Reserved)Worked example - ReadProperty (serviceType 12), Analog Input 1’s Present_Value, no array index:
* 00 00 00 01 00 00 00 55 00 00 00 00 00 00 00 (15 bytes total)* |fl| |objType||objInstance||propertyId ||arrayIndex |*propertyArraysCount = 1, propertyArraysLength = 15. (objectType 0 = analog-input, propertyIdentifier 85 = Present_Value - see CASBACnetStack::BACnetObjectType and CASBACnetStack::BACnetPropertyIdentifier.)
BACnetStack_SendReadPropertyWithLength() below has an identical signature; both exports exist side by side.
See also: Client response hooks
BACnet reference: ANSI/ASHRAE 135-2024 clause 15.5 (ReadProperty Service); clause 15.7 (ReadPropertyMultiple Service).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
sentInvokeId |
out | The invoke-id of the sent request, valid only if this function returns true. |
serviceType |
in | 12 = ReadProperty, 14 = ReadPropertyMultiple; selects which service is sent. |
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. |
destinationNetwork, destinationAddress, destinationAddressLength |
in | The destination to send the request to. |
propertyArraysCount, propertyArrays |
in | The packed property-reference array described above. |
propertyArraysLength |
in | The total byte length of propertyArrays (all elements concatenated). Enforced: rejects a propertyArraysCount that would read past this length. |
Returns
Section titled “Returns”True if the request was sent, otherwise false.
Topic: Client requests. Declared in CASBACnetStackDLL.h.