blob: 0f32e9c5185223b0d7f01cd1c2cf3ba1cf57ecd2 [file] [log] [blame]
nxpandroidc7611652015-09-23 16:42:05 +05301/******************************************************************************
2 *
3 * Copyright (C) 2003-2014 Broadcom Corporation
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at:
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 ******************************************************************************/
18
nxpandroidc7611652015-09-23 16:42:05 +053019/******************************************************************************
20 *
21 * This is the interface file for the synchronization server call-out
22 * functions.
23 *
24 ******************************************************************************/
25#ifndef NFA_NV_CO_H
26#define NFA_NV_CO_H
27
28#include <time.h>
29
30#include "nfa_api.h"
31
32/*****************************************************************************
33** Constants and Data Types
34*****************************************************************************/
35
nxpandroidc7611652015-09-23 16:42:05 +053036/**************************
37** Common Definitions
38***************************/
39
nxpandroid8f6d0532017-07-12 18:25:30 +053040/* Status codes returned by call-out functions, or in call-in functions as
41 * status */
42#define NFA_NV_CO_OK 0x00
43#define NFA_NV_CO_FAIL 0x01 /* Used to pass all other errors */
nxpandroidc7611652015-09-23 16:42:05 +053044
nxpandroid8f6d0532017-07-12 18:25:30 +053045typedef uint8_t tNFA_NV_CO_STATUS;
nxpandroidc7611652015-09-23 16:42:05 +053046
nxpandroid8f6d0532017-07-12 18:25:30 +053047#define DH_NV_BLOCK 0x01
48#define HC_F3_NV_BLOCK 0x02
49#define HC_F4_NV_BLOCK 0x03
nxpandroid8f6d0532017-07-12 18:25:30 +053050#define HC_F5_NV_BLOCK 0x05
nxpandroidc7611652015-09-23 16:42:05 +053051
52/*****************************************************************************
53** Function Declarations
54*****************************************************************************/
55/**************************
56** Common Functions
57***************************/
58
59/*******************************************************************************
60**
61** Function nfa_nv_co_read
62**
63** Description This function is called by NFA to read in data from the
64** previously opened file.
65**
66** Parameters p_buf - buffer to read the data into.
67** nbytes - number of bytes to read into the buffer.
68**
69** Returns void
70**
71** Note: Upon completion of the request, nfa_nv_ci_read () is
72** called with the buffer of data, along with the number
73** of bytes read into the buffer, and a status. The
nxpandroid8f6d0532017-07-12 18:25:30 +053074** call-in function should only be called when ALL
75** requested bytes have been read, the end of file has
76** been detected, or an error has occurred.
nxpandroidc7611652015-09-23 16:42:05 +053077**
78*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +053079extern void nfa_nv_co_read(uint8_t* p_buf, uint16_t nbytes, uint8_t block);
nxpandroidc7611652015-09-23 16:42:05 +053080
81/*******************************************************************************
82**
83** Function nfa_nv_co_write
84**
85** Description This function is called by io to send file data to the
86** phone.
87**
88** Parameters p_buf - buffer to read the data from.
89** nbytes - number of bytes to write out to the file.
90**
91** Returns void
92**
93** Note: Upon completion of the request, nfa_nv_ci_write () is
94** called with the file descriptor and the status. The
nxpandroid8f6d0532017-07-12 18:25:30 +053095** call-in function should only be called when ALL
96** requested bytes have been written, or an error has
97** been detected,
nxpandroidc7611652015-09-23 16:42:05 +053098**
99*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530100extern void nfa_nv_co_write(const uint8_t* p_buf, uint16_t nbytes,
101 uint8_t block);
nxpandroidc7611652015-09-23 16:42:05 +0530102
103#endif /* NFA_NV_CO_H */