Re: Scan sometimes stops working (continued #2)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Juar_2150386
Level 4
Level 4
5 likes given First like received First like given

Applications team: grsr riya rroy zhez zhxh yans kavs shjl

Per this thread and others on the same topic: Scan sometimes stops working (continued)

I think I have the same problem...

My sensor is always HIGH_UNDIRECTED_DISCOVERABLE. In the callback hello_sensor_advertisement_stopped function, I restart the bleprofile_Discoverable(HIGH_UNDIRECTED_DISCOVERABLE, NULL ).

My application works fine, I have two buttons in my sensor and I change led's color (to see if my app is not freez...). But when my board is ON more than 12 hours, I can't connect to it.... I can push button to change color, so my app works fine (uart works too) but it's like the BLE is gone in sleep mode.

My soft contains these functions:

void hello_sensor_enter_hidoff(void)

{

// Do nothing

}

void hello_sensor_abort_hidoff(void)

{

// Do nothing

}

the .cgs file contains:

ENTRY "PMU Crystal Warm up Time"

{

   "Crystal warm up time" = 5000  

}

################################################################################

#  Low power configuration

###############################################################################

ENTRY "Sleep Mode Configuration"

{

    "Sleep mode" = "HIDD"

    "Sleep enable" = 0;

}

##############################################################################

Do you have any idea?

Thanks

0 Likes
1 Solution

The API bleprofile_Discoverable() should work with HIGH_UNDIRECTED as well. Not sure why its failing after few hours.

Q) Does it exist a function which return the state of the BLE device (scanning or not)?

A) Do you mean scanning or advertising? If about advertising, you may try the API -  bleprofile_GetDiscoverable(void); (/WICED-Smart-SDK/include/bleprofile.h) . Check if it helps your requirement.

Regards,

Anjana

View solution in original post

0 Likes
4 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi ,

I couldn't able to understand your issue correctly.

Do you mean , your project will work perfectly till (say ) 12 hrs, later some point of time, it will stop connecting to the Central device or won't work as expected?

Could you please share your project and steps to reproduce to test at our side?

Regards,
Anjana

0 Likes

Hi,

Yes, my project works perfectly and, later some point of time (3hrs, 12hrs or 18hrs..), it will stop.

My sensor is always bleprofile_Discoverable() active.

A client can connect to it with an other CYW20736 or a smartphone.

When the point of time is delayed my sensor application seems working (I can push button and change led's color) but the BLEis not discoverable (I can't see it with my smartphone)...It's seems that only the BLE layer is not active...

In hello_sensor_advertisement_stopped() callback, I have tried to replace bleprofile_Discoverable(HIGH) by a set_adv(1) function (i can't remeber the function) but the problem is unchanged..

I have tried with bleprofile_Discoverable(LOW) the problem seem solved (my board is always running and works since 5 days).

I hope the problem was the use of LOW_UNDIRECTED in place of HIGH_UNDIRECTED..

Thanks

0 Likes

Does it exist a function which return the state of the BLE device (scanning or not)?

If yes, I could periodically use it and restart the scan if it stoped

thanks

0 Likes

The API bleprofile_Discoverable() should work with HIGH_UNDIRECTED as well. Not sure why its failing after few hours.

Q) Does it exist a function which return the state of the BLE device (scanning or not)?

A) Do you mean scanning or advertising? If about advertising, you may try the API -  bleprofile_GetDiscoverable(void); (/WICED-Smart-SDK/include/bleprofile.h) . Check if it helps your requirement.

Regards,

Anjana

0 Likes