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 "../includes/common.h"
18 #include "../includes/memutils.h"
19 #include <nfc_int.h>
20 
21 #define LENGTH 16
22 
23 char enable_selective_overload = ENABLE_NONE;
24 extern tNFC_CB nfc_cb;
25 
resp_cback(tNFC_RESPONSE_EVT event,tNFC_RESPONSE * p_data)26 static void resp_cback(tNFC_RESPONSE_EVT event, tNFC_RESPONSE *p_data) {
27   (void) event;
28   (void) p_data;
29 }
30 
main()31 int main() {
32   nfc_cb.p_resp_cback = resp_cback;
33 
34   enable_selective_overload = ENABLE_ALL;
35   uint8_t *p_msg = (uint8_t *)malloc(LENGTH);
36   if (!p_msg) {
37     return EXIT_FAILURE;
38   }
39 
40   // Set evt_data.set_config.status
41   *p_msg = 0x03;
42   // Set evt_data.set_config.num_param_id
43   *(p_msg + 1) = 255;
44   nfc_ncif_set_config_status(p_msg, LENGTH);
45 
46   free(p_msg);
47   enable_selective_overload = ENABLE_NONE;
48   return EXIT_SUCCESS;
49 }
50