RE: [RFC PATCH BlueZ] doc: Document Broadcaster/Observer API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Lizardo,

> -----Original Message-----
> From: Anderson Lizardo [mailto:anderson.lizardo@xxxxxxxxxxxxx]
> Sent: Monday, April 16, 2012 3:11 PM
> To: Ganir, Chen
> Cc: linux-bluetooth@xxxxxxxxxxxxxxx
> Subject: Re: [RFC PATCH BlueZ] doc: Document Broadcaster/Observer API
> 
> Hi Chen,
> 
> On Mon, Apr 16, 2012 at 4:07 AM, Ganir, Chen <chen.ganir@xxxxxx> wrote:
> >> +             void RegisterBroadcaster(dict values)
> >> +
> >> +                     Set Advertising data for broadcast. Different
> >> +                     applications can register different Adv. data
> types,
> >> +                     and they are all concatenated to form the Adv.
> data.
> >> +                     Broadcasting is enabled as soon as the first
> >> +                     RegisterBroadcaster() call is made.
> >> +
> >> +                     Use UnregisterBroadcaster() to release Adv.
> data for
> >> +                     the application. Advertising data is also
> released
> >> when
> >> +                     application exits, and once the last
> Broadcaster
> >> exits,
> >> +                     advertising is disabled.
> >> +
> >> +                     Possible Errors:
> org.bluez.Error.InvalidArguments
> >> +                                      org.bluez.Error.Failed
> >> +
> > What if the data changes? What if I register for Service Data, and
> the service data changes? Do I need to RegisterBroadcaster again?
> 
> In this API, it needs to be called again. We need to clarify more
> these cases here. Will do for next version.
> 
I would suggest adding a new API, called UpdateBroadcastData() which will be used by a registered broadcaster to update it's broadcasting data. Using the same RegisterBroadcaster() will cause inconsistency between the regiseter/unregister functions which will break the logic - you may see many registerBroadcaster calls, but only one unregister call.

> >> +             void UnregisterBroadcaster()
> >> +
> >> +                     This method will release any previously set
> >> Advertising
> >> +                     data.
> >> +
> >> +                     Note that a broadcast procedure is shared
> between all
> >> +                     sessions, thus calling UnregisterBroadcaster()
> will
> >> +                     only release a single session.
> >> +
> >> +                     Possible errors: org.bluez.Error.Failed
> >> +
> >> +             void RegisterObserver(object agent, array{byte}
> data_types)
> >> +
> >> +                     Registers an observer agent to monitor
> broadcasts.
> >> This
> >> +                     agent will be notified whenever a broadcast is
> >> received
> >> +                     that contains any of selected Advertising data
> types.
> >> +
> >> +                     Possible errors:
> org.bluez.Error.InvalidArguments
> >> +
> > Will this automatically start the scanning for advertising?
> 
> Not sure yet :). It will depend on how the underlying mgmt API will
> work. There is a clear conflict/dependency here with BR/EDR/LE
> discovery.
> 
> > How will you combine this with the device search for dual mode
> devices?
> 
> One possibility if for RegisterObserver() to trigger a LE only
> discovery (using the existing mgmt API), then when some application
> triggers the dual mode discovery, it just switches to BR/EDR/LE. I
> suppose this is fully supported by current mgmt discovery API.
> 
> (note that I'm ignoring the scan parameters here for now; as explained
> on previous e-mail, it needs a broader discussion.)
> 
> >> +             void UnregisterObserver(object agent)
> >> +
> >> +                     Unregisters an observer. Broadcasts will not
> be
> >> +                     notified to this agent anymore.
> >> +
> >> +                     Possible errors:
> org.bluez.Error.InvalidArguments
> > Will unregistering ALL observers stop the scan for advertising ?
> 
> If there is no pending BR/EDR/LE discovery, yes. But I think this
> "detail" can be left out from the documentation. After unregister, the
> application will not receive any new broadcast information on the
> agent.
> 
> Thanks for your comments, we will fill the missing information and
> send a new version soon.
> 
> Best Regards,
> --
> Anderson Lizardo
> Instituto Nokia de Tecnologia - INdT
> Manaus - Brazil


Thanks,
Chen Ganir

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux