[FRDM-MKW38] Unable to set advertising parameters

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[FRDM-MKW38] Unable to set advertising parameters

ソリューションへジャンプ
1,454件の閲覧回数
rahme
Contributor II

Hello everyone,

 

I'm trying to advertise using the Connectivity Framework:

 

/* in app_config.c */
gAdvParams = gGapDefaultAdvertisingParameters_d;

/* in app.c */
void BleApp_Start(void)
{
  /*
  ...
  */

  bleResult_t ret;
  ret = Gap_SetAdvertisingParameters(&gAdvParams);
  // gBleFeatureNotSupported_c == ret (0x04U)
}

 

I can't figure out why Gap_SetAdvertisingParameters() returns with gBleFeatureNotSupported_c, any idea?

 

Cheers.

0 件の賞賛
返信
1 解決策
1,368件の閲覧回数
rahme
Contributor II

Hi,

Thank your for your answer. From "Bluetooth Low Energy Application Developper Guide.pdf"

If one attempts to use an API that is not supported (for instance, calling Gap_Connect with the
lib_ble_5-0_host_peripheral_cm0p_iar.a and lib_ble_5-0_host_peripheral_cm0p_gcc.a), then the API returns the
gBleFeatureNotSupported_c error code. Similarly, if the API for AE is used with a host library that does not have
support for AE (for instance, calling Gap_SetExtAdvertisingParameters with the lib_ble_5-0_host_peripheral_cm0p_iar.a and
lib_ble_5-0_host_peripheral_cm0p_gcc.a), then gBleFeatureNotSupported_c is returned.

All I have to do is to link against lib_ble_5-0_host_cm0p_gcc.a to have support for both Peripheral/Central API.

Have a good day.

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,438件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

You should assign the struct value to the gAdvParams when this variable is defined. 

'gAdvParams = gGapDefaultAdvertisingParameters_d' is not legal.

 

The legal statement is :

const gapAdvertisingParameters_t gAdvParams = gGapDefaultAdvertisingParameters_d.

 

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信
1,432件の閲覧回数
rahme
Contributor II

Hi,

Thank you for your answer. I changed my gAdvParams definition to the following:

gapAdvertisingParameters_t gAdvParams = {
    /* minInterval */         gGapAdvertisingIntervalDefault_c,
    /* maxInterval */         gGapAdvertisingIntervalDefault_c,
    /* advertisingType */     gAdvConnectableUndirected_c,
    /* addressType */         gBleAddrTypePublic_c,
    /* directedAddressType */ gBleAddrTypePublic_c,
    /* directedAddress */     {0, 0, 0, 0, 0, 0},
    /* channelMap */          (gapAdvertisingChannelMapFlags_t) (gGapAdvertisingChannelMapDefault_c),
    /* filterPolicy */        gProcessAll_c
};

I used the same definition as the adv_ext_central demo. Still running into the same issue.

Something worth mentioning, my code for advertising has adv_ext_central demo as a baseline (for some reason). I want to know if this can be a problem.

 

P.S: I have no issue running my code using the adv_ext_peripheral demo.

 

Have a great day!

Cheers

0 件の賞賛
返信
1,423件の閲覧回数
nxf56274
NXP Employee
NXP Employee

Hi,

In app_preinclude.h, you define the gAppExtAdvEnable_d. So the kw38 will use the extended adv. The legacy adv function can't be used. The legacy adv is realized by extended adv. So the extended adv can broadcast like the legacy adv. The first parameter of gapExtAdvertisingParameters_t has 4 definition. The first definition is  'mLegacyAdvSetId_c'. So it will tell the mcu to broadcast like the  legacy adv.

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 days after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信
1,369件の閲覧回数
rahme
Contributor II

Hi,

Thank your for your answer. From "Bluetooth Low Energy Application Developper Guide.pdf"

If one attempts to use an API that is not supported (for instance, calling Gap_Connect with the
lib_ble_5-0_host_peripheral_cm0p_iar.a and lib_ble_5-0_host_peripheral_cm0p_gcc.a), then the API returns the
gBleFeatureNotSupported_c error code. Similarly, if the API for AE is used with a host library that does not have
support for AE (for instance, calling Gap_SetExtAdvertisingParameters with the lib_ble_5-0_host_peripheral_cm0p_iar.a and
lib_ble_5-0_host_peripheral_cm0p_gcc.a), then gBleFeatureNotSupported_c is returned.

All I have to do is to link against lib_ble_5-0_host_cm0p_gcc.a to have support for both Peripheral/Central API.

Have a good day.

0 件の賞賛
返信