le_atServer_interface.h

Go to the documentation of this file.
1 
2 
3 /*
4  * ====================== WARNING ======================
5  *
6  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
7  * DO NOT MODIFY IN ANY WAY.
8  *
9  * ====================== WARNING ======================
10  */
11 
12 /**
13  * @page c_atServer AT Commands Server
14  *
15  * @ref le_atServer_interface.h "API Reference"
16  *
17  * The AT commands Server handles AT commands' subscriptions on a requested serial device. The
18  * server is compliant with 3GPP 27.007, paragraphs 4.0, 4.1 and 4.2, and V25 ter, paragraphs 5.3,
19  * 5.4.
20  *
21  * @section le_atServer_binding IPC interfaces binding
22  *
23  * All the functions of this API are provided by the @b atService.
24  *
25  * Here's a code sample binding to the AT commands server:
26  * @verbatim
27  bindings:
28  {
29  atServerTest.atServerTestComp.le_atServer -> atService.le_atServer
30  }
31  @endverbatim
32  *
33  * @section atServer_syntax AT command syntax
34  *
35  * @subsection atServer_Syntax Syntax rules
36  *
37  * To be interpreted, the command line sent to the AT commands server must start by the pattern
38  * "AT" (mean ATtention command).<br>
39  * Lowercase characters are changed to their uppercase equivalents. Only characters between quotes
40  * are not replaced.
41  *
42  * The supported command formats are:
43  * - Basic syntax command:
44  * - using the format AT<command>[<number>]<br>
45  * The command name is composed of one or several of those characters: A to Z, & and \\.
46  * - the syntax of S command is also supported, like:
47  * - ATS<parameter_number>?
48  * - ATS<parameter_number>=<value>
49  * - D command is supported. The characters which don't belong to the following list are
50  * ignore:
51  * - V.250 dialing digits: 0 1 2 3 4 5 6 7 8 9 * # + A B C D
52  * - V.250 modifier characters: , T P ! W @
53  * - V.250 semicolon character: ;
54  * - GSM/UMTS modifier characters:
55  * - I or i for CLIR supplementary service subscription
56  * (I=invocation, i=suppression)
57  * - G or g for CUG supplementary service subscription (G=invocation,
58  * g=suppression)
59  * - Direct dialing from phonebook: > (if follow by a string, it has to be put
60  * between quote)
61  * .
62  * @if 0 doxygen comment: The dot above ends the sub item, and must be kept @endif
63  * All characters after the "D" are considered part of The D command parameter up to a semicolon or
64  * the end of command line.
65  * <br>
66  * - Extended command format, with the following format:
67  * - action command with no parameters: AT+<name>
68  * - parameter command: AT+<name>=<value1>[,<value2>[,<value3>[...]]]<br>
69  * Values must be separated by a coma. Some values may be optional: in that case, optional
70  * value can be omitted in the AT command (e.g. AT+ABCD=,1).<br>
71  * A value is a string composed of one or several of the following characters: 0 to 9,
72  * A to F, H, z*, #, +, -. To set a value with other characters, the value has to be set
73  * between quote.
74  * - test command (determine the supported values): AT+<name>=?
75  * - read command (determine the current values, or stored values): AT+<name>?
76  *
77  * @note '+' AT command starting character shall be replaced by other symbol, not included into
78  * a to z, A to Z, & and \\.
79  *
80  * @subsection atServer_concate Concatenating commands
81  *
82  * Basic syntax command can be concatenated without a separator:<br>
83  * ATE1V1S95=47S0=0
84  *
85  * Additional commands (extended syntax command or basic syntax command) can be added after an
86  * extended syntax command with the insertion of a semicolon at the end of the command:<br>
87  * AT+CMDA=<param1>,<param2>;+CMDB?;+CMDC=?<br>
88  * AT+CMDA=<param1>,<param2>;E1V1
89  *
90  * Extended syntax command can be concatenated after basic syntax commands without a separator:<br>
91  * ATE1V1+CMD=<param1>
92  *
93  * @section atServer_binding Device Binding
94  *
95  * le_atServer_Start() must be called to bind the file descriptor of the device with the AT commands
96  * server. Note that a socket can also be bound.
97  * Multiple devices can be bound.
98  * A file descriptor can be unbound using le_atServer_Stop().
99  *
100  * The server can be suspended using le_atServer_Suspend() in order to use the
101  * opened fd for other purposes like starting a PPP service on the opened fd.
102  * For that a fd dup needs to be done before opening a server session.
103  * When needed, the server can be resumed using le_atServer_Resume(). Make sure
104  * to close the fd when the application exists or you may get too many open files error.
105  *
106  * used before opening a server session
107  * @section atServer_subscription Subscription
108  *
109  * A new AT command can be added into the parser using le_atServer_Create(), and it can be deleted
110  * using le_atServer_Delete().
111  * le_atServer_EnableEcho() allows the user to enable echo on a selected device.
112  * le_atServer_DisableEcho() allows the user to disable echo on a selected device.
113  *
114  * le_atServer_EnableExtendedErrorCodes() allows the user to use extended error
115  * codes on a selected device.
116  * le_atServer_DisableExtendedErrorCodes() allows the user to disable extended
117  * error codes on a selected device.
118  *
119  * @section atServer_handler Handler
120  *
121  * To handle the AT command, the application has to subscribe a handler using
122  * le_atServer_AddCommandHandler(). It can be removed with le_atServer_RemoveCommandHandler().<br>
123  * The called handler (le_atServer_CommandHandlerRef_t prototype) can use
124  * le_atServer_GetCommandName() to retrieve the received AT command string.<br>
125  * The device used to execute the AT command can be retrieve thanks to le_atServer_GetDevice().<br>
126  * It can also call le_atServer_GetParameter() to retrieve parameters of the AT command. This
127  * function gets the string sending through the AT command. If the parameter was sent between
128  * quotes, the quotes are removed. This API can be used for both formats:
129  * - In case of a basic format command, if exists, the parameter can be retrieved at the index 0.<br>
130  * For S command specific format (ATS<parameter_number>=<value>), the <parameter_number> is
131  * retrieved at the index 0, the <value> parameter at the index 1.
132  *
133  * - In case of an extended format command, parameters are retrieved thanks to their indexes,
134  * starting from 0. If the parameter is missed (e.g. "AT+CMD=,1"), the getting value is an empty
135  * string (i.e. '\0' with null length).
136  *
137  * The handler receives in argument the type of the AT command (of le_atServer_Type_t type).
138  * Even if these types are specific to the extended format commands according to the standards, they
139  * are also applicable here to basic format commands to detect commands with parameters, or read
140  * values (e.g. ATS<parameter_number>?).
141  *
142  * @section atServer_responses Responses
143  *
144  * @subsection intermediateRsp Intermediate response
145  *
146  * The application has can send intermediate responses through
147  * le_atServer_SendIntermediateResponse().
148  *
149  * @subsection finalRsp Final response
150  *
151  * In all cases, the application must send a final response using
152  * le_atServer_SendFinalResponse(). The corresponding device will be locked until the final response
153  * is sent.
154  *
155  * If no answer is sent, the device will not accept any new AT commands (an error will be
156  * returned).
157  *
158  * le_atServer_SendFinalResponse() has to inform of the result thanks to the argument of
159  * le_atServer_FinalRsp_t type. This argument permits to the AT command Server to:
160  * - create the result string if no custom string is provided
161  * - continue or stop the parsing of concatenated commands: if one command is failed, next commands
162  * are not executed, the final result of the concatenated AT command is the last error.
163  *
164  * @subsection unsolicitedRsp Unsolicited response
165  *
166  * The application can also send unsolicited responses to warn a host
167  * application using le_atServer_SendUnsolicitedResponse().
168  *
169  * This response is sent when no AT command is being processing on the device (i.e. unsolicited
170  * response is sent between the latest final response and the next reception of an AT command).<br>
171  * If an unsolicited response is sent when an AT command is in progress, the unsolicited response
172  * is buffered and sent as soon as the device becomes available (i.e., the processing AT command
173  * sends its final response).
174  *
175  * @section Text
176  *
177  * le_atServer_GetTextAsync() allows the user to register a le_atServer_GetTextCallback_t callback
178  * to retrieve text and sends a prompt <CR><LF><greater_than><SPACE> on the current command's
179  * device.
180  *
181  * It will receive at max LE_ATDEFS_TEXT_MAX_LEN bytes.
182  * If Esc Key is hit then the command is canceled and an empty buffer is returned with result
183  * set to LE_OK.
184  * If Ctrl+z is hit then the received buffer is returned and the result is set to LE_OK.
185  * In case of a read error, an empty buffer is returned with result set to LE_IO_ERROR;
186  *
187  * Example:
188  *
189  * AT+CMGS="+85291234567"
190  * > <ESC>
191  *
192  * OK
193  *
194  * AT+CMGS="+85291234567"
195  * > It is easy to send text messages. <CTRL-Z>
196  * +CMGS: 5
197  *
198  * OK
199  *
200  * @section atServer_bridge Bridge
201  *
202  * A second file descriptor can be used thanks to le_atServer_OpenBridge() to send
203  * all unknown AT commands to an altervative device (such as the modem). For all devices linked to
204  * that bridge using le_atServer_AddDeviceToBridge(), unknown commands will be sent through that file
205  * descriptor.
206  *
207  * @image html atCommandsParserBridge.png
208  *
209  * @note AT commands server is opened on the file descriptor fd1 using le_atServer_Open() API.
210  * AT commands server is bridged on the file descriptor fd2 using le_atServer_OpenBridge() API.
211  *
212  * A device can be remove from a bridge thanks to le_atServer_RemoveDeviceFromBridge() API.
213  * A bridge can be closed using le_atServer_CloseBridge() API.
214  *
215  * @warning Some modem AT commands may conflict with Legato APIs; using both may cause problems that
216  * can be difficult to diagnose. The modem AT commands should be avoided whenever possible, and
217  * should only be used with great care.
218  *
219  * The application can send an unsolicited on all opened device, or only one on a dedicated deivce.
220  *
221  * <HR>
222  *
223  * Copyright (C) Sierra Wireless Inc.
224  */
225 /**
226  * @file le_atServer_interface.h
227  *
228  * Legato @ref c_atServer include file.
229  *
230  * Copyright (C) Sierra Wireless Inc.
231  */
232 
233 #ifndef LE_ATSERVER_INTERFACE_H_INCLUDE_GUARD
234 #define LE_ATSERVER_INTERFACE_H_INCLUDE_GUARD
235 
236 
237 #include "legato.h"
238 
239 // Interface specific includes
240 #include "le_atDefs_interface.h"
241 
242 
243 //--------------------------------------------------------------------------------------------------
244 /**
245  * Type for handler called when a server disconnects.
246  */
247 //--------------------------------------------------------------------------------------------------
248 typedef void (*le_atServer_DisconnectHandler_t)(void *);
249 
250 //--------------------------------------------------------------------------------------------------
251 /**
252  *
253  * Connect the current client thread to the service providing this API. Block until the service is
254  * available.
255  *
256  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
257  * called before any other functions in this API. Normally, ConnectService is automatically called
258  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
259  *
260  * This function is created automatically.
261  */
262 //--------------------------------------------------------------------------------------------------
264 (
265  void
266 );
267 
268 //--------------------------------------------------------------------------------------------------
269 /**
270  *
271  * Try to connect the current client thread to the service providing this API. Return with an error
272  * if the service is not available.
273  *
274  * For each thread that wants to use this API, either ConnectService or TryConnectService must be
275  * called before any other functions in this API. Normally, ConnectService is automatically called
276  * for the main thread, but not for any other thread. For details, see @ref apiFilesC_client.
277  *
278  * This function is created automatically.
279  *
280  * @return
281  * - LE_OK if the client connected successfully to the service.
282  * - LE_UNAVAILABLE if the server is not currently offering the service to which the client is
283  * bound.
284  * - LE_NOT_PERMITTED if the client interface is not bound to any service (doesn't have a binding).
285  * - LE_COMM_ERROR if the Service Directory cannot be reached.
286  */
287 //--------------------------------------------------------------------------------------------------
289 (
290  void
291 );
292 
293 //--------------------------------------------------------------------------------------------------
294 /**
295  * Set handler called when server disconnection is detected.
296  *
297  * When a server connection is lost, call this handler then exit with LE_FATAL. If a program wants
298  * to continue without exiting, it should call longjmp() from inside the handler.
299  */
300 //--------------------------------------------------------------------------------------------------
302 (
303  le_atServer_DisconnectHandler_t disconnectHandler,
304  void *contextPtr
305 );
306 
307 //--------------------------------------------------------------------------------------------------
308 /**
309  *
310  * Disconnect the current client thread from the service providing this API.
311  *
312  * Normally, this function doesn't need to be called. After this function is called, there's no
313  * longer a connection to the service, and the functions in this API can't be used. For details, see
314  * @ref apiFilesC_client.
315  *
316  * This function is created automatically.
317  */
318 //--------------------------------------------------------------------------------------------------
320 (
321  void
322 );
323 
324 
325 //--------------------------------------------------------------------------------------------------
326 /**
327  * Reference type for an AT command.
328  */
329 //--------------------------------------------------------------------------------------------------
330 typedef struct le_atServer_Cmd* le_atServer_CmdRef_t;
331 
332 
333 //--------------------------------------------------------------------------------------------------
334 /**
335  * Reference type for a AT command device.
336  */
337 //--------------------------------------------------------------------------------------------------
338 typedef struct le_atServer_Device* le_atServer_DeviceRef_t;
339 
340 
341 //--------------------------------------------------------------------------------------------------
342 /**
343  * Reference type for a AT commands server / AT commands client bridge.
344  */
345 //--------------------------------------------------------------------------------------------------
346 typedef struct le_atServer_Bridge* le_atServer_BridgeRef_t;
347 
348 
349 //--------------------------------------------------------------------------------------------------
350 /**
351  * Received AT command type.
352  *
353  */
354 //--------------------------------------------------------------------------------------------------
355 typedef enum
356 {
358  ///< Action AT command (e.g. 'AT+CMD')
360  ///< AT command received with parameters (e.g. 'AT+CMD=x,y')
362  ///< Test AT command (e.g. 'AT+CMD=?')
364  ///< Read AT command (e.g. 'AT+CMD?')
365 }
367 
368 
369 //--------------------------------------------------------------------------------------------------
370 /**
371  * Final response.
372  */
373 //--------------------------------------------------------------------------------------------------
374 typedef enum
375 {
377  ///< AT command successfully treated, "\r\nOK\r\n" is sent if no custom
378  ///< response is set
380  ///< error in AT command treatement, "\r\nERROR\r\n" is sent if no custom
381  ///< response is set
382 }
384 
385 
386 //--------------------------------------------------------------------------------------------------
387 /**
388  * Device availability.
389  */
390 //--------------------------------------------------------------------------------------------------
391 typedef enum
392 {
394  ///< action will be done on all bound devices
396  ///< action will be done on a specified device
397 }
399 
400 
401 //--------------------------------------------------------------------------------------------------
402 /**
403  * Reference type used by Add/Remove functions for EVENT 'le_atServer_Command'
404  */
405 //--------------------------------------------------------------------------------------------------
406 typedef struct le_atServer_CommandHandler* le_atServer_CommandHandlerRef_t;
407 
408 
409 //--------------------------------------------------------------------------------------------------
410 /**
411  * Handler for the AT command processing.
412  *
413  * @note The argument "parametersNumber" is set only when "type" parameter value is
414  * LE_AT_SERVER_TYPE_PARA
415  */
416 //--------------------------------------------------------------------------------------------------
417 typedef void (*le_atServer_CommandHandlerFunc_t)
418 (
419  le_atServer_CmdRef_t commandRef,
420  ///< Received AT command reference
421  le_atServer_Type_t type,
422  ///< Received AT command type
423  uint32_t parametersNumber,
424  ///< Parameters number
425  void* contextPtr
426  ///<
427 );
428 
429 //--------------------------------------------------------------------------------------------------
430 /**
431  * Get text callback
432  *
433  * @return
434  * - LE_OK: The function succeeded
435  * - LE_IO_ERROR: An io error happened and the function couldn't read from the device
436  * - LE_FORMAT_ERROR: Received an invalid character or an invalid sequence
437  * - LE_FAULT: Failed to remove backspaces
438  */
439 //--------------------------------------------------------------------------------------------------
440 typedef void (*le_atServer_GetTextCallbackFunc_t)
441 (
442  le_atServer_CmdRef_t cmdRef,
443  ///< Received AT command reference
444  le_result_t result,
445  ///< Result
446  const char* LE_NONNULL text,
447  ///< Received text
448  uint32_t len,
449  ///< Text length
450  void* contextPtr
451  ///<
452 );
453 
454 //--------------------------------------------------------------------------------------------------
455 /**
456  * Suspend server / enter data mode
457  *
458  * When this function is called the server stops monitoring the fd for events
459  * hence no more I/O operations are done on the fd by the server.
460  *
461  * @return
462  * - LE_OK Success.
463  * - LE_BAD_PARAMETER Invalid device reference.
464  * - LE_FAULT Device not monitored
465  *
466  */
467 //--------------------------------------------------------------------------------------------------
469 (
471  ///< [IN] device to be suspended
472 );
473 
474 //--------------------------------------------------------------------------------------------------
475 /**
476  * Resume server / enter command mode
477  *
478  * When this function is called the server resumes monitoring the fd for events
479  * and is able to interpret AT commands again.
480  *
481  * @return
482  * - LE_OK Success.
483  * - LE_BAD_PARAMETER Invalid device reference.
484  * - LE_FAULT Device not monitored
485  *
486  */
487 //--------------------------------------------------------------------------------------------------
489 (
491  ///< [IN] device to be resumed
492 );
493 
494 //--------------------------------------------------------------------------------------------------
495 /**
496  * This function opens an AT server session on the requested device.
497  *
498  * @return
499  * - Reference to the requested device.
500  * - NULL if the device is not available or fd is a BAD FILE DESCRIPTOR.
501  *
502  * @note Make sure to duplicate (man dup) your file descriptor before opening
503  * a server session to be able to use the suspend/resume feature
504  *
505  */
506 //--------------------------------------------------------------------------------------------------
508 (
509  int fd
510  ///< [IN] File descriptor.
511 );
512 
513 //--------------------------------------------------------------------------------------------------
514 /**
515  * This function closes the AT server session on the requested device.
516  *
517  * @return
518  * - LE_OK The function succeeded.
519  * - LE_BAD_PARAMETER Invalid device reference.
520  * - LE_BUSY The requested device is busy.
521  * - LE_FAULT Failed to stop the server, check logs
522  * for more information.
523  */
524 //--------------------------------------------------------------------------------------------------
526 (
528  ///< [IN] device to be unbound
529 );
530 
531 //--------------------------------------------------------------------------------------------------
532 /**
533  * This function created an AT command and register it into the AT parser.
534  *
535  * @return
536  * - Reference to the AT command.
537  * - NULL if an error occurs.
538  */
539 //--------------------------------------------------------------------------------------------------
541 (
542  const char* LE_NONNULL name
543  ///< [IN] AT command name string
544 );
545 
546 //--------------------------------------------------------------------------------------------------
547 /**
548  * This function deletes an AT command (i.e. unregister from the AT parser).
549  *
550  * @return
551  * - LE_OK The function succeeded.
552  * - LE_FAULT The function failed to delete the command.
553  * - LE_BUSY Command is in progress.
554  *
555  */
556 //--------------------------------------------------------------------------------------------------
558 (
559  le_atServer_CmdRef_t commandRef
560  ///< [IN] AT command reference
561 );
562 
563 //--------------------------------------------------------------------------------------------------
564 /**
565  * Add handler function for EVENT 'le_atServer_Command'
566  *
567  * This event provides information when the AT command is detected.
568  *
569  */
570 //--------------------------------------------------------------------------------------------------
572 (
573  le_atServer_CmdRef_t commandRef,
574  ///< [IN] AT command reference
576  ///< [IN] Handler to called when the AT command is detected
577  void* contextPtr
578  ///< [IN]
579 );
580 
581 //--------------------------------------------------------------------------------------------------
582 /**
583  * Remove handler function for EVENT 'le_atServer_Command'
584  */
585 //--------------------------------------------------------------------------------------------------
587 (
589  ///< [IN]
590 );
591 
592 //--------------------------------------------------------------------------------------------------
593 /**
594  * This function can be used to get the parameters of a received AT command.
595  *
596  * @return
597  * - LE_OK The function succeeded.
598  * - LE_FAULT The function failed to get the requested parameter.
599  *
600  */
601 //--------------------------------------------------------------------------------------------------
603 (
604  le_atServer_CmdRef_t commandRef,
605  ///< [IN] AT command reference
606  uint32_t index,
607  ///< [IN] agument index
608  char* parameter,
609  ///< [OUT] parameter value
610  size_t parameterSize
611  ///< [IN]
612 );
613 
614 //--------------------------------------------------------------------------------------------------
615 /**
616  * This function can be used to get the AT command string.
617  *
618  * @return
619  * - LE_OK The function succeeded.
620  * - LE_FAULT The function failed to get the AT command string.
621  *
622  */
623 //--------------------------------------------------------------------------------------------------
625 (
626  le_atServer_CmdRef_t commandRef,
627  ///< [IN] AT command reference
628  char* name,
629  ///< [OUT] AT command string
630  size_t nameSize
631  ///< [IN]
632 );
633 
634 //--------------------------------------------------------------------------------------------------
635 /**
636  * This function can be used to get the device reference in use for an AT command specified with
637  * its reference.
638  *
639  * @return
640  * - LE_OK The function succeeded.
641  * - LE_FAULT The function failed to get the AT command string.
642  *
643  */
644 //--------------------------------------------------------------------------------------------------
646 (
647  le_atServer_CmdRef_t commandRef,
648  ///< [IN] AT command reference
649  le_atServer_DeviceRef_t* deviceRefPtr
650  ///< [OUT] Device reference
651 );
652 
653 //--------------------------------------------------------------------------------------------------
654 /**
655  * This function can be used to send an intermediate response.
656  *
657  * @return
658  * - LE_OK The function succeeded.
659  * - LE_FAULT The function failed to send the intermediate response.
660  *
661  */
662 //--------------------------------------------------------------------------------------------------
664 (
665  le_atServer_CmdRef_t commandRef,
666  ///< [IN] AT command reference
667  const char* LE_NONNULL intermediateRsp
668  ///< [IN] Intermediate response to be
669  ///< sent
670 );
671 
672 //--------------------------------------------------------------------------------------------------
673 /**
674  * This function can be used to send the final response.
675  *
676  * @return
677  * - LE_OK The function succeeded.
678  * - LE_FAULT The function failed to send the final response.
679  *
680  */
681 //--------------------------------------------------------------------------------------------------
683 (
684  le_atServer_CmdRef_t commandRef,
685  ///< [IN] AT command reference
686  le_atServer_FinalRsp_t finalResponse,
687  ///< [IN] Final response to be sent
688  bool customStringAvailable,
689  ///< [IN] Custom final response has to be sent
690  ///< instead of the default one.
691  const char* LE_NONNULL finalRsp
692  ///< [IN] custom final response string
693 );
694 
695 //--------------------------------------------------------------------------------------------------
696 /**
697  * This function can be used to send the unsolicited response.
698  *
699  * @return
700  * - LE_OK The function succeeded.
701  * - LE_FAULT The function failed to send the unsolicited response.
702  *
703  */
704 //--------------------------------------------------------------------------------------------------
706 (
707  const char* LE_NONNULL unsolRsp,
708  ///< [IN] Unsolicited response to be
709  ///< sent
710  le_atServer_AvailableDevice_t availableDevice,
711  ///< [IN] device to send the
712  ///< unsolicited response
714  ///< [IN] device reference where the
715  ///< unsolicited response has to
716  ///< be sent
717 );
718 
719 //--------------------------------------------------------------------------------------------------
720 /**
721  * This function enables echo on the selected device.
722  *
723  * @return
724  * - LE_OK The function succeeded.
725  * - LE_BAD_PARAMETER Invalid device reference.
726  */
727 //--------------------------------------------------------------------------------------------------
729 (
731  ///< [IN] device reference
732 );
733 
734 //--------------------------------------------------------------------------------------------------
735 /**
736  * This function disables echo on the selected device.
737  *
738  * @return
739  * - LE_OK The function succeeded.
740  * - LE_BAD_PARAMETER Invalid device reference.
741  */
742 //--------------------------------------------------------------------------------------------------
744 (
746  ///< [IN] device reference
747 );
748 
749 //--------------------------------------------------------------------------------------------------
750 /**
751  * This function opens a AT commands server bridge.
752  * All unknown AT commands will be sent on this alternative file descriptor thanks to the AT client
753  * Service.
754  *
755  * @return
756  * - Reference to the requested bridge.
757  * - NULL if the device can't be bridged
758  */
759 //--------------------------------------------------------------------------------------------------
761 (
762  int fd
763  ///< [IN] File descriptor.
764 );
765 
766 //--------------------------------------------------------------------------------------------------
767 /**
768  * This function closes an opened bridge.
769  *
770  * @return
771  * - LE_OK The function succeeded.
772  * - LE_FAULT The function failed to close the bridge.
773  * - LE_BUSY The bridge is in use (devices references have to be removed first).
774  */
775 //--------------------------------------------------------------------------------------------------
777 (
778  le_atServer_BridgeRef_t bridgeRef
779  ///< [IN] Bridge reference
780 );
781 
782 //--------------------------------------------------------------------------------------------------
783 /**
784  * This function adds a device to an opened bridge.
785  *
786  * @return
787  * - LE_OK The function succeeded.
788  * - LE_BUSY The device is already used by the bridge.
789  * - LE_FAULT The function failed to add the device to the bridge.
790  */
791 //--------------------------------------------------------------------------------------------------
793 (
794  le_atServer_DeviceRef_t deviceRef,
795  ///< [IN] Device reference to add to the bridge
796  le_atServer_BridgeRef_t bridgeRef
797  ///< [IN] Bridge refence
798 );
799 
800 //--------------------------------------------------------------------------------------------------
801 /**
802  * This function removes a device from a bridge
803  *
804  * @return
805  * - LE_OK The function succeeded.
806  * - LE_NOT_FOUND The device is not isued by the specified bridge
807  * - LE_BUSY The device is currently in use
808  * - LE_FAULT The function failed to add the device to the bridge.
809  */
810 //--------------------------------------------------------------------------------------------------
812 (
813  le_atServer_DeviceRef_t deviceRef,
814  ///< [IN] Device reference to add to the bridge
815  le_atServer_BridgeRef_t bridgeRef
816  ///< [IN] Bridge refence
817 );
818 
819 //--------------------------------------------------------------------------------------------------
820 /**
821  * This function enables extended error codes on the selected device.
822  */
823 //--------------------------------------------------------------------------------------------------
825 (
826  void
827 );
828 
829 //--------------------------------------------------------------------------------------------------
830 /**
831  * This function disables extended error codes on the selected device.
832  */
833 //--------------------------------------------------------------------------------------------------
835 (
836  void
837 );
838 
839 //--------------------------------------------------------------------------------------------------
840 /**
841  * This function allows the user to register a le_atServer_GetTextCallback_t callback
842  * to retrieve text and sends a prompt <CR><LF><greater_than><SPACE> on the current command's
843  * device.
844  *
845  * @return
846  * - LE_OK The function succeeded.
847  * - LE_BAD_PARAMETER Invalid device or command reference.
848  */
849 //--------------------------------------------------------------------------------------------------
851 (
852  le_atServer_CmdRef_t cmdRef,
853  ///< [IN] AT command reference
855  ///< [IN] Get text callback
856  void* contextPtr
857  ///< [IN]
858 );
859 
860 #endif // LE_ATSERVER_INTERFACE_H_INCLUDE_GUARD
void le_atServer_SetServerDisconnectHandler(le_atServer_DisconnectHandler_t disconnectHandler, void *contextPtr)
le_result_t le_atServer_AddDeviceToBridge(le_atServer_DeviceRef_t deviceRef, le_atServer_BridgeRef_t bridgeRef)
Definition: le_atServer_interface.h:376
void le_atServer_DisableExtendedErrorCodes(void)
le_result_t
Definition: le_basics.h:35
le_atServer_CmdRef_t le_atServer_Create(const char *LE_NONNULL name)
action will be done on all bound devices
Definition: le_atServer_interface.h:393
Action AT command (e.g. &#39;AT+CMD&#39;)
Definition: le_atServer_interface.h:357
le_atServer_BridgeRef_t le_atServer_OpenBridge(int fd)
le_result_t le_atServer_SendUnsolicitedResponse(const char *LE_NONNULL unsolRsp, le_atServer_AvailableDevice_t availableDevice, le_atServer_DeviceRef_t device)
void(* le_atServer_GetTextCallbackFunc_t)(le_atServer_CmdRef_t cmdRef, le_result_t result, const char *LE_NONNULL text, uint32_t len, void *contextPtr)
Definition: le_atServer_interface.h:441
le_result_t le_atServer_CloseBridge(le_atServer_BridgeRef_t bridgeRef)
struct le_atServer_Device * le_atServer_DeviceRef_t
Definition: le_atServer_interface.h:338
action will be done on a specified device
Definition: le_atServer_interface.h:395
le_atServer_DeviceRef_t le_atServer_Open(int fd)
le_result_t le_atServer_GetCommandName(le_atServer_CmdRef_t commandRef, char *name, size_t nameSize)
void(* le_atServer_DisconnectHandler_t)(void *)
Definition: le_atServer_interface.h:248
void le_atServer_EnableExtendedErrorCodes(void)
le_result_t le_atServer_Close(le_atServer_DeviceRef_t device)
le_result_t le_atServer_Delete(le_atServer_CmdRef_t commandRef)
le_atServer_FinalRsp_t
Definition: le_atServer_interface.h:374
void(* le_atServer_CommandHandlerFunc_t)(le_atServer_CmdRef_t commandRef, le_atServer_Type_t type, uint32_t parametersNumber, void *contextPtr)
Definition: le_atServer_interface.h:418
le_atServer_Type_t
Definition: le_atServer_interface.h:355
le_result_t le_atServer_GetTextAsync(le_atServer_CmdRef_t cmdRef, le_atServer_GetTextCallbackFunc_t callbackPtr, void *contextPtr)
le_atServer_CommandHandlerRef_t le_atServer_AddCommandHandler(le_atServer_CmdRef_t commandRef, le_atServer_CommandHandlerFunc_t handlerPtr, void *contextPtr)
void le_atServer_DisconnectService(void)
le_result_t le_atServer_RemoveDeviceFromBridge(le_atServer_DeviceRef_t deviceRef, le_atServer_BridgeRef_t bridgeRef)
le_result_t le_atServer_DisableEcho(le_atServer_DeviceRef_t device)
AT command received with parameters (e.g. &#39;AT+CMD=x,y&#39;)
Definition: le_atServer_interface.h:359
le_result_t le_atServer_EnableEcho(le_atServer_DeviceRef_t device)
void le_atServer_ConnectService(void)
Test AT command (e.g. &#39;AT+CMD=?&#39;)
Definition: le_atServer_interface.h:361
le_atServer_AvailableDevice_t
Definition: le_atServer_interface.h:391
le_result_t le_atServer_SendIntermediateResponse(le_atServer_CmdRef_t commandRef, const char *LE_NONNULL intermediateRsp)
le_result_t le_atServer_SendFinalResponse(le_atServer_CmdRef_t commandRef, le_atServer_FinalRsp_t finalResponse, bool customStringAvailable, const char *LE_NONNULL finalRsp)
le_result_t le_atServer_GetParameter(le_atServer_CmdRef_t commandRef, uint32_t index, char *parameter, size_t parameterSize)
struct le_atServer_CommandHandler * le_atServer_CommandHandlerRef_t
Definition: le_atServer_interface.h:406
Definition: le_atServer_interface.h:379
le_result_t le_atServer_TryConnectService(void)
void le_atServer_RemoveCommandHandler(le_atServer_CommandHandlerRef_t handlerRef)
le_result_t le_atServer_GetDevice(le_atServer_CmdRef_t commandRef, le_atServer_DeviceRef_t *deviceRefPtr)
le_result_t le_atServer_Suspend(le_atServer_DeviceRef_t device)
struct le_atServer_Cmd * le_atServer_CmdRef_t
Definition: le_atServer_interface.h:330
le_result_t le_atServer_Resume(le_atServer_DeviceRef_t device)
struct le_atServer_Bridge * le_atServer_BridgeRef_t
Definition: le_atServer_interface.h:346
Read AT command (e.g. &#39;AT+CMD?&#39;)
Definition: le_atServer_interface.h:363