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_api.h> 20 21 #define DEFAULT_VALUE 0x02 22 #define SIZE 16 23 #define LENGTH 1 24 25 extern bool llcp_util_parse_link_params(uint16_t length, uint8_t* p_bytes); 26 main()27int main() { 28 const int32_t offset = SIZE - LENGTH; 29 uint8_t* p_bytes = (uint8_t *)malloc(SIZE); 30 if (!p_bytes) { 31 return EXIT_FAILURE; 32 } 33 memset(p_bytes, DEFAULT_VALUE, SIZE); 34 35 llcp_util_parse_link_params(LENGTH, &p_bytes[offset]); 36 37 free(p_bytes); 38 return EXIT_SUCCESS; 39 } 40