Page 1 of 1

+BTSTA:xx

Posted: Tue Mar 03, 2015 1:35 am
by byronjbignell
I'm trying to control the on-off state of the Bluetooth Bee I'm using. I've tied it to the state of the solar panel by getting the charge state - basically, if the panel is charging it's daylight so turn the Bluetooth Bee 'on' and configure to be inquirable - which means that if the charge state is anything other than "charging" turn the Bluetooth Bee "off" - so far so good, except for turning the little beast back on.

Because this has to be in the loop I need to base the call to the bluetooth configuration on the current state of the bluetooth bee - and that's where "+BTSTA:xx" comes in. It's supposed to return the current state of the Bee as a two digit pair.

Code: Select all

\r\n+BTSTA:xx\r\n xx status:
0, Initializing
1, Ready
2, Inquiring
3, Connecting
4, Connected
Meaning that if you get back: 11, the BT Bee is "ready" and 14 means it's connected.

I'm trying to write code that looks at the state of the BT bee and if it's not connected and / or not ready then initialize it. This is on the theory that even inside the loop the state of the external device will allow conditional logic to work - (insert laughter here)

So, why does "+BTSTA:xx" only ever return 13 to me when the LEDs on the BT Bee clearly indicate that it's not connecting - that it's ready (inquirable) and not paired (connected)?

Thoughts?

B

Re: +BTSTA:xx

Posted: Tue Mar 03, 2015 9:59 am
by byronjbignell
It really just appears that there's no way to actually interrogate the BT Bee and get a real status / state from it - at least not from the Stalker base shield - in this case. I really wish there were a more capable base shield like the stalker that provided the same utility but with better support for the states and properties of add-on shields like the BT Bee.

Just saying.

B