bleRegisterAdvData(Function) |
Top Previous Next |
This function registers a callback function to handle incoming advertising data. This callback will be provided with each individual piece of advertising data as it is received. To receive the raw advertising data, use bleRegisterAdvRaw instead.
Input: ev_type: UINT (default 0) The type of advertising events to handle. This value is combined with ev_mask to find matching events. Bitmask:
ev_mask: UINT (default 0) Bitmask determining how ev_type should be used. If a bit is set in this mask, it must match the same bit in ev_type. Setting ev_mask to 0 will handle all events. Setting ev_mask to 16#FFFF will require that ev_type matches on all defined bits. To receive scannable and scan response legacy advertising, set ev_mask to 16#0017 and ev_type to 16#0012. To receive only non connectable legacy advertising, set ev_mask to 16#001F and ev_type to 16#0010.
adv_type: INT (-1, 0..256) (default -1) The type of advertising data to handle. Use -1 to handle all data types. See 2.3 Common Data Types in the Assigned Numbers Document at https://www.bluetooth.com/specifications/assigned-numbers/
Examples:
cb_adv: CALLBACK The function to call when advertising data is received. See the callback declaration below.
cb_arg: DINT User argument to pass on to the callback.
Returns: INT
Declaration: FUNCTION bleRegisterAdvData : INT; Callback declaration: FUNCTION CALLBACK cbAdvData : INT;
Example: FUNCTION CALLBACK cbAdvName; |