This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Undefined external "GAPRole_SetParameter problems

I'm trying to modify the code HostTestRelease project. I want to make it as slave and advertise automatically when it's opened. 

So, I put the code following into hci_ext_app.c in the HostTestRelease project: 

uint16 gapRole_AdvertOffTime = 0;
uint8 initial_advertising_enable = TRUE;
uint8 enable_update_request = DEFAULT_ENABLE_UPDATE_REQUEST;
uint16 desired_min_interval = DEFAULT_DESIRED_MIN_CONN_INTERVAL;
uint16 desired_max_interval = DEFAULT_DESIRED_MAX_CONN_INTERVAL;
uint16 desired_slave_latency = DEFAULT_DESIRED_SLAVE_LATENCY;
uint16 desired_conn_timeout = DEFAULT_DESIRED_CONN_TIMEOUT;
// Set the GAP Role Parameters
GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &initial_advertising_enable );
GAPRole_SetParameter( GAPROLE_ADVERT_OFF_TIME, sizeof( uint16 ), &gapRole_AdvertOffTime );
GAPRole_SetParameter( GAPROLE_ADVERT_DATA, sizeof( advertData ), advertData );
GAPRole_SetParameter( GAPROLE_PARAM_UPDATE_ENABLE, sizeof( uint8 ), &enable_update_request );
GAPRole_SetParameter( GAPROLE_MIN_CONN_INTERVAL, sizeof( uint16 ), &desired_min_interval );
GAPRole_SetParameter( GAPROLE_MAX_CONN_INTERVAL, sizeof( uint16 ), &desired_max_interval );
GAPRole_SetParameter( GAPROLE_SLAVE_LATENCY, sizeof( uint16 ), &desired_slave_latency );
GAPRole_SetParameter( GAPROLE_TIMEOUT_MULTIPLIER, sizeof( uint16 ), &desired_conn_timeout );

I compiled it. There is no error. However, when I try to make it. 

It shows the error : 

Error[e46]: Undefined external "GAPRole_SetParameter::?relay" referred in hci_ext_app. 

I don't know exactly what is the problem.  Is my method the right way do this?

  • Hi,

    just a wild guess because I don't have time to verify in the SDK:

    • you want to build a peripheral, but you are using a project acting as a central as template
    • because of that the necessary files are not included in the build (e.g. peripheral.c or broadcaster.c)
    • this results in a link-error because the definition of the GAPRole_ stuff is in those files

    suggestion: if you are trying to build a peripheral/broadcaster (and if you want to advertize you seem to try that), then use a peripheral or broadcaster-project as template...

    hope that helps

    Andre

  • Thanks Andre for your response. 

    I think that the HostTestRelease can be both central and peripheral. 

    So, I already included the peripheral.h but I don't know why it doesn't work.