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 <string.h>
19 #include "llcp_int.h"
20 
21 #define SIZE 16
22 #define LENGTH 1
23 
24 extern tLLCP_CB llcp_cb;
25 void llcp_init(void);
26 
main()27 int main() {
28   GKI_init();
29   llcp_init();
30   uint8_t *p_i_pdu = (uint8_t *)malloc(SIZE);
31   if (!p_i_pdu) {
32     return EXIT_FAILURE;
33   }
34 
35   llcp_cb.dlcb[0].state = LLCP_DLC_STATE_CONNECTED;
36   llcp_dlc_proc_i_pdu(llcp_cb.dlcb[0].local_sap, llcp_cb.dlcb[0].remote_sap, LENGTH,
37                       &p_i_pdu[SIZE - LENGTH], nullptr);
38 
39   free(p_i_pdu);
40   return EXIT_SUCCESS;
41 }
42