DMP UI Demo#

API and Callbacks for the DMP UI Demo Component.

DMP UI uses the underlying DMD interface and the GLIB and exposes several wrapper functions to the application. These functions are used to display different bitmaps for the demo.

API#

void
sl_dmp_ui_init(uint8_t init_level)

Initialize the GLIB and DMD interfaces.

void

Update the display to light off bitmap.

void

Update the display to light on bitmap.

void
sl_dmp_ui_update_direction(DmpUiLightDirection_t direction)

Update the display to show which interface toggled the light.

void
sl_dmp_ui_bluetooth_connected(bool connectionState)

Update the display to show if the Bluetooth is connected to the mobile device.

void

Update the display with flashing PAN ID sequence to indicate that the pjoin is active.

void
sl_dmp_ui_display_zigbee_state(DmpUiZigBeeNetworkState_t nwState)

Update the display with PAN ID, after the device joins or leaves the network.

void

Update the display with Help menu.

void

Clear the LCD screen and display the main screen.

void

Set the BLE device name to be displayed on the LCD.

void
dmpUiSetNumLightsDiscovered(uint8_t numberOfLights)

Update the number of lights discovered in the network.

uint8_t

Return number of lights discovered in the network.

void
dmpUiLightUpdateLight(sl_dmp_ui_light_state_t updateLight1, sl_dmp_ui_light_state_t updateLight2)

Update the status of both lights on the LCD.

Enumerations#

enum
DMP_UI_LIGHT_ON
DMP_UI_LIGHT_OFF
DMP_UI_LIGHT_UNCHANGED
}
enum
DMP_UI_DIRECTION_BLUETOOTH
DMP_UI_DIRECTION_ZIGBEE
DMP_UI_DIRECTION_SWITCH
DMP_UI_DIRECTION_INVALID
}
enum
DMP_UI_NO_NETWORK
DMP_UI_SCANNING
DMP_UI_JOINING
DMP_UI_FORMING
DMP_UI_NETWORK_UP
DMP_UI_LOST_NETWORK
DMP_UI_DISCOVERING
DMP_UI_STATE_UNKNOWN
}
enum
DMP_UI_DEVICE_TYPE_LIGHT
DMP_UI_DEVICE_TYPE_SWITCH
DMP_UI_DEVICE_TYPE_LIGHT_SED
DMP_UI_DEVICE_TYPE_UNKNOWN
}

Macros#

API Documentation#

sl_dmp_ui_init#

void sl_dmp_ui_init (uint8_t init_level)

Initialize the GLIB and DMD interfaces.

Parameters
[in]init_level

init_level

Returns

  • void


Definition at line 98 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

sl_dmp_ui_light_off#

void sl_dmp_ui_light_off (void )

Update the display to light off bitmap.

Parameters
[in]

This function clears the display area and re-renders the LCD with the light off bitmap with other bitmaps.

Returns

  • void


Definition at line 112 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

sl_dmp_ui_light_on#

void sl_dmp_ui_light_on (void )

Update the display to light on bitmap.

Parameters
[in]

This function clears the display area and re-renders the LCD with the light on bitmap with other bitmaps.

Returns

  • void


Definition at line 126 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

sl_dmp_ui_update_direction#

void sl_dmp_ui_update_direction (DmpUiLightDirection_t direction)

Update the display to show which interface toggled the light.

Parameters
[in]direction

or DMP_UI_DIRECTION_ZIGBEE

Returns

  • void


Definition at line 138 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

sl_dmp_ui_bluetooth_connected#

void sl_dmp_ui_bluetooth_connected (bool connectionState)

Update the display to show if the Bluetooth is connected to the mobile device.

Parameters
[in]connectionState

if the Light is connected to mobile device, false otherwise.

Returns

  • void


Definition at line 150 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

sl_dmp_ui_zigbee_permit_join#

void sl_dmp_ui_zigbee_permit_join (bool enable)

Update the display with flashing PAN ID sequence to indicate that the pjoin is active.

Parameters
[in]enable

