1 /* 2 * Copyright (C) 2021 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 #pragma once 17 18 typedef uint8_t nfc_event_t; 19 typedef uint8_t nfc_status_t; 20 21 /* 22 * The callback passed in from the NFC stack that the HAL 23 * can use to pass events back to the stack. 24 */ 25 typedef void(nfc_stack_callback_t)(nfc_event_t event, 26 nfc_status_t event_status); 27 28 /* 29 * The callback passed in from the NFC stack that the HAL 30 * can use to pass incomming data to the stack. 31 */ 32 typedef void(nfc_stack_data_callback_t)(uint16_t data_len, uint8_t* p_data); 33 34 enum { 35 HAL_NFC_OPEN_CPLT_EVT = 0u, 36 HAL_NFC_CLOSE_CPLT_EVT = 1u, 37 HAL_NFC_POST_INIT_CPLT_EVT = 2u, 38 HAL_NFC_PRE_DISCOVER_CPLT_EVT = 3u, 39 HAL_NFC_REQUEST_CONTROL_EVT = 4u, 40 HAL_NFC_RELEASE_CONTROL_EVT = 5u, 41 HAL_NFC_ERROR_EVT = 6u, 42 HAL_HCI_NETWORK_RESET = 7u, 43 }; 44 45 enum { 46 HAL_NFC_STATUS_OK = 0u, 47 HAL_NFC_STATUS_FAILED = 1u, 48 HAL_NFC_STATUS_ERR_TRANSPORT = 2u, 49 HAL_NFC_STATUS_ERR_CMD_TIMEOUT = 3u, 50 HAL_NFC_STATUS_REFUSED = 4u, 51 }; 52