/* Get the PMK used to connect to the current secure network.  */
sl_status_t sl_wfx_get_pmk(uint8_t *password, uint32_t *password_length, sl_wfx_interface_t interface)
/* Get the PMK used to connect to the current secure network.  */
sl_status_t sl_wfx_get_pmk(uint8_t *password, uint32_t *password_length, sl_wfx_interface_t interface)
{
  sl_status_t     result;
  sl_wfx_get_pmk_cnf_t *reply = NULL;
  result = sl_wfx_send_command(SL_WFX_GET_PMK_REQ_ID, NULL, 0, interface, (sl_wfx_generic_confirmation_t **)&reply);
  if (result == SL_STATUS_OK) {
    result = sl_wfx_get_status_code(sl_wfx_htole32(reply->body.status), SL_WFX_GET_PMK_REQ_ID);
    memcpy(password, reply->body.password, sl_wfx_htole32(reply->body.password_length));
    *password_length = sl_wfx_htole32(reply->body.password_length);
  }
  return result;
}