1#!/usr/bin/env python3 2# 3# Copyright 2018 - Google 4# 5# Licensed under the Apache License, Version 2.0 (the "License"); 6# you may not use this file except in compliance with the License. 7# You may obtain a copy of the License at 8# 9# http://www.apache.org/licenses/LICENSE-2.0 10# 11# Unless required by applicable law or agreed to in writing, software 12# distributed under the License is distributed on an "AS IS" BASIS, 13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14# See the License for the specific language governing permissions and 15# limitations under the License. 16 17###################################################### 18# Wifi P2p framework designed value 19###################################################### 20P2P_FIND_TIMEOUT = 120 21GO_IP_ADDRESS = '192.168.49.1' 22 23###################################################### 24# Wifi P2p Acts flow control timer value 25###################################################### 26 27DEFAULT_TIMEOUT = 30 28DEFAULT_CONNECT_SLEEPTIME = 3 29DEFAULT_POLLING_SLEEPTIME = 1 30DEFAULT_SLEEPTIME = 5 31DEFAULT_FUNCTION_SWITCH_TIME = 10 32DEFAULT_SERVICE_WAITING_TIME = 20 33DEFAULT_GROUP_CLIENT_LOST_TIME = 60 34 35P2P_CONNECT_NEGOTIATION = 0 36P2P_CONNECT_JOIN = 1 37P2P_CONNECT_INVITATION = 2 38###################################################### 39# Wifi P2p sl4a Event String 40###################################################### 41CONNECTED_EVENT = "WifiP2pConnected" 42DISCONNECTED_EVENT = "WifiP2pDisconnected" 43PEER_AVAILABLE_EVENT = "WifiP2pOnPeersAvailable" 44CONNECTION_INFO_AVAILABLE_EVENT = "WifiP2pOnConnectionInfoAvailable" 45ONGOING_PEER_INFO_AVAILABLE_EVENT = "WifiP2pOnOngoingPeerAvailable" 46ONGOING_PEER_SET_SUCCESS_EVENT = "WifiP2psetP2pPeerConfigureOnSuccess" 47CONNECT_SUCCESS_EVENT = "WifiP2pConnectOnSuccess" 48CREATE_GROUP_SUCCESS_EVENT = "WifiP2pCreateGroupOnSuccess" 49SET_CHANNEL_SUCCESS_EVENT = "WifiP2pSetChannelsOnSuccess" 50GROUP_INFO_AVAILABLE_EVENT = "WifiP2pOnGroupInfoAvailable" 51 52###################################################### 53# Wifi P2p local service event 54#################################################### 55 56DNSSD_EVENT = "WifiP2pOnDnsSdServiceAvailable" 57DNSSD_TXRECORD_EVENT = "WifiP2pOnDnsSdTxtRecordAvailable" 58UPNP_EVENT = "WifiP2pOnUpnpServiceAvailable" 59 60DNSSD_EVENT_INSTANCENAME_KEY = "InstanceName" 61DNSSD_EVENT_REGISTRATIONTYPE_KEY = "RegistrationType" 62DNSSD_TXRECORD_EVENT_FULLDOMAINNAME_KEY = "FullDomainName" 63DNSSD_TXRECORD_EVENT_TXRECORDMAP_KEY = "TxtRecordMap" 64UPNP_EVENT_SERVICELIST_KEY = "ServiceList" 65 66###################################################### 67# Wifi P2p local service type 68#################################################### 69P2P_LOCAL_SERVICE_UPNP = 0 70P2P_LOCAL_SERVICE_IPP = 1 71P2P_LOCAL_SERVICE_AFP = 2 72 73###################################################### 74# Wifi P2p group capability 75###################################################### 76P2P_GROUP_CAPAB_GROUP_OWNER = 1 77 78 79###################################################### 80# Wifi P2p UPnP MediaRenderer local service 81###################################################### 82class UpnpTestData(): 83 AVTransport = "urn:schemas-upnp-org:service:AVTransport:1" 84 ConnectionManager = "urn:schemas-upnp-org:service:ConnectionManager:1" 85 serviceType = "urn:schemas-upnp-org:device:MediaRenderer:1" 86 uuid = "6859dede-8574-59ab-9332-123456789011" 87 rootdevice = "upnp:rootdevice" 88 89 90###################################################### 91# Wifi P2p Bonjour IPP & AFP local service 92###################################################### 93class IppTestData(): 94 ippInstanceName = "MyPrinter" 95 ippRegistrationType = "_ipp._tcp" 96 ippDomainName = "myprinter._ipp._tcp.local." 97 ipp_txtRecord = {"txtvers": "1", "pdl": "application/postscript"} 98 99 100class AfpTestData(): 101 afpInstanceName = "Example" 102 afpRegistrationType = "_afpovertcp._tcp" 103 afpDomainName = "example._afpovertcp._tcp.local." 104 afp_txtRecord = {} 105