1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.server.uwb.indev; 17 18 import com.android.server.uwb.data.UwbRangingData; 19 20 21 /** 22 * Callback from Uwb Service 23 */ 24 interface IUwbServiceListener { 25 /** 26 * Interface for receiving a signal that core Uwb Service has been reset 27 * due to internal error. All Uwb sessions are closed 28 * 29 * @param success : Indicates whether the reset was successful 30 */ onServiceResetReceived(boolean success)31 void onServiceResetReceived(boolean success); 32 33 /** 34 * Interface for receiving Ranging Data Notification 35 * 36 * @param sessionId : Session ID 37 * @param rangingData : refer to UCI GENERIC SPECIFICATION Table 22:Ranging Data 38 * Notification 39 */ onRangeDataNotificationReceived(long sessionId, UwbRangingData rangingData)40 void onRangeDataNotificationReceived(long sessionId, UwbRangingData rangingData); 41 42 /** 43 * Interface for receiving Session Status Notification 44 * 45 * @param sessionId : Session ID 46 * @param state : Session State 47 * @param reasonCode : Reason Code - UCI GENERIC SPECIFICATION Table 15 : state change with 48 * reason codes 49 */ onSessionStatusNotificationReceived(long sessionId, int state, int reasonCode)50 void onSessionStatusNotificationReceived(long sessionId, int state, int reasonCode); 51 52 /** 53 * Interface for receiving Device Status Notification 54 * 55 * @param state : refer to UCI GENERIC SPECIFICATION Table 9: Device Status Notification 56 */ onDeviceStatusNotificationReceived(int state)57 void onDeviceStatusNotificationReceived(int state); 58 59 /** 60 * Interface for receiving Vendor UCI notifications. 61 * 62 * @param gid : Group Identifier 63 * @param oid : Opcode Identifier 64 * @param payload : Payload 65 */ onVendorUciNotificationReceived(int gid, int oid, byte[] payload)66 void onVendorUciNotificationReceived(int gid, int oid, byte[] payload); 67 } 68