android - Switching roles between cengtral and peripheral -


i able to: 1. establish gap connection between central , peripheral devices 2. send data central peripheral writing characteristic.

now ,i want send data central. how can done? peripheral start performing role of central?or response peripheral central sending data?

please guide me on this.

i guess want peer-to-peer bluetooth transfer mechanism. had followed following approach:

  • every device listens incoming connection request.
  • the device wants sent data, connects other device , transfers data.

that means device must act in central , peripheral mode simultaneously @ times.

if doesn't work simultaneously, need stop advertising if writing data.since writing data through ble guess must small.that means device won't advertising short amount of time.

you can use hybrid approach in advertise using ble transfer data on classic bluetooth.

alternative approach:

from peripheral, advertise 2 characteristic..one characteristic(type write) on central write on , other characteristic(type notify) on central listening changes. second characteristic used sending acknowledgement peripheral central.

once central writes characteristics, peripheral can acknowledge central updating "notify" characteristic.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -