/* Configure the antenna setting (done through the PDS)  */
sl_status_t sl_wfx_set_antenna_config(sl_wfx_antenna_config_t config)
/* Configure the antenna setting (done through the PDS)  */
sl_status_t sl_wfx_set_antenna_config(sl_wfx_antenna_config_t config)
{
  sl_status_t result;
  char        pds[32] = { 0 };
  char       *current = pds;
  current += sprintf(current, "{%c:{", PDS_ANTENNA_SEL_KEY);
  current += sprintf(current, "%c:%X,", PDS_KEY_A, (unsigned int) config);
  if (config == SL_WFX_ANTENNA_DIVERSITY) {
    current += sprintf(current, "%c:%X}}", PDS_KEY_B, 1);
  } else {
    current += sprintf(current, "%c:%X}}", PDS_KEY_B, 0);
  }
  result = sl_wfx_send_configuration((const char *)pds, strlen(pds));
  SL_WFX_ERROR_CHECK(result);
  error_handler:
  return result;
}