RDK Documentation (Open Sourced RDK Components)
librmh_api_wrap_soc_and_generic.c
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 #include "librmh.h"
21 #include "rdk_moca_hal.h"
22 
23 RMH_Result GENERIC_IMPL__RMH_Destroy(const RMH_Handle handle) {
24  if (handle->soclib) {
25  dlclose(handle->soclib);
26  }
27  if (handle->printBuf) {
28  free(handle->printBuf);
29  }
30  if (handle) {
31  free(handle);
32  }
33  return RMH_SUCCESS;
34 }
35 
36 RMH_Result GENERIC_IMPL__RMH_Log_SetAPILevel(const RMH_Handle handle, const RMH_LogLevel value){
37  handle->logLevelBitMask=value;
38  return RMH_SUCCESS;
39 }
40 
41 RMH_Result GENERIC_IMPL__RMH_Log_GetAPILevel(const RMH_Handle handle, RMH_LogLevel* response) {
42  *response=handle->logLevelBitMask;
43  return RMH_SUCCESS;
44 }
45 
46 RMH_Result GENERIC_IMPL__RMH_SetEventCallbacks(const RMH_Handle handle, const uint32_t value) {
47  handle->eventNotifyBitMask=value;
48  return RMH_SUCCESS;
49 }
50 
51 RMH_Result GENERIC_IMPL__RMH_GetEventCallbacks(const RMH_Handle handle, uint32_t* response) {
52  *response=handle->eventNotifyBitMask;
53  return RMH_SUCCESS;
54 }
RMH
Definition: librmh.h:57