4 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #include <hal/device/hal-board-interface.h>
21 #include <hal/hal-common-interface.h>
30 #define SERIAL_FILE_PATH "/sys/firmware/devicetree/base/serial-number"
33 static int get_device_serial(char **out)
38 fp = fopen(SERIAL_FILE_PATH, "r");
42 line = malloc(LINE_LEN);
43 p = fgets(line, LINE_LEN, fp);
54 static int board_init(void **data)
56 hal_backend_board_funcs *board_funcs;
58 board_funcs = calloc(1, sizeof(hal_backend_board_funcs));
62 board_funcs->get_device_serial = get_device_serial;
64 *data = (void *)board_funcs;
69 static int board_exit(void *data)
78 hal_backend EXPORT hal_backend_device_board_data = {
81 .abi_version = HAL_ABI_VERSION_TIZEN_6_5,