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#

#define
DMP_UI_PJOIN_EVENT_DURATION (500)

API Documentation#

sl_dmp_ui_init#

void sl_dmp_ui_init (uint8_t init_level)

Initialize the GLIB and DMD interfaces.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]init_level

init_level

Returns

  • void


sl_dmp_ui_light_off#

void sl_dmp_ui_light_off (void )

Update the display to light off bitmap.

Parameters
TypeDirectionArgument NameDescription
void[in]

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

Returns

  • void


sl_dmp_ui_light_on#

void sl_dmp_ui_light_on (void )

Update the display to light on bitmap.

Parameters
TypeDirectionArgument NameDescription
void[in]

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

Returns

  • void


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
TypeDirectionArgument NameDescription
DmpUiLightDirection_t[in]direction

or DMP_UI_DIRECTION_ZIGBEE

Returns

  • void


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
TypeDirectionArgument NameDescription
bool[in]connectionState

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

Returns

  • void


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
TypeDirectionArgument NameDescription
bool[in]enable

whether pjoin is being enabled.

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

Returns

  • void


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
TypeDirectionArgument NameDescription
DmpUiZigBeeNetworkState_t[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


sl_dmp_ui_display_help#

void sl_dmp_ui_display_help (void )

Update the display with Help menu.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • void


dmpUiClrLcdDisplayMainScreen#

void dmpUiClrLcdDisplayMainScreen (void )

Clear the LCD screen and display the main screen.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • void


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
TypeDirectionArgument NameDescription
char *[in]devName

device name.

Returns

  • void


dmpUiSetNumLightsDiscovered#

void dmpUiSetNumLightsDiscovered (uint8_t numberOfLights)

Update the number of lights discovered in the network.

Parameters
TypeDirectionArgument NameDescription
uint8_t[in]numberOfLights

of lights discovered in the network.

Returns

  • void


dmpUiGetNumLightsDiscovered#

uint8_t dmpUiGetNumLightsDiscovered (void )

Return number of lights discovered in the network.

Parameters
TypeDirectionArgument NameDescription
void[in]

Returns

  • uint8_t, number of lights discovered in the network.


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
TypeDirectionArgument NameDescription
sl_dmp_ui_light_state_t[in]updateLight1

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

sl_dmp_ui_light_state_tN/AupdateLight2

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

  • void


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

DmpUiLightDirection_t#

DmpUiLightDirection_t
Enumerator
DMP_UI_DIRECTION_BLUETOOTH
DMP_UI_DIRECTION_ZIGBEE
DMP_UI_DIRECTION_SWITCH
DMP_UI_DIRECTION_INVALID

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

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