KW40z "heart rate sensor" BLE problem

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

KW40z "heart rate sensor" BLE problem

ソリューションへジャンプ
916件の閲覧回数
chaosmagin
Contributor I

Hello!!

I am programming board KW40Z and implementing some sample code.
In the "heart rate sensor" example, I need to press button SW4 to turn on the bluetooth.

Can anyone advise what to do in the code to turn on the bluetooth as the power is on?

Thank you very much!

1 解決策
720件の閲覧回数
danielkresta
NXP Employee
NXP Employee

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

元の投稿で解決策を見る

2 返答(返信)
721件の閲覧回数
danielkresta
NXP Employee
NXP Employee

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

720件の閲覧回数
chaosmagin
Contributor I

Hi Daniel,

It works perfectly.

Thanks for your help!

Smagin