[Kde-hardware-devel] Blackberry playbook/Z10 and device notofier

Sergey Vidyuk sir.vestnik at gmail.com
Thu May 2 11:01:25 UTC 2013


В письме от 2 мая 2013 11:12:21 пользователь Àlex Fiestas написал:
> On Friday 26 April 2013 15:15:49 Sergey Vidyuk wrote:
> > Hello
> > 
> > I have blackberry playbook and want to simplify work with it in KDE. I
> > want
> > to see a device in the device notifier and dolphin left panel when I plug
> > it via usb. The issue is the way device interacts with a PC.
> > 
> >  * it's visible as usb network interface
> >  * there is DHCP server onboard
> >  * after IP is obtained device internal storrage is accessed throug the
> >  SMB
> > 
> > protocol.
> > 
> > I've configured running dhcpcd on device is connected using udev+systemd
> > and I can configure automatic mount of the device via fuse, however I
> > would like to have nice integration with KDE instead (device with custom
> > icon in the device notifier applet which can be mounted and unmounted
> > through this applet)
> > 
> > I've read Solid project documentation but found only information how to
> > add
> > actions for devices but not devices themself. Can it be done via
> > configuration (writing desktop entries) or should it be done in some kind
> > of plugin for solid written in C++? Can somebody give me good start point
> > to digg how to do what I want?
> 
> Probably some C++ will have to be involved, we have to:
> -Detect these devices
> -Know that these devices talk samba
> -Know the IP we should talk to
> 
> Detecting and be possibly handled either by adding the device to MPI [1] or
> udev rule (perhaps udev will be better). In MPI or Udev rule we should
> indicate that they use samba, somehow.

I've written udev rule to detect playbook connection as I mentioned (attaching 
it to this letter). It only renames network interface name to blackberry# 
currently. Which way should I indicate that it uses samba?

Solid lists connected playbook in the following way:
$ solid-hardware list details
udi = 
'/org/kde/solid/udev/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/net/blackberry0'
  parent = '/org/kde/solid/udev'  (string)
  vendor = 'Research In Motion, Ltd.'  (string)
  product = 'RIM Network Device'  (string)
  description = 'Networking Interface'  (string)
  NetworkInterface.ifaceName = 'blackberry0'  (string)
  NetworkInterface.wireless = false  (bool)
  NetworkInterface.hwAddress = 'a2:6c:ec:ff:48:ba'  (string)
  NetworkInterface.macAddress = 178588716320954  (0xa26cecff48ba)  (qulonglong)

> 
> Knowing the IP gets a little bit more tricky, I guess that NetworkManager
> should get the ip automatically, the question is how to get it (we need the
> gateway).

In my case I use dhcpcd started by systemd (corresponding service file is also 
attached). Loks like solid can say nothing about my network configuration since 
I don't use NetworkManager:
$ solid-network listdevices
debug: network interface list contains: 0 entries

By the way it's simple to get device IP knowing device IP and netmask. Netmask 
is always 255.255.255.252 which means that only 2 IPs available. According to 
my experience network is always looks like:
 * subnet addr + 1 Playbook IP
 * subnet addr + 2 PC IP
 * subnet addr + 3 broadkast IP

However I always prefere to check playbook IP by ping:
$ ping -c 1 -b <broadcast IP> | grep "bytes from"
This method should always work since there are only 2 hosts in this network PC 
and Playbook

> 
> I have a playbook without BB10, pluging it only produces a CD (which we do
> not seem to support).

BB10 is not yet released for Playbook so I also have TabletOS on it. The 
reason why you see it as cdrom is in the device settings. Just open "Storage & 
Sharing" tab of the device settings and change "USB Connections" from 
"Automatically Detect" to anything else. Device will identify itself as usb 
network interface after that. usb_modeswitch rule reqired here to work with 
playbook and BB10 when device in "Automatically Detect" USB mode.

> 
> Will investigate further in a week.
> 
> Cheerz.
> _______________________________________________
> Kde-hardware-devel mailing list
> Kde-hardware-devel at kde.org
> https://mail.kde.org/mailman/listinfo/kde-hardware-devel

I'm C++ programmer so I can help with writing necessary code to support 
BB10/TabletOS devices. All I need for now is some kind of starting point 
(class name or working example).

Sergey Vidyuk
-------------- next part --------------
# Set of rules to init connected blackberry device

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTRS{idVendor}=="0fca", KERNEL=="usb*", NAME="blackberry%n", TAG+="systemd", ENV{SYSTEMD_WANTS}+="blackberry@%n.service"
-------------- next part --------------
[Unit]
Description=Blackberry device %I
Wants=network.target
Before=network.target
BindsTo=sys-subsystem-net-devices-blackberry%i.device
After=sys-subsystem-net-devices-blackberry%i.device

[Service]
Type=forking
PIDFile=/run/dhcpcd-blackberry%I.pid
ExecStart=/usr/sbin/dhcpcd -C resolv.conf -q -w blackberry%I
ExecStop=/usr/sbin/dhcpcd -x blackberry%I

[Install]
WantedBy=multi-user.target
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20130502/3db18627/attachment.sig>


More information about the Kde-hardware-devel mailing list