le_port_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_port_common.h
12  *
13  * Type definitions for le_port.
14  *
15  */
16 #ifndef LE_PORT_COMMON_H_INCLUDE_GUARD
17 #define LE_PORT_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_atServer_common.h"
24 
25 #define IFGEN_LE_PORT_PROTOCOL_ID "174d86a86f18018f0c181f7870cde2e6"
26 #define IFGEN_LE_PORT_MSG_SIZE 62
27 /** @addtogroup le_port
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Maximum length of the device name.
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define LE_PORT_MAX_LEN_DEVICE_NAME 50
37 
38 //--------------------------------------------------------------------------------------------------
39 /**
40  * Reference type for referring to the device.
41  */
42 //--------------------------------------------------------------------------------------------------
43 typedef struct le_port_Device* le_port_DeviceRef_t;
44 
45 
46 
47 //--------------------------------------------------------------------------------------------------
48 /**
49  * Get if this client bound locally.
50  */
51 //--------------------------------------------------------------------------------------------------
52 LE_SHARED bool ifgen_le_port_HasLocalBinding
53 (
54  void
55 );
56 
57 
58 //--------------------------------------------------------------------------------------------------
59 /**
60  * Init data that is common across all threads
61  */
62 //--------------------------------------------------------------------------------------------------
63 LE_SHARED void ifgen_le_port_InitCommonData
64 (
65  void
66 );
67 
68 
69 //--------------------------------------------------------------------------------------------------
70 /**
71  * Perform common initialization and open a session
72  */
73 //--------------------------------------------------------------------------------------------------
74 LE_SHARED le_result_t ifgen_le_port_OpenSession
75 (
76  le_msg_SessionRef_t _ifgen_sessionRef,
77  bool isBlocking
78 );
79 
80 //--------------------------------------------------------------------------------------------------
81 /**
82  * This function requests to open a configured device. If the device was not opened, it opens
83  * the device.
84  *
85  * @return
86  * - Reference to the device.
87  * - NULL if the device is not available.
88  */
89 //--------------------------------------------------------------------------------------------------
90 LE_SHARED le_port_DeviceRef_t ifgen_le_port_Request
91 (
92  le_msg_SessionRef_t _ifgen_sessionRef,
93  const char* LE_NONNULL deviceName
94  ///< [IN] Device name to be requested.
95 );
96 
97 //--------------------------------------------------------------------------------------------------
98 /**
99  * This function switches the device into data mode.
100  *
101  * @return
102  * - LE_OK Function succeeded.
103  * - LE_FAULT Function failed.
104  * - LE_BAD_PARAMETER Invalid parameter.
105  * - LE_UNAVAILABLE JSON parsing is not completed.
106  * - LE_DUPLICATE Device already opened in data mode.
107  */
108 //--------------------------------------------------------------------------------------------------
109 LE_SHARED le_result_t ifgen_le_port_SetDataMode
110 (
111  le_msg_SessionRef_t _ifgen_sessionRef,
112  le_port_DeviceRef_t devRef,
113  ///< [IN] Device reference.
114  int* fdPtr
115  ///< [OUT] File descriptor of the device.
116 );
117 
118 //--------------------------------------------------------------------------------------------------
119 /**
120  * This function switches the device into AT command mode and returns AT server device reference.
121  *
122  * @return
123  * - LE_OK Function succeeded.
124  * - LE_FAULT Function failed.
125  * - LE_BAD_PARAMETER Invalid parameter.
126  */
127 //--------------------------------------------------------------------------------------------------
128 LE_SHARED le_result_t ifgen_le_port_SetCommandMode
129 (
130  le_msg_SessionRef_t _ifgen_sessionRef,
131  le_port_DeviceRef_t devRef,
132  ///< [IN] Device reference.
133  le_atServer_DeviceRef_t* atServerDevRefPtr
134  ///< [OUT] AT server device reference.
135 );
136 
137 //--------------------------------------------------------------------------------------------------
138 /**
139  * This function closes the device and releases the resources.
140  *
141  * @return
142  * - LE_OK Function succeeded.
143  * - LE_FAULT Function failed.
144  * - LE_BAD_PARAMETER Invalid parameter.
145  * - LE_UNAVAILABLE JSON parsing is not completed.
146  */
147 //--------------------------------------------------------------------------------------------------
148 LE_SHARED le_result_t ifgen_le_port_Release
149 (
150  le_msg_SessionRef_t _ifgen_sessionRef,
151  le_port_DeviceRef_t devRef
152  ///< [IN] Device reference.
153 );
154 
155 //--------------------------------------------------------------------------------------------------
156 /**
157  * This function gets the device reference regarding to a given reference coming from the AT server.
158  *
159  * @return
160  * - LE_OK Function succeeded.
161  * - LE_FAULT Function failed.
162  * - LE_BAD_PARAMETER Invalid parameter.
163  */
164 //--------------------------------------------------------------------------------------------------
165 LE_SHARED le_result_t ifgen_le_port_GetPortReference
166 (
167  le_msg_SessionRef_t _ifgen_sessionRef,
168  le_atServer_DeviceRef_t atServerDevRef,
169  ///< [IN] Device reference from AT server.
170  le_port_DeviceRef_t* devRefPtr
171  ///< [OUT] Device reference from port service.
172 );
173 /** @} **/
174 #endif // LE_PORT_COMMON_H_INCLUDE_GUARD
struct le_port_Device * le_port_DeviceRef_t
Definition: le_port_common.h:43
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
struct le_atServer_Device * le_atServer_DeviceRef_t
Definition: le_atServer_common.h:65
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860