From 7013acc439e0139c9c17b987c5f0a72d681923ae Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Tue, 10 Sep 2019 11:49:00 +0200 Subject: [PATCH] init-ifupdown: p2plink: allow to set persistent parameters Use ifupdown variable 'p2p-network-id' to pass a WPA supplicant network id, to pre-populate some parameters (SSID/passphrase) when creating the group where this device is the GO. Also replace go_intent=7 with the auto parameter. According to the documentation: "auto" can be used to request wpa_supplicant to automatically figure out whether the peer device is operating as a GO and if so, use join-a-group operation rather than GO Negotiation. https://jira.digi.com/browse/DEL-6741 Signed-off-by: Javier Viguera --- .../recipes-core/init-ifupdown/init-ifupdown-1.0/p2plink | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/p2plink b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/p2plink index ec91655a6..f0f617962 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/p2plink +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/p2plink @@ -24,6 +24,7 @@ # p2p-freq # p2p-local-address # p2p-local-netmask +# p2p-network-id # # Execute only for the p2p0 interface @@ -54,7 +55,7 @@ if [ "${MODE}" = "start" ]; then # Peer found, establish the link log info "establish P2P link" - wpa_cli -i"${IFACE}" p2p_connect "${IF_P2P_PEER_MAC}" pbc go_intent=7 ${IF_P2P_FREQ:+freq=${IF_P2P_FREQ}} + wpa_cli -i"${IFACE}" p2p_connect "${IF_P2P_PEER_MAC}" pbc ${IF_P2P_NETWORK_ID:+persistent=${IF_P2P_NETWORK_ID}} ${IF_P2P_FREQ:+freq=${IF_P2P_FREQ}} auto for _ in $(seq 20); do if wpa_cli status 2>&1 | grep -qs "^wpa_state=COMPLETED$"; then if wpa_cli status 2>&1 | grep -qs "^mode=P2P GO$"; then