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 
17 #include <stdlib.h>
18 #include "../includes/common.h"
19 #include <nfc_api.h>
20 #include <rw_int.h>
21 
22 extern tRW_CB rw_cb;
23 void rw_init(void);
24 void rw_t2t_handle_rsp(uint8_t* p_data);
poc_cback(tRW_EVENT event,tRW_DATA * p_rw_data)25 void poc_cback(tRW_EVENT event, tRW_DATA* p_rw_data) {
26     (void)event;
27     (void)p_rw_data;
28 }
29 
main()30 int main() {
31     tRW_T2T_CB* p_t2t = &rw_cb.tcb.t2t;
32     rw_init();
33     rw_cb.p_cback = &poc_cback;
34     p_t2t->state = RW_T2T_STATE_DETECT_TLV;
35     p_t2t->tlv_detect = TAG_LOCK_CTRL_TLV;
36     p_t2t->substate = RW_T2T_SUBSTATE_WAIT_READ_TLV_VALUE;
37     p_t2t->found_tlv = TAG_LOCK_CTRL_TLV;
38     p_t2t->bytes_count = 1;
39     p_t2t->num_lockbytes = RW_T2T_MAX_LOCK_BYTES;
40     uint8_t data[T2T_READ_DATA_LEN];
41     rw_t2t_handle_rsp(data);
42     return EXIT_SUCCESS;
43 }
44