1#!/usr/bin/env python3.4
2#
3#   Copyright 2016 - 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# NsdManager.RegistrationListener events
19######################################################
20REG_LISTENER_EVENT = "NsdRegistrationListener"
21
22# event type - using REG_LISTENER_CALLBACK
23REG_LISTENER_EVENT_ON_REG_FAILED = "OnRegistrationFailed"
24REG_LISTENER_EVENT_ON_SERVICE_REGISTERED = "OnServiceRegistered"
25REG_LISTENER_EVENT_ON_SERVICE_UNREG = "OnServiceUnregistered"
26REG_LISTENER_EVENT_ON_UNREG_FAILED = "OnUnregistrationFailed"
27
28# event data keys
29REG_LISTENER_DATA_ID = "id"
30REG_LISTENER_CALLBACK = "callback"
31REG_LISTENER_ERROR_CODE = "error_code"
32
33######################################################
34# NsdManager.DiscoveryListener events
35######################################################
36DISCOVERY_LISTENER_EVENT = "NsdDiscoveryListener"
37
38# event type - using DISCOVERY_LISTENER_DATA_CALLBACK
39DISCOVERY_LISTENER_EVENT_ON_DISCOVERY_STARTED = "OnDiscoveryStarted"
40DISCOVERY_LISTENER_EVENT_ON_DISCOVERY_STOPPED = "OnDiscoveryStopped"
41DISCOVERY_LISTENER_EVENT_ON_SERVICE_FOUND = "OnServiceFound"
42DISCOVERY_LISTENER_EVENT_ON_SERVICE_LOST = "OnServiceLost"
43DISCOVERY_LISTENER_EVENT_ON_START_DISCOVERY_FAILED = "OnStartDiscoveryFailed"
44DISCOVERY_LISTENER_EVENT_ON_STOP_DISCOVERY_FAILED = "OnStopDiscoveryFailed"
45
46# event data keys
47DISCOVERY_LISTENER_DATA_ID = "id"
48DISCOVERY_LISTENER_DATA_CALLBACK = "callback"
49DISCOVERY_LISTENER_DATA_SERVICE_TYPE = "service_type"
50DISCOVERY_LISTENER_DATA_ERROR_CODE = "error_code"
51
52######################################################
53# NsdManager.ResolveListener events
54######################################################
55RESOLVE_LISTENER_EVENT = "NsdResolveListener"
56
57# event type using RESOLVE_LISTENER_DATA_CALLBACK
58RESOLVE_LISTENER_EVENT_ON_RESOLVE_FAIL = "OnResolveFail"
59RESOLVE_LISTENER_EVENT_ON_SERVICE_RESOLVED = "OnServiceResolved"
60
61# event data keys
62RESOLVE_LISTENER_DATA_ID = "id"
63RESOLVE_LISTENER_DATA_CALLBACK = "callback"
64RESOLVE_LISTENER_DATA_ERROR_CODE = "error_code"
65
66######################################################
67# NsdServiceInfo elements
68######################################################
69NSD_SERVICE_INFO_HOST = "serviceInfoHost"
70NSD_SERVICE_INFO_PORT = "serviceInfoPort"
71NSD_SERVICE_INFO_SERVICE_NAME = "serviceInfoServiceName"
72NSD_SERVICE_INFO_SERVICE_TYPE = "serviceInfoServiceType"