Hello Chao,
you will need to use the function BleApp_Start from the app.c in the example project. This function is called from the BleApp_HandleKeys callback by default and you can use it whenever you need it.
If you want to start advertising at the beginning of the application, I would advise to put the function to the BleApp_GenericCallback in the gInitializationComplete_c event type case, so the code would look like this:
void BleApp_GenericCallback (gapGenericEvent_t* pGenericEvent)
{
switch (pGenericEvent->eventType)
{
case gInitializationComplete_c:
{
BleApp_Config();
BleApp_Start();
}
break;
/* ... */
}
}
Hope this helps,
Daniel