Hi,

An easier way to determine if the Shimmer has lost the BT connection is to
use Bluetooth.connectionClosed() event. In this event you can just post a
task to do whatever you want (such as logging to SD).

Equally you can use Bluetooth.connectionMade() event to tell when a BT
connection is re-established.

You will, however, need to do a bit more work on the host (PC) side to (a)
realise when the BT connection is lost and (b) re-establish the connection
when the Shimmer comes back in range (i.e. when the connection is lost you
will need to periodically scan and when the shimmer is detected again
establish a new connection).

The 802.15.4 radio is more suitable for the type of scheme you describe (as
it is connectionless, unreliable, best effort, etc.).

Mike



On Mon, May 14, 2012 at 7:03 PM, Maxim Michel <[email protected]> wrote:

> Hello again,
>
> For my scenario i keep sending a serial command from a c# app to my
> shimmer every 1 second over Bluetooth.
> As soon as the Shimmer hasn't got any BT-connection anymore (so no serial
> commands are received) the Shimmer must perform a function call (i.e.
> SD-logging() ). When he starts to receive the commands again, it must call
> another function (i.e. streamingdata() ).
>
> Does anyone see a solution on how to write this in code? Or does this seem
> to be unlikely to work?
>
> Thanks
>
>
> _______________________________________________
> Shimmer-users mailing list
> [email protected]
> https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users
>
>
_______________________________________________
Shimmer-users mailing list
[email protected]
https://lists.eecs.harvard.edu/mailman/listinfo/shimmer-users

Reply via email to