RDK Documentation (Open Sourced RDK Components)
iarm_bus.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 
21 
22 /**
23 * @defgroup iarmmgrs
24 * @{
25 * @defgroup vrexmgr
26 * @{
27 **/
28 
29 
30 #include "libIBus.h"
31 #include <unistd.h>
32 
33 
34 /*----------------------------------------------------------------------------*/
35 /* Macros */
36 /*----------------------------------------------------------------------------*/
37 /* none */
38 
39 /*----------------------------------------------------------------------------*/
40 /* Data Structures */
41 /*----------------------------------------------------------------------------*/
42 /* none */
43 
44 /*----------------------------------------------------------------------------*/
45 /* File Scoped Variables */
46 /*----------------------------------------------------------------------------*/
47 static int count;
48 
49 /*----------------------------------------------------------------------------*/
50 /* Function Prototypes */
51 /*----------------------------------------------------------------------------*/
52 /* none */
53 
54 /*----------------------------------------------------------------------------*/
55 /* External Functions */
56 /*----------------------------------------------------------------------------*/
57 IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
58 {
59 // sleep(10);
60  count++;
61 
62  if (15 < count) {
63  count = 0;
64  }
65 
66  if (5 > count) {
67  return IARM_RESULT_SUCCESS;
68  }
69 
70  return IARM_RESULT_INVALID_STATE;
71 }
72 
73 /*----------------------------------------------------------------------------*/
74 /* Internal functions */
75 /*----------------------------------------------------------------------------*/
76 /* none */
77 
78 
79 /** @} */
80 /** @} */
libIBus.h
RDK IARM-Bus API Declarations.
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarm_bus.c:57