nfa_nv_co.h revision 45faad0ff5deeb0c676356345d99398cc4ab695a
1/***************************************************************************** 2** 3** Name: bta_fs_co.h 4** 5** Description: This is the interface file for the synchronization 6** server call-out functions. 7** 8** Copyright (c) 2003-2009, Broadcom Corp., All Rights Reserved. 9** Broadcom Bluetooth Core. Proprietary and confidential. 10** 11*****************************************************************************/ 12#ifndef NFA_NV_CO_H 13#define NFA_NV_CO_H 14 15#include <time.h> 16 17#include "nfa_api.h" 18 19/***************************************************************************** 20** Constants and Data Types 21*****************************************************************************/ 22 23 24/************************** 25** Common Definitions 26***************************/ 27 28/* Status codes returned by call-out functions, or in call-in functions as status */ 29#define NFA_NV_CO_OK 0x00 30#define NFA_NV_CO_FAIL 0x01 /* Used to pass all other errors */ 31#define NFA_NV_CO_EACCES 0x02 32#define NFA_NV_CO_ENOTEMPTY 0x03 33#define NFA_NV_CO_EOF 0x04 34#define NFA_NV_CO_EODIR 0x05 35#define NFA_NV_CO_ENOSPACE 0x06 /* Returned in nfa_nv_ci_open if no room */ 36#define NFA_NV_CO_EIS_DIR 0x07 37#define NFA_NV_CO_RESUME 0x08 /* used in nfa_nv_ci_open, on resume */ 38#define NFA_NV_CO_NONE 0x09 /* used in nfa_nv_ci_open, on resume (no file to resume) */ 39 40typedef UINT8 tNFA_NV_CO_STATUS; 41 42 43#define DH_NV_BLOCK 0x01 44#define HC_F3_NV_BLOCK 0x02 45#define HC_F4_NV_BLOCK 0x03 46#define HC_DH_NV_BLOCK 0x04 47 48/***************************************************************************** 49** Function Declarations 50*****************************************************************************/ 51/************************** 52** Common Functions 53***************************/ 54 55/******************************************************************************* 56** 57** Function nfa_nv_co_read 58** 59** Description This function is called by NFA to read in data from the 60** previously opened file. 61** 62** Parameters p_buf - buffer to read the data into. 63** nbytes - number of bytes to read into the buffer. 64** 65** Returns void 66** 67** Note: Upon completion of the request, nfa_nv_ci_read () is 68** called with the buffer of data, along with the number 69** of bytes read into the buffer, and a status. The 70** call-in function should only be called when ALL requested 71** bytes have been read, the end of file has been detected, 72** or an error has occurred. 73** 74*******************************************************************************/ 75NFC_API extern void nfa_nv_co_read (UINT8 *p_buf, UINT16 nbytes, UINT8 block); 76 77/******************************************************************************* 78** 79** Function nfa_nv_co_write 80** 81** Description This function is called by io to send file data to the 82** phone. 83** 84** Parameters p_buf - buffer to read the data from. 85** nbytes - number of bytes to write out to the file. 86** 87** Returns void 88** 89** Note: Upon completion of the request, nfa_nv_ci_write () is 90** called with the file descriptor and the status. The 91** call-in function should only be called when ALL requested 92** bytes have been written, or an error has been detected, 93** 94*******************************************************************************/ 95NFC_API extern void nfa_nv_co_write (const UINT8 *p_buf, UINT16 nbytes, UINT8 block); 96 97 98#endif /* NFA_NV_CO_H */ 99