On Tue, 11 Dec 2018 23:04:17 +0300 Vasiliy Tolstov <v.tols...@selfip.ru> said:
> вт, 11 дек. 2018 г., 11:23 Carsten Haitzler ras...@rasterman.com: > > > On Mon, 10 Dec 2018 17:34:53 +0300 Vasiliy Tolstov <v.tols...@selfip.ru> > > said: > > > > > вс, 9 дек. 2018 г. в 14:32, Carsten Haitzler <ras...@rasterman.com>: > > > > > > > > On Sun, 9 Dec 2018 11:23:34 +0300 Vasiliy Tolstov <v.tols...@selfip.ru > > > > > > > said: > > > > > > > > > Hi! I'm writing app that periodically scans bluetooth low energy > > > > > devices and if known device in needed range - unlock screen, and when > > > > > range is bigger then needed - lock. > > > > > I found enlightenment_remote -desktop-lock, but how to do in my case > > > > > unlocking? As i see via dbus this is not possible. Why? > > > > > > > > enlightenment_remote is nothing but a handy shell wrapper around the > > msgbus > > > > extensions module ... the script only has lock... the dbus protocol > > also has > > > > unlock. so you need to load the msgbus module to get these controls > > working > > > > to begin with. that's the dbus extension module under system. then use > > > > d-feet or something to explore the interface/api and have your app > > actually > > > > use the dbus protocol... :) > > > > > > Thanks! Last question - if i want to after lid open automatic unlock > > > via dbus if i see bluetooth device in nearest range, how can i ran my > > > app only when lid is open? > > > I know about screen lock app and screen unlock app, but when it runs? > > > > you'll have to figure out how to see lid events - acpid for example (this > > is > > what enlightenment does). do you really care about the lid closing OR the > > system suspending... OR the screen locking as they are all different > > things. > > lid closing is just an event. what happens as a result is another matter. > > > > if it were an enlightenment module it'd have access to enlightenment's > > internal events and be able to see this as well as have detailed access t > > the > > desklock api and infra and status etc. > > > > as enlightenment has an up to date bluez5 module now it makes a lot more > > sense > > at least to enlightenment to just have the bluez5 module have this feature > > as it > > already tracks all bt devices that bluez knows about (paired or scanned). > > so > > it'd be a trivial bit of code to add like: > > > > // existing callback for when bt objects (e.g. devices) are added by bluez > > cb_obj_add(Obj *obj) { > > ... > > if (is_in_unlock_list(obj->address) { > > Eina_List *l; > > E_Zone *zone; > > > > e_desklock_hide(); > > EINA_LIST_FOREACH(e_comp->zones, l, zone) { > > e_desklock_zone_block_set(zone, EINA_TRUE); > > } > > } > > ... > > } > > > > // existing callback when bt objects are removed by bluez > > > > ebluez5_popup_device_del(Obj *obj) { > > ... > > if (is_in_unlock_list(obj->address) { > > Eina_List *l; > > E_Zone *zone; > > > > EINA_LIST_FOREACH(e_comp->zones, l, zone) { > > e_desklock_zone_block_set(zone, EINA_FALSE); > > } > > } > > ... > > } > > > > actually i probably should add some more infra to desklock specifically to > > have > > a single suspend "refcount" for desklock so the lock will come back up if > > asked > > for once the block count goes to 0. also the above code probably should > > also > > count the number of unlock devices and only do a block or unblock when it > > goes > > from 0 or back to 0. but it's a fairly small and easy amount of code. it > > all > > depends on how complex it should be. should just the existence of a bt > > device > > count - should it have been paired before? connected? lots of bt devices > > don't > > auto-connect.... should this just affect lock? should it enforce suspend > > when > > the bt device(s) go away? or force just a screen blank? or a blank+lock? > > ... :) > > keeping it simple means not having all of these options. :) > > > > -- > > ------------- Codito, ergo sum - "I code, therefore I am" -------------- > > Carsten Haitzler - ras...@rasterman.com > > > Thanks for such great news! My problem now that device in undiscoverable > mode, and it not respond to scan for security, but i know it mac address, > and want to simply check rssi distance... > As i read linux bluetooth have ability to send page request to known mac > address and get rssi data for it. But i cant see such info for dbus or some > code examples. well my experience with bluez is that you have to go into scan mode to get rssi values and you don't always get rssi values for all bt devices. only some of them. l2ping is a cmdline tool to ping bt devices. not all devices connect automatically and connecting them has "consequences" (e.g. a mouse or kbd will make them input devices when connected or audio devices may become output targets for audio). the problem is that i can't find any PASSIVE way to detect a bt device is present (within range of the bt adapter) other than actively pinging it. this unfortunately means polling wakeups for every possible "unlock bt device" just to do this (e.g. with l2ping). so rssi isn't the way to go IMHO. you need to actively ping... :( -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- Carsten Haitzler - ras...@rasterman.com _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel