1 /* 2 * Copyright 2024 NXP 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 17 /* NCI GID index*/ 18 #define NCI_GID_INDEX 0 19 /* NCI OID index*/ 20 #define NCI_OID_INDEX 1 21 /* NCI message length index*/ 22 #define NCI_MSG_LEN_INDEX 2 23 /* NCI message index for feature*/ 24 #define NCI_MSG_INDEX_FOR_FEATURE 3 25 /* NCI message index feature value*/ 26 #define NCI_MSG_INDEX_FEATURE_VALUE 4 27 #define NCI_GID_PROP 0x0F 28 #define NCI_HEADER_MIN_LEN 3 // GID + OID + LENGTH 29 #define RF_DISC_CMD_NO_OF_CONFIG_INDEX 3 30 #define RF_DISC_CMD_CONFIG_START_INDEX 4 31 // RF tech mode and Disc Frequency values 32 #define RF_DISC_CMD_EACH_CONFIG_LENGTH 2 33 34 /* Android Parameters */ 35 #define NCI_ANDROID_POWER_SAVING 0x01 36 #define NCI_ANDROID_OBSERVER_MODE 0x02 37 #define NCI_ANDROID_GET_OBSERVER_MODE_STATUS 0x04 38 39 /* Android Power Saving Params */ 40 #define NCI_ANDROID_POWER_SAVING_PARAM_SIZE 2 41 #define NCI_ANDROID_POWER_SAVING_PARAM_DISABLE 0 42 #define NCI_ANDROID_POWER_SAVING_PARAM_ENABLE 1 43 44 #define NCI_RSP_SIZE 2 45 #define NCI_RSP_OK 0 46 #define NCI_RSP_FAIL 3 47 48 #define NCI_PROP_NTF_GID 0x6F 49 #define NCI_PROP_LX_NTF_OID 0x36 50 #define NCI_PROP_NTF_ANDROID_OID 0x0C 51 52 #define NCI_RF_DISC_COMMD_GID 0x21 53 #define NCI_RF_DISC_COMMAND_OID 0x03 54 #define NFC_A_PASSIVE_LISTEN_MODE 0x80 55 #define NFC_B_PASSIVE_LISTEN_MODE 0x81 56 #define NFC_F_PASSIVE_LISTEN_MODE 0x82 57 #define NFC_ACTIVE_LISTEN_MODE 0x83 58 #define OBSERVE_MODE 0xFF 59 #define OBSERVE_MODE_DISCOVERY_CYCLE 0x01 60 61 // Observe mode constants 62 #define L2_EVT_TAG 0x01 63 #define CMA_EVT_TAG 0x0A 64 #define MIN_LEN_NON_CMA_EVT 7 65 #define MIN_LEN_CMA_EVT 6 66 #define INDEX_OF_L2_EVT_TYPE 6 67 #define INDEX_OF_L2_EVT_GAIN 5 68 #define INDEX_OF_CMA_EVT_TYPE 4 69 #define INDEX_OF_CMA_EVT_DATA 5 70 #define INDEX_OF_CMA_DATA 7 71 #define MIN_LEN_NON_CMA_EVT 7 72 #define MIN_LEN_CMA_EVT 6 73 #define L2_EVENT_TRIGGER_TYPE 0x1 74 #define CMA_EVENT_TRIGGER_TYPE 0x02 75 #define CMA_DATA_TRIGGER_TYPE 0x0C 76 // Event types to send upper layer 77 #define TYPE_RF_FLAG 0x00 78 #define TYPE_MOD_A 0x01 79 #define TYPE_MOD_B 0x02 80 #define TYPE_MOD_F 0x03 81 #define TYPE_UNKNOWN 0x07 82 #define EVENT_UNKNOWN 0x00 83 #define EVENT_MOD_A 0x01 84 #define EVENT_MOD_B 0x02 85 #define EVENT_MOD_F 0x03 86 #define EVENT_RF_ON 0x08 87 #define EVENT_RF_OFF 0x09 88 #define REQ_A 0x26 89 #define WUP_A 0x52 90 #define TYPE_B_APF 0x05 91 #define TYPE_F_CMD_LENGH 0x06 92 #define TYPE_F_ID 0xFF 93 #define OBSERVE_MODE_OP_CODE 0x03 94 #define GAIN_FIELD_LENGTH 1 95 #define OP_CODE_FIELD_LENGTH 1 96 #define EVENT_TYPE_FIELD_LENGTH 1 97 #define RF_STATE_FIELD_LENGTH 1 98 #define NCI_MESSAGE_OFFSET 3 99 #define LX_TYPE_MASK 0x0F 100 #define LX_EVENT_MASK 0xF0 101 #define LX_LENGTH_MASK 0x0F 102 #define LX_TAG_MASK 0xF0 103 #define SHORT_FLAG 0x00 104