I'm trying to connect an android app with a raspberry using OS jessie 8.
I can connect manually if only one android device is available near the raspberry. But if there is more than one android device available I can't identify which device the raspberry has to connect. To solve this I am trying to use WifiP2P Services.
I'm using something like this configuration.
p2p_supplicant.conf:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
driver_param=p2p_device=1
update_config=1
device_name=Pi
device_type=1-0050F204-1
p2p_go_intent=1
p2p_go_ht40=1
Config for the wlan interface:
sudo wpa_supplicant -B -dd -iwlan0 -Dnl80211 -c/etc/wpa_supplicant/p2p_supplicant.conf
I use wpa_cli v2.3 to connect manually to the android device. But I can't obtain any information about the service (i.e service name or any service related info), I only receive the following:
>p2p_find
<3>P2P-DEVICE-FOUND 8a:79:7e:12:0f:22 p2p_dev_addr=8a:79:7e:12:0f:22 pri_dev_type=10-0050F204-5 name='Moto G (4)' config_methods=0x188 dev_capab=0x25 group_capab=0x0
>p2p_peers
8a:79:7e:12:0f:22
>p2p_serv_disc_req 00:00:00:00:00:00 02000001
P2P-SERV-DISC-RESP 8a:79:7e:12:0f:22 82 81000101002436383539646564652d383537342d353961622d393333322d313233343536373839303132095f70726573656e6365c00c0010011562756464796e616d653d4a6f686e20446f65363234116e616d653d5f766963696e69747961707011617661696c61626c653d76697369626c650f6c697374656e706f72743d363736373900010100095f70726573656e6365c00c000c012436383539646564652d383537342d353961622d393333322d313233343536373839303132c027
From the documentation I know that the event P2P-SERV-DISC-RESP should have the format:
P2P-SERV-DISC-RESP: Indicate reception of a P2P service discovery response. The following parameters are included after the event prefix: source address, Service Update Indicator, Service Response TLV(s) as hexdump.
But, I can't decode the tlv's response. I tried to use online decoders but They are not working either.
How can I decode this tlv's response? or if I can't, How can I can identify the android device?