Nick Pelly | 5d9927b | 2010-09-23 12:47:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 NXP Semiconductors |
| 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 | /*! |
| 18 | * =========================================================================== * |
| 19 | * * |
| 20 | * * |
| 21 | * \file phHciNfc.h * |
| 22 | * \brief HCI Header for the Generic HCI Management. * |
| 23 | * * |
| 24 | * * |
| 25 | * Project: NFC-FRI-1.1 * |
| 26 | * * |
| 27 | * $Date: Mon Apr 5 14:37:06 2010 $ * |
| 28 | * $Author: ing04880 $ * |
| 29 | * $Revision: 1.39 $ * |
| 30 | * $Aliases: NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $ |
| 31 | * * |
| 32 | * =========================================================================== * |
| 33 | */ |
| 34 | |
| 35 | |
| 36 | /*@{*/ |
| 37 | |
| 38 | #ifndef PHHCINFC_H |
| 39 | #define PHHCINFC_H |
| 40 | |
| 41 | /*@}*/ |
| 42 | /** |
| 43 | * \name HCI |
| 44 | * |
| 45 | * File: \ref phHciNfc.h |
| 46 | * |
| 47 | */ |
| 48 | /*@{*/ |
| 49 | #define PH_HCINFC_FILEREVISION "$Revision: 1.39 $" /**< \ingroup grp_file_attributes */ |
| 50 | #define PH_HCINFC_FILEALIASES "$Aliases: NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $" /**< \ingroup grp_file_attributes */ |
| 51 | /*@}*/ |
| 52 | |
| 53 | /* |
| 54 | ################################################################################ |
| 55 | ***************************** Header File Inclusion **************************** |
| 56 | ################################################################################ |
| 57 | */ |
| 58 | |
| 59 | #include <phNfcStatus.h> |
| 60 | #include <phNfcInterface.h> |
| 61 | #ifdef ANDROID |
| 62 | #include <string.h> |
| 63 | #endif |
| 64 | |
| 65 | /* |
| 66 | ################################################################################ |
| 67 | ****************************** Macro Definitions ******************************* |
| 68 | ################################################################################ |
| 69 | */ |
| 70 | |
| 71 | |
| 72 | /* |
| 73 | ################################################################################ |
| 74 | ******************** Enumeration and Structure Definition ********************** |
| 75 | ################################################################################ |
| 76 | */ |
| 77 | |
| 78 | typedef enum phHciNfc_Init |
| 79 | { |
| 80 | HCI_SESSION = 0x00, |
Rob von Behren | 6dd9483 | 2011-09-16 15:05:25 -0700 | [diff] [blame] | 81 | HCI_NFC_DEVICE_TEST, |
| 82 | HCI_CUSTOM_INIT, |
| 83 | HCI_SELF_TEST |
Nick Pelly | 5d9927b | 2010-09-23 12:47:58 -0700 | [diff] [blame] | 84 | }phHciNfc_Init_t; |
| 85 | |
| 86 | /** \ingroup grp_hal_hci |
| 87 | * |
| 88 | * \if hal |
| 89 | * \brief HCI Tag Exchange Information |
| 90 | * \else |
| 91 | * \brief HCI-Specific |
| 92 | * \endif |
| 93 | * |
| 94 | * The <em> Tag Exchange Info Structure </em> holds the exchange information to |
| 95 | * the connected tag . |
| 96 | * |
| 97 | * \note All members of this structure are in parameters [in]. |
| 98 | * |
| 99 | */ |
| 100 | |
| 101 | typedef struct phHciNfc_Tag_XchgInfo |
| 102 | { |
| 103 | /** \internal RF Reader Command Type */ |
| 104 | uint8_t cmd_type; |
| 105 | /** \internal Address Field required for only Mifare |
| 106 | * Family Proprietary Cards. |
| 107 | * The Address Size is Valid only upto 255 Blocks limit |
| 108 | * i:e for Mifare 4K |
| 109 | */ |
| 110 | uint8_t addr; |
| 111 | }phHciNfc_Tag_XchgInfo_t; |
| 112 | |
| 113 | /** \ingroup grp_hal_hci |
| 114 | * |
| 115 | * \if hal |
| 116 | * \brief HCI NFC-IP Exchange Information |
| 117 | * \else |
| 118 | * \brief HCI-Specific |
| 119 | * \endif |
| 120 | * |
| 121 | * The <em> NFC-IP Exchange Info Structure </em> holds the exchange information to |
| 122 | * the connected NFC-IP target . |
| 123 | * |
| 124 | * \note All members of this structure are in parameters [in]. |
| 125 | * |
| 126 | */ |
| 127 | |
| 128 | typedef struct phHciNfc_NfcIP_XchgInfo |
| 129 | { |
| 130 | /** \internal NFC-IP DEP Meta Chining Information */ |
| 131 | uint8_t more_info; |
| 132 | |
| 133 | }phHciNfc_NfcIP_XchgInfo_t; |
| 134 | |
| 135 | /** \ingroup grp_hal_hci |
| 136 | * |
| 137 | * \if hal |
| 138 | * \brief HCI Target Exchange Information |
| 139 | * \else |
| 140 | * \brief HCI-Specific |
| 141 | * \endif |
| 142 | * |
| 143 | * The <em> Target Exchange Info Structure </em> holds all the exchange information to |
| 144 | * the connected target . |
| 145 | * |
| 146 | * \note All members of this structure are in parameters [in]. |
| 147 | * |
| 148 | */ |
| 149 | |
| 150 | |
| 151 | typedef struct phHciNfc_XchgInfo |
| 152 | { |
| 153 | /** \internal Exchange Data/NFC-IP DEP |
| 154 | * Exchange Buffer */ |
| 155 | uint8_t *tx_buffer; |
| 156 | /** \internal Exchange Data/NFC-IP DEP |
| 157 | * Exchange Buffer Length*/ |
| 158 | uint16_t tx_length; |
| 159 | |
| 160 | union |
| 161 | { |
| 162 | phHciNfc_Tag_XchgInfo_t tag_info; |
| 163 | phHciNfc_NfcIP_XchgInfo_t nfc_info; |
| 164 | }params; |
| 165 | |
| 166 | }phHciNfc_XchgInfo_t; |
| 167 | |
| 168 | |
| 169 | |
| 170 | /* |
| 171 | ################################################################################ |
| 172 | *********************** Function Prototype Declaration ************************* |
| 173 | ################################################################################ |
| 174 | */ |
| 175 | |
| 176 | /** |
| 177 | * \ingroup grp_hci_nfc |
| 178 | * |
| 179 | * The phHciNfc_Initialise function initialises the HCI context and all other |
| 180 | * resources used in the HCI Layer for the corresponding interface link. |
| 181 | * |
| 182 | * \param[in,out] psHciHandle psHciHandle is the handle or the context |
| 183 | * of the HCI Layer. |
| 184 | * \param[in] pHwRef pHwRef is the Information of |
| 185 | * the Device Interface Link . |
| 186 | * \param[in] init_mode init_mode specifies the kind of the |
| 187 | * Initialisation for the HCI layer . |
| 188 | * \param[in] pHwConfig pHwConfig is the Information required |
| 189 | * to configure the parameters of the |
| 190 | * NFC Device . |
| 191 | * \param[in] pHalNotify Upper layer Notification function |
| 192 | * pointer. |
| 193 | * \param[in] psContext psContext is the context of |
| 194 | * the Upper Layer. |
| 195 | * \param[in] psHciLayerCfg Pointer to the HCI Layer configuration |
| 196 | * Structure. |
| 197 | * |
| 198 | * \retval NFCSTATUS_PENDING Initialisation of HCI Layer is in Progress. |
| 199 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 200 | * could not be interpreted properly. |
| 201 | * \retval Other errors Errors related to the other layers |
| 202 | * |
| 203 | */ |
| 204 | |
| 205 | extern |
| 206 | NFCSTATUS |
| 207 | phHciNfc_Initialise ( |
| 208 | void *psHciHandle, |
| 209 | void *pHwRef, |
| 210 | phHciNfc_Init_t init_mode, |
| 211 | phHal_sHwConfig_t *pHwConfig, |
| 212 | pphNfcIF_Notification_CB_t pHalNotify, |
| 213 | void *psContext, |
| 214 | phNfcLayer_sCfg_t *psHciLayerCfg |
| 215 | ); |
| 216 | |
| 217 | /** |
| 218 | * \ingroup grp_hci_nfc |
| 219 | * |
| 220 | * The phHciNfc_Release function releases all the resources used in the HCI |
| 221 | * Layer for the corresponding interface link, described by the HCI handle. |
| 222 | * |
| 223 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 224 | * of the HCI Layer. |
| 225 | * \param[in] pHwRef pHwRef is the Information of |
| 226 | * the Device Interface Link . |
| 227 | * \param[in] pHalReleaseCB Upper layer release callback function |
| 228 | * pointer . |
| 229 | * \param[in] psContext psContext is the context of |
| 230 | * the Upper Layer. |
| 231 | * |
| 232 | * \retval NFCSTATUS_PENDING Releasing of HCI Resources are in Progress. |
| 233 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 234 | * could not be interpreted properly. |
| 235 | * \retval Other errors Errors related to the other layers |
| 236 | * |
| 237 | */ |
| 238 | |
| 239 | extern |
| 240 | NFCSTATUS |
| 241 | phHciNfc_Release ( |
| 242 | void *psHciHandle, |
| 243 | void *pHwRef, |
| 244 | pphNfcIF_Notification_CB_t pHalReleaseCB, |
| 245 | void *psContext |
| 246 | ); |
| 247 | |
| 248 | |
| 249 | extern |
| 250 | NFCSTATUS |
| 251 | phHciNfc_Config_Discovery ( |
| 252 | void *psHciHandle, |
| 253 | void *pHwRef, |
| 254 | phHal_sADD_Cfg_t *pPollConfig |
| 255 | ); |
| 256 | |
| 257 | |
| 258 | /** |
| 259 | * \ingroup grp_hci_nfc |
| 260 | * |
| 261 | * The phHciNfc_Restart_Discovery function restarts the Polling Wheel. |
| 262 | * |
| 263 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 264 | * of the HCI Layer. |
| 265 | * \param[in] pHwRef pHwRef is the Information of |
| 266 | * the Device Interface Link . |
Rob von Behren | 6dd9483 | 2011-09-16 15:05:25 -0700 | [diff] [blame] | 267 | * \param[in] discovery_type If True: Start re-polling of the target |
Nick Pelly | 5d9927b | 2010-09-23 12:47:58 -0700 | [diff] [blame] | 268 | * after the Target Device is de-activated |
| 269 | * or else - continue discovery with next |
| 270 | * technology. |
| 271 | * \retval NFCSTATUS_PENDING The Discovery Wheel retarted. |
| 272 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 273 | * could not be interpreted properly. |
| 274 | * \retval Other errors Errors related to the other layers |
| 275 | * |
| 276 | */ |
| 277 | |
| 278 | extern |
| 279 | NFCSTATUS |
| 280 | phHciNfc_Restart_Discovery ( |
| 281 | void *psHciHandle, |
| 282 | void *pHwRef, |
Rob von Behren | 6dd9483 | 2011-09-16 15:05:25 -0700 | [diff] [blame] | 283 | uint8_t discovery_type |
Nick Pelly | 5d9927b | 2010-09-23 12:47:58 -0700 | [diff] [blame] | 284 | ); |
| 285 | |
| 286 | |
| 287 | /** |
| 288 | * \ingroup grp_hci_nfc |
| 289 | * |
| 290 | * The phHciNfc_Start_Discovery function Starts the Polling Wheel. |
| 291 | * |
| 292 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 293 | * of the HCI Layer. |
| 294 | * \param[in] pHwRef pHwRef is the Information of |
| 295 | * the Device Interface Link . |
| 296 | * \retval NFCSTATUS_PENDING The Discovery Wheel Started. |
| 297 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 298 | * could not be interpreted properly. |
| 299 | * \retval Other errors Errors related to the other layers |
| 300 | * |
| 301 | */ |
| 302 | |
| 303 | extern |
| 304 | NFCSTATUS |
| 305 | phHciNfc_Start_Discovery ( |
| 306 | void *psHciHandle, |
| 307 | void *pHwRef |
| 308 | ); |
| 309 | |
| 310 | |
| 311 | /** |
| 312 | * \ingroup grp_hci_nfc |
| 313 | * |
| 314 | * The phHciNfc_Stop_Discovery function Stops the Polling Wheel. |
| 315 | * |
| 316 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 317 | * of the HCI Layer. |
| 318 | * \param[in] pHwRef pHwRef is the Information of |
| 319 | * the Device Interface Link . |
| 320 | * \retval NFCSTATUS_PENDING The Discovery Wheel Stopped. |
| 321 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 322 | * could not be interpreted properly. |
| 323 | * \retval Other errors Errors related to the other layers |
| 324 | * |
| 325 | */ |
| 326 | |
| 327 | extern |
| 328 | NFCSTATUS |
| 329 | phHciNfc_Stop_Discovery ( |
| 330 | void *psHciHandle, |
| 331 | void *pHwRef |
| 332 | ); |
| 333 | |
| 334 | |
| 335 | /** |
| 336 | * \ingroup grp_hci_nfc |
| 337 | * |
| 338 | * The phHciNfc_Configure function Configures Configures the Polling Wheel to |
| 339 | * select the kind of Tags to be polled. This also allows to enable/disable |
| 340 | * the Tag Emulation. This also configures the Secure elements the UICC, WI and |
| 341 | * Target to Emulate the Tag or Target. |
| 342 | * |
| 343 | * |
| 344 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 345 | * of the HCI Layer. |
| 346 | * \param[in] pHwRef pHwRef is the Information of |
| 347 | * the Device Interface Link . |
| 348 | * \param[in] config_type config_type specifies the type of the |
| 349 | * Parameter configuration. |
| 350 | * \param[in] pConfig pConfig is the Information for |
| 351 | * Configuring the Device. |
| 352 | * \retval NFCSTATUS_PENDING The Emulation configuration pending. |
| 353 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 354 | * could not be interpreted properly. |
| 355 | * \retval Other errors Errors related to the other layers |
| 356 | * |
| 357 | */ |
| 358 | |
| 359 | extern |
| 360 | NFCSTATUS |
| 361 | phHciNfc_Configure ( |
| 362 | void *psHciHandle, |
| 363 | void *pHwRef, |
| 364 | phHal_eConfigType_t config_type, |
| 365 | phHal_uConfig_t *pConfig |
| 366 | ); |
| 367 | |
| 368 | /** |
| 369 | * \ingroup grp_hci_nfc |
| 370 | * |
| 371 | * The phHciNfc_Switch_SmxMode function Switches the WI(S2C) interface |
| 372 | * from Wired/Virtual to vice versa. |
| 373 | * |
| 374 | * |
| 375 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 376 | * of the HCI Layer. |
| 377 | * \param[in] pHwRef pHwRef is the Information of |
| 378 | * the Device Interface Link . |
| 379 | * \param[in] smx_mode smx_mode specifies the type of the switch |
| 380 | * configuration. |
| 381 | * \param[in] pPollConfig pPollConfig is the Information for |
| 382 | * polling the SmartMX Device. |
| 383 | * \retval NFCSTATUS_PENDING The SmartMX Mode Switch pending. |
| 384 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 385 | * could not be interpreted properly. |
| 386 | * \retval Other errors Errors related to the other layers |
| 387 | * |
| 388 | */ |
| 389 | |
| 390 | NFCSTATUS |
| 391 | phHciNfc_Switch_SmxMode ( |
| 392 | void *psHciHandle, |
| 393 | void *pHwRef, |
| 394 | phHal_eSmartMX_Mode_t smx_mode, |
| 395 | phHal_sADD_Cfg_t *pPollConfig |
| 396 | ); |
| 397 | |
| 398 | |
| 399 | /** |
| 400 | * \ingroup grp_hci_nfc |
| 401 | * |
| 402 | * The phHciNfc_Switch_SwpMode function Switches the SWP Link |
| 403 | * from On/Off to vice versa. |
| 404 | * |
| 405 | * |
| 406 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 407 | * of the HCI Layer. |
| 408 | * \param[in] pHwRef pHwRef is the Information of |
| 409 | * the Device Interface Link . |
| 410 | * \param[in] swp_mode swp_mode specifies to switch on/off the |
| 411 | * SWP Link. |
| 412 | * \retval NFCSTATUS_PENDING The SWP Mode Switch pending. |
| 413 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 414 | * could not be interpreted properly. |
| 415 | * \retval Other errors Errors related to the other layers |
| 416 | * |
| 417 | */ |
| 418 | |
| 419 | NFCSTATUS |
| 420 | phHciNfc_Switch_SwpMode ( |
| 421 | void *psHciHandle, |
| 422 | void *pHwRef, |
| 423 | phHal_eSWP_Mode_t swp_mode /* , |
| 424 | void *pSwpCfg */ |
| 425 | ); |
| 426 | |
| 427 | |
| 428 | |
| 429 | /** |
| 430 | * \ingroup grp_hci_nfc |
| 431 | * |
| 432 | * The phHciNfc_Connect function selects the discovered target to |
| 433 | * perform the transactions on it. |
| 434 | * |
| 435 | * |
| 436 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 437 | * of the HCI Layer. |
| 438 | * \param[in] pHwRef pHwRef is the Information of |
| 439 | * the Device Interface Link . |
| 440 | * \param[in] p_remote_dev_info p_remote_dev_info is the information |
| 441 | * of the Target Device to be connected . |
| 442 | * \retval NFCSTATUS_PENDING To select the remote target pending. |
| 443 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 444 | * could not be interpreted properly. |
| 445 | * \retval Other errors Errors related to the other layers |
| 446 | * |
| 447 | */ |
| 448 | |
| 449 | extern |
| 450 | NFCSTATUS |
| 451 | phHciNfc_Connect ( |
| 452 | void *psHciHandle, |
| 453 | void *pHwRef, |
| 454 | phHal_sRemoteDevInformation_t *p_remote_dev_info |
| 455 | ); |
| 456 | |
| 457 | |
| 458 | /** |
| 459 | * \ingroup grp_hci_nfc |
| 460 | * |
| 461 | * The phHciNfc_Reactiavte function reactivates the discovered target to |
| 462 | * and selects that target perform the transactions on it. |
| 463 | * |
| 464 | * |
| 465 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 466 | * of the HCI Layer. |
| 467 | * \param[in] pHwRef pHwRef is the Information of |
| 468 | * the Device Interface Link . |
| 469 | * \param[in] p_remote_dev_info p_remote_dev_info is the information |
| 470 | * of the Target Device to be reactivated . |
| 471 | * \retval NFCSTATUS_PENDING To reactivate the remote target pending. |
| 472 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 473 | * could not be interpreted properly. |
| 474 | * \retval Other errors Errors related to the other layers |
| 475 | * |
| 476 | */ |
| 477 | |
| 478 | |
| 479 | extern |
| 480 | NFCSTATUS |
| 481 | phHciNfc_Reactivate ( |
| 482 | void *psHciHandle, |
| 483 | void *pHwRef, |
| 484 | phHal_sRemoteDevInformation_t *p_target_info |
| 485 | ); |
| 486 | |
| 487 | |
| 488 | /** |
| 489 | * \ingroup grp_hci_nfc |
| 490 | * |
| 491 | * The phHciNfc_Disconnect function de-selects the selected target and |
| 492 | * any ongoing transactions . |
| 493 | * |
| 494 | * |
| 495 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 496 | * of the HCI Layer. |
| 497 | * \param[in] pHwRef pHwRef is the Information of |
| 498 | * the Device Interface Link . |
Rob von Behren | 6dd9483 | 2011-09-16 15:05:25 -0700 | [diff] [blame] | 499 | * \param[in] discovery_type If NFC_RF_DISCOVERY_REPOLL: Start re-polling of |
| 500 | * the target after the Target Device is |
| 501 | * de-activatedor if NFC_RF_DISCOVERY_CONTINUE - |
| 502 | * continue discovery with next technology or |
| 503 | * stop the discovery wheel. |
Nick Pelly | 5d9927b | 2010-09-23 12:47:58 -0700 | [diff] [blame] | 504 | * |
| 505 | * \retval NFCSTATUS_PENDING To De-select the remote target pending. |
| 506 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 507 | * could not be interpreted properly. |
| 508 | * \retval Other errors Errors related to the other layers |
| 509 | * |
| 510 | */ |
| 511 | |
| 512 | extern |
| 513 | NFCSTATUS |
| 514 | phHciNfc_Disconnect ( |
| 515 | void *psHciHandle, |
| 516 | void *pHwRef, |
Rob von Behren | 6dd9483 | 2011-09-16 15:05:25 -0700 | [diff] [blame] | 517 | uint8_t discovery_type |
Nick Pelly | 5d9927b | 2010-09-23 12:47:58 -0700 | [diff] [blame] | 518 | ); |
| 519 | |
| 520 | |
| 521 | /** |
| 522 | * \ingroup grp_hci_nfc |
| 523 | * |
| 524 | * The phHciNfc_Presence_Check function checks for the presence of the target |
| 525 | * selected in the vicinity of the Reader's RF Field . |
| 526 | * |
| 527 | * |
| 528 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 529 | * of the HCI Layer. |
| 530 | * \param[in] pHwRef pHwRef is the Information of |
| 531 | * the Device Interface Link . |
| 532 | * \retval NFCSTATUS_PENDING Presence Check of the remote target |
| 533 | * pending. |
| 534 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 535 | * could not be interpreted properly. |
| 536 | * \retval Other errors Errors related to the other layers |
| 537 | * |
| 538 | */ |
| 539 | |
| 540 | extern |
| 541 | NFCSTATUS |
| 542 | phHciNfc_Presence_Check ( |
| 543 | void *psHciHandle, |
| 544 | void *pHwRef |
| 545 | ); |
| 546 | |
| 547 | |
| 548 | /** |
| 549 | * \ingroup grp_hci_nfc |
| 550 | * |
| 551 | * The phHciNfc_Select_Next_Target function selects and activates the |
| 552 | * next target present in the the Reader's RF Field . |
| 553 | * |
| 554 | * |
| 555 | * \param[in] psHciHandle psHciHandle is the handle or the |
| 556 | * context of the HCI Layer. |
| 557 | * \param[in] pHwRef pHwRef is the Information of |
| 558 | * the Device Interface Link . |
| 559 | * \retval NFCSTATUS_PENDING selection and activation of the next |
| 560 | * remote target pending. |
| 561 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 562 | * could not be interpreted properly. |
| 563 | * \retval Other errors Errors related to the other layers |
| 564 | * |
| 565 | */ |
| 566 | |
| 567 | extern |
| 568 | NFCSTATUS |
| 569 | phHciNfc_Select_Next_Target ( |
| 570 | void *psHciHandle, |
| 571 | void *pHwRef |
| 572 | ); |
| 573 | |
| 574 | |
| 575 | /** |
| 576 | * \ingroup grp_hci_nfc |
| 577 | * |
| 578 | * The phHciNfc_Exchange_Data function exchanges the data |
| 579 | * to/from the selected remote target device. |
| 580 | * |
| 581 | * |
| 582 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 583 | * of the HCI Layer. |
| 584 | * \param[in] pHwRef pHwRef is the Information of |
| 585 | * the Device Interface Link . |
| 586 | * \param[in] p_remote_dev_info p_remote_dev_info is the information of the |
| 587 | * selected target to which data |
| 588 | * should be sent. |
| 589 | * \param[in] p_xchg_info The exchange info contains the command type, |
| 590 | * addr and data to be sent to the connected |
| 591 | * remote target device. |
| 592 | * \retval NFCSTATUS_PENDING Data to remote target pending. |
| 593 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 594 | * could not be interpreted properly. |
| 595 | * \retval Other errors Errors related to the other layers |
| 596 | * |
| 597 | */ |
| 598 | |
| 599 | extern |
| 600 | NFCSTATUS |
| 601 | phHciNfc_Exchange_Data ( |
| 602 | void *psHciHandle, |
| 603 | void *pHwRef, |
| 604 | phHal_sRemoteDevInformation_t *p_remote_dev_info, |
| 605 | phHciNfc_XchgInfo_t *p_xchg_info |
| 606 | ); |
| 607 | |
| 608 | /** |
| 609 | * \ingroup grp_hci_nfc |
| 610 | * |
| 611 | * The phHciNfc_Send_Data function Sends the data provided |
| 612 | * to the appropriate remote target device. |
| 613 | * |
| 614 | * |
| 615 | * \param[in] psHciHandle psHciHandle is the handle or the context |
| 616 | * of the HCI Layer. |
| 617 | * \param[in] pHwRef pHwRef is the Information of |
| 618 | * the Device Interface Link . |
| 619 | * \param[in] p_remote_dev_info p_remote_dev_info is the information |
| 620 | * of the selected target to which data |
| 621 | * should be sent. |
| 622 | * \param[in] p_send_param The send param contains the |
| 623 | * data to be sent to the |
| 624 | * remote device. |
| 625 | * \retval NFCSTATUS_PENDING Data to remote device pending. |
| 626 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 627 | * could not be interpreted properly. |
| 628 | * \retval Other errors Errors related to the other layers |
| 629 | * |
| 630 | */ |
| 631 | |
| 632 | extern |
| 633 | NFCSTATUS |
| 634 | phHciNfc_Send_Data ( |
| 635 | void *psHciHandle, |
| 636 | void *pHwRef, |
| 637 | phHal_sRemoteDevInformation_t *p_remote_dev_info, |
| 638 | phHciNfc_XchgInfo_t *p_send_param |
| 639 | ); |
| 640 | |
| 641 | /** |
| 642 | * \ingroup grp_hci_nfc |
| 643 | * |
| 644 | * The phHciNfc_System_Test function performs the System Management Tests |
| 645 | * provided by the NFC Peripheral device. |
| 646 | * |
| 647 | * \param[in] psContext psContext is the pointer to HCI Layer |
| 648 | * context Structure. |
| 649 | * \param[in] pHwRef pHwRef is the Information of |
| 650 | * the Device Interface Link . |
| 651 | * \param[in] test_type test_type is the type of the Self Test |
| 652 | * that needs to be performed on the device. |
| 653 | * \param[in] test_param test_param is the parameter for the Self Test |
| 654 | * that needs to be performed on the device. |
| 655 | * |
| 656 | * |
| 657 | * \retval NFCSTATUS_PENDING System Test on the System Management |
| 658 | * is pending. |
| 659 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 660 | * could not be interpreted properly. |
| 661 | * \retval Other errors Errors related to the other layers |
| 662 | * |
| 663 | */ |
| 664 | |
| 665 | extern |
| 666 | NFCSTATUS |
| 667 | phHciNfc_System_Test( |
| 668 | void *psContext, |
| 669 | void *pHwRef, |
| 670 | uint32_t test_type, |
| 671 | phNfc_sData_t *test_param |
| 672 | ); |
| 673 | |
| 674 | /** |
| 675 | * \ingroup grp_hci_nfc |
| 676 | * |
| 677 | * The phHciNfc_System_Configure function performs the System Management |
| 678 | * Configuration with the value provided. |
| 679 | * |
| 680 | * \param[in] psContext psContext is the pointer to HCI Layer |
| 681 | * context Structure. |
| 682 | * \param[in] pHwRef pHwRef is the Information of |
| 683 | * the Device Interface Link . |
| 684 | * \param[in] config_type config_type is the type of the configuration |
| 685 | * that needs to be performed on the device. |
| 686 | * \param[in] config_value config_value is the value for the configuring |
| 687 | * that needs to be performed on the device. |
| 688 | * |
| 689 | * |
| 690 | * \retval NFCSTATUS_PENDING Configuration of the provided information to |
| 691 | * the is pending. |
| 692 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 693 | * could not be interpreted properly. |
| 694 | * \retval Other errors Errors related to the other layers |
| 695 | * |
| 696 | */ |
| 697 | extern |
| 698 | NFCSTATUS |
| 699 | phHciNfc_System_Configure ( |
| 700 | void *psHciHandle, |
| 701 | void *pHwRef, |
| 702 | uint32_t config_type, |
| 703 | uint8_t config_value |
| 704 | ); |
| 705 | |
| 706 | /** |
| 707 | * \ingroup grp_hci_nfc |
| 708 | * |
| 709 | * The phHciNfc_System_Get_Info function obtains the System Management |
| 710 | * information from the address provided. |
| 711 | * |
| 712 | * \param[in] psContext psContext is the pointer to HCI Layer |
| 713 | * context Structure. |
| 714 | * \param[in] pHwRef pHwRef is the Information of |
| 715 | * the Device Interface Link . |
| 716 | * \param[in] info_type info_type is the type of the Information |
| 717 | * that needs to be obtained from the device. |
| 718 | * \param[in,out] p_val p_val is the pointer to which the |
| 719 | * information need to be updated. |
| 720 | * |
| 721 | * |
| 722 | * \retval NFCSTATUS_PENDING Get information from the NFC Device |
| 723 | * is pending. |
| 724 | * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters |
| 725 | * could not be interpreted properly. |
| 726 | * \retval Other errors Errors related to the other layers |
| 727 | * |
| 728 | */ |
| 729 | extern |
| 730 | NFCSTATUS |
| 731 | phHciNfc_System_Get_Info( |
| 732 | void *psHciHandle, |
| 733 | void *pHwRef, |
| 734 | uint32_t info_type, |
| 735 | uint8_t *p_val |
| 736 | ); |
| 737 | |
| 738 | extern |
| 739 | NFCSTATUS |
| 740 | phHciNfc_PRBS_Test ( |
| 741 | void *psHciHandle, |
| 742 | void *pHwRef, |
| 743 | uint32_t test_type, |
| 744 | phNfc_sData_t *test_param |
| 745 | ); |
| 746 | |
| 747 | #if 0 |
| 748 | extern |
| 749 | NFCSTATUS |
| 750 | phHciNfc_Receive_Data ( |
| 751 | void *psHciHandle, |
| 752 | void *pHwRef, |
| 753 | uint8_t *p_data, |
| 754 | uint8_t length |
| 755 | ); |
| 756 | |
| 757 | #endif |
| 758 | |
| 759 | |
| 760 | #endif |
| 761 | |