PreviousNext
BondingButton
Help > Custom DPA Handler > Events > BondingButton

This event is called only at TR-7xD [N] during the standard DPA (un)bonding process at [N] and it allows to redefine (un)bonding button. If the event handler returns FALSE the default button is used. If the event handler returns TRUE then the bit at userReg1.0 specifies whether the used bonding button is pressed or not. When a custom button is used then the [N] does not go into a power-saving sleep mode during bonding. IQRF OS function amIBonded can distinguish between bonding and unbonding.

 

Since [N] spends most of its time in the LP reception during bonding, interrupts cannot be raised even though they are enabled. This can be solved by adding a 10 ms delay by calling waitMS to this event. Such a delay does not block the SmartConnect bonding and allows enough interrupts (e.g., from the custom UART interrupt handler) to be received during this delay.

 

This event is also used to modify a default bonding button timeout using the BondingSleepCountdown variable.

 

Example

 

case DpaEvent_BondingButton:

  userReg1.0 = 0;

  if ( !PORTA.0 )

    userReg1.0 = 1;

  return TRUE;

 

See example CustomDpaHandler-BondingButton.c for more details.