btleServiceDataGet (Function) |
Top Previous Next |
This function retrieves the service data from a remote device. The service data is custom data that is part of the 32 bytes in the advertising data.
A device may be sending multiple types of service data, so it may be necessary to call this function multiple times with increasing index until it returns BT_ERR_NODATA.
Note: To be able to receive advertising data, the adapter must be scanning, using btScanStart.
Input: dev : STRING The address of the device to get the data from.
index : INT (default 0) The index of the service data to read.
size : INT The size of the buffer.
data : PTR The buffer to store the data in. Must be at least 31 bytes long to be able to store all normal data.
Output: size : INT The number of valid bytes in the buffer. If the buffer is too small, this will contain the needed size.
UUID : STRING The UUID of the service data.
Returns: INT
Declaration: FUNCTION btleServiceDataGet : INT; index : INT := 0; size : ACCESS INT; data : MANDATORY PTR; UUID : ACCESS STRING;
Example: INCLUDE rtcu.inc
|