Indefinite advertisement period

For my application, there is no need for the beacon to ever send out advertisements until it detects motion - when any motion is detected, it starts logging accelerometer data until the device detects a period of no motion, at which point it reverts back to its original state.

The problem is that the IBeacon.ConfigEditor.setAdPeriod(short period) call requires a short, which has a maximum value of 32,767. I'd like to instead disable advertising altogether. Is that possible?

Also, regarding the design choice: after motion is detected, would it be wiser regarding power consumption on the Metawear to establish a connection between the Metawear and the wearable, or to send the accelerometer data via beacon advertisements, taking into consideration that we may want to sample around 50Hz?

Much appreciated!

Comments

  • You can use the Settings.ConfigEditor object to disable advertisement and Settings.startAdvertisement to start advertising again.  These functions are for normal advertisement though.

    You should connect to retrieve data.  Trying to send a high volume of data that frequently through advertising is extremely unreliable.
  • Okay great, thank you very much Eric for your help!
  • I don't see a method in Settings.ConfigEditor that disables advertisement. Would I call setAdInterval? If so, what would be the correct arguments to disable it?
  • Yes, configure the ad interval to have a non-zero timeout.
  • Thank you Eric, my application works like a charm now.

    As a side note, I don't think the documentation makes it clear what the timeout is. It just now clicked that the timeout is the number of seconds after which advertisements stop.
This discussion has been closed.