whether pjoin is being enabled.

The flashing sequence is stopped automatically after the pjoin is disabled.

Returns

  • void


Definition at line 165 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

sl_dmp_ui_display_zigbee_state#

void sl_dmp_ui_display_zigbee_state (DmpUiZigBeeNetworkState_t nwState)

Update the display with PAN ID, after the device joins or leaves the network.

Parameters
[in]nwState

on the network state provided this function will display the corresponding nwk state on LCD. If DMP_UI_STATE_UNKNOWN is passed, it will determine the network state internally and update the display accordingly.

Returns

  • void


Definition at line 180 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

sl_dmp_ui_display_help#

void sl_dmp_ui_display_help (void )

Update the display with Help menu.

Parameters
[in]

Returns

  • void


Definition at line 191 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

dmpUiClrLcdDisplayMainScreen#

void dmpUiClrLcdDisplayMainScreen (void )

Clear the LCD screen and display the main screen.

Parameters
[in]

Returns

  • void


Definition at line 202 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

sl_dmp_ui_set_ble_device_name#

void sl_dmp_ui_set_ble_device_name (char * devName)

Set the BLE device name to be displayed on the LCD.

Parameters
[in]devName

device name.

Returns

  • void


Definition at line 213 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

dmpUiSetNumLightsDiscovered#

void dmpUiSetNumLightsDiscovered (uint8_t numberOfLights)

Update the number of lights discovered in the network.

Parameters
[in]numberOfLights

of lights discovered in the network.

Returns

  • void


Definition at line 224 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

dmpUiGetNumLightsDiscovered#

uint8_t dmpUiGetNumLightsDiscovered (void )

Return number of lights discovered in the network.

Parameters
[in]

Returns

  • uint8_t, number of lights discovered in the network.


Definition at line 235 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

dmpUiLightUpdateLight#

void dmpUiLightUpdateLight (sl_dmp_ui_light_state_t updateLight1, sl_dmp_ui_light_state_t updateLight2)

Update the status of both lights on the LCD.

Parameters
[in]updateLight1

of both the lights. If DMP_UI_LIGHT_UNCHANGED is passed, previous light state is updated.

N/AupdateLight2

If status has not changed, the application can pass DMP_UI_LIGHT_UNCHANGED as the state. Returns

  • void


Definition at line 249 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

Enumeration Documentation#

sl_dmp_ui_light_state_t#

sl_dmp_ui_light_state_t
Enumerator
DMP_UI_LIGHT_ON
DMP_UI_LIGHT_OFF
DMP_UI_LIGHT_UNCHANGED

Definition at line 48 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

DmpUiLightDirection_t#

DmpUiLightDirection_t
Enumerator
DMP_UI_DIRECTION_BLUETOOTH
DMP_UI_DIRECTION_ZIGBEE
DMP_UI_DIRECTION_SWITCH
DMP_UI_DIRECTION_INVALID

Definition at line 54 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

DmpUiZigBeeNetworkState_t#

DmpUiZigBeeNetworkState_t
Enumerator
DMP_UI_NO_NETWORK
DMP_UI_SCANNING
DMP_UI_JOINING
DMP_UI_FORMING
DMP_UI_NETWORK_UP
DMP_UI_LOST_NETWORK
DMP_UI_DISCOVERING
DMP_UI_STATE_UNKNOWN

Definition at line 61 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

DmpUiDeviceType_t#

DmpUiDeviceType_t
Enumerator
DMP_UI_DEVICE_TYPE_LIGHT
DMP_UI_DEVICE_TYPE_SWITCH
DMP_UI_DEVICE_TYPE_LIGHT_SED
DMP_UI_DEVICE_TYPE_UNKNOWN

Definition at line 72 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h

Macro Definition Documentation#

DMP_UI_PJOIN_EVENT_DURATION#

#define DMP_UI_PJOIN_EVENT_DURATION
Value:
(500)

Definition at line 42 of file app/framework/plugin/dmp-ui-demo/dmp-ui.h