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_SLEEPTIME = 5 29DEFAULT_FUNCTION_SWITCH_TIME = 10 30DEFAULT_SERVICE_WAITING_TIME = 20 31DEFAULT_GROUP_CLIENT_LOST_TIME = 60 32 33P2P_CONNECT_NEGOTIATION = 0 34P2P_CONNECT_JOIN = 1 35P2P_CONNECT_INVITATION = 2 36###################################################### 37# Wifi P2p sl4a Event String 38###################################################### 39CONNECTED_EVENT = "WifiP2pConnected" 40DISCONNECTED_EVENT = "WifiP2pDisconnected" 41PEER_AVAILABLE_EVENT = "WifiP2pOnPeersAvailable" 42CONNECTION_INFO_AVAILABLE_EVENT = "WifiP2pOnConnectionInfoAvailable" 43ONGOING_PEER_INFO_AVAILABLE_EVENT = "WifiP2pOnOngoingPeerAvailable" 44ONGOING_PEER_SET_SUCCESS_EVENT = "WifiP2psetP2pPeerConfigureOnSuccess" 45CONNECT_SUCCESS_EVENT = "WifiP2pConnectOnSuccess" 46CREATE_GROUP_SUCCESS_EVENT = "WifiP2pCreateGroupOnSuccess" 47SET_CHANNEL_SUCCESS_EVENT = "WifiP2pSetChannelsOnSuccess" 48GROUP_INFO_AVAILABLE_EVENT = "WifiP2pOnGroupInfoAvailable" 49 50###################################################### 51# Wifi P2p local service event 52#################################################### 53 54DNSSD_EVENT = "WifiP2pOnDnsSdServiceAvailable" 55DNSSD_TXRECORD_EVENT = "WifiP2pOnDnsSdTxtRecordAvailable" 56UPNP_EVENT = "WifiP2pOnUpnpServiceAvailable" 57 58DNSSD_EVENT_INSTANCENAME_KEY = "InstanceName" 59DNSSD_EVENT_REGISTRATIONTYPE_KEY = "RegistrationType" 60DNSSD_TXRECORD_EVENT_FULLDOMAINNAME_KEY = "FullDomainName" 61DNSSD_TXRECORD_EVENT_TXRECORDMAP_KEY = "TxtRecordMap" 62UPNP_EVENT_SERVICELIST_KEY = "ServiceList" 63 64###################################################### 65# Wifi P2p local service type 66#################################################### 67P2P_LOCAL_SERVICE_UPNP = 0 68P2P_LOCAL_SERVICE_IPP = 1 69P2P_LOCAL_SERVICE_AFP = 2 70 71###################################################### 72# Wifi P2p group capability 73###################################################### 74P2P_GROUP_CAPAB_GROUP_OWNER = 1 75 76 77###################################################### 78# Wifi P2p UPnP MediaRenderer local service 79###################################################### 80class UpnpTestData(): 81 AVTransport = "urn:schemas-upnp-org:service:AVTransport:1" 82 ConnectionManager = "urn:schemas-upnp-org:service:ConnectionManager:1" 83 serviceType = "urn:schemas-upnp-org:device:MediaRenderer:1" 84 uuid = "6859dede-8574-59ab-9332-123456789011" 85 rootdevice = "upnp:rootdevice" 86 87 88###################################################### 89# Wifi P2p Bonjour IPP & AFP local service 90###################################################### 91class IppTestData(): 92 ippInstanceName = "MyPrinter" 93 ippRegistrationType = "_ipp._tcp" 94 ippDomainName = "myprinter._ipp._tcp.local." 95 ipp_txtRecord = {"txtvers": "1", "pdl": "application/postscript"} 96 97 98class AfpTestData(): 99 afpInstanceName = "Example" 100 afpRegistrationType = "_afpovertcp._tcp" 101 afpDomainName = "example._afpovertcp._tcp.local." 102 afp_txtRecord = {} 103