le_avc_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_avc_common.h
12  *
13  * Type definitions for le_avc.
14  *
15  */
16 #ifndef LE_AVC_COMMON_H_INCLUDE_GUARD
17 #define LE_AVC_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_limit_common.h"
24 
25 #define IFGEN_LE_AVC_PROTOCOL_ID "2d291a6c2350ce63aea7dee871440002"
26 #define IFGEN_LE_AVC_MSG_SIZE 529
27 /** @addtogroup le_avc
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Maximum APN name length without NULL terminator.
34  */
35 //--------------------------------------------------------------------------------------------------
36 #define LE_AVC_APN_NAME_MAX_LEN 48
37 
38 //--------------------------------------------------------------------------------------------------
39 /**
40  * Maximum APN name length including NULL terminator.
41  */
42 //--------------------------------------------------------------------------------------------------
43 #define LE_AVC_APN_NAME_MAX_LEN_BYTES 49
44 
45 //--------------------------------------------------------------------------------------------------
46 /**
47  * Maximum user name length without NULL terminator.
48  */
49 //--------------------------------------------------------------------------------------------------
50 #define LE_AVC_USERNAME_MAX_LEN 28
51 
52 //--------------------------------------------------------------------------------------------------
53 /**
54  * Maximum user name length including NULL terminator.
55  */
56 //--------------------------------------------------------------------------------------------------
57 #define LE_AVC_USERNAME_MAX_LEN_BYTES 29
58 
59 //--------------------------------------------------------------------------------------------------
60 /**
61  * Maximum password length without NULL terminator..
62  */
63 //--------------------------------------------------------------------------------------------------
64 #define LE_AVC_PASSWORD_MAX_LEN 28
65 
66 //--------------------------------------------------------------------------------------------------
67 /**
68  * Maximum password length including NULL terminator.
69  */
70 //--------------------------------------------------------------------------------------------------
71 #define LE_AVC_PASSWORD_MAX_LEN_BYTES 29
72 
73 //--------------------------------------------------------------------------------------------------
74 /**
75  * Maximum number of retry timers.
76  */
77 //--------------------------------------------------------------------------------------------------
78 #define LE_AVC_NUM_RETRY_TIMERS 8
79 
80 //--------------------------------------------------------------------------------------------------
81 /**
82  * Polling timer value range in minutes. 525600 minutes = 1 year.
83  */
84 //--------------------------------------------------------------------------------------------------
85 #define LE_AVC_POLLING_TIMER_MAX_VAL 525600
86 
87 //--------------------------------------------------------------------------------------------------
88 /**
89  */
90 //--------------------------------------------------------------------------------------------------
91 #define LE_AVC_POLLING_TIMER_MIN_VAL 0
92 
93 //--------------------------------------------------------------------------------------------------
94 /**
95  * Retry timer value range in minutes. 20160 minutes = 2 weeks.
96  */
97 //--------------------------------------------------------------------------------------------------
98 #define LE_AVC_RETRY_TIMER_MAX_VAL 20160
99 
100 //--------------------------------------------------------------------------------------------------
101 /**
102  */
103 //--------------------------------------------------------------------------------------------------
104 #define LE_AVC_RETRY_TIMER_MIN_VAL 0
105 
106 //--------------------------------------------------------------------------------------------------
107 /**
108  * Default HTTP status.
109  */
110 //--------------------------------------------------------------------------------------------------
111 #define LE_AVC_HTTP_STATUS_INVALID 65535
112 
113 //--------------------------------------------------------------------------------------------------
114 /**
115  * Communication info max string size
116  */
117 //--------------------------------------------------------------------------------------------------
118 #define LE_AVC_COMM_INFO_STR_MAX_LEN 256
119 
120 //--------------------------------------------------------------------------------------------------
121 /**
122  * Maximum length of a LwM2M resource excluding any termination character.
123  */
124 //--------------------------------------------------------------------------------------------------
125 #define LE_AVC_MAX_LWM2M_RESOURCE_LEN 512
126 
127 //--------------------------------------------------------------------------------------------------
128 /**
129  * Maximum length of a LwM2M resource. One extra byte is added for the null character.
130  */
131 //--------------------------------------------------------------------------------------------------
132 #define LE_AVC_MAX_LWM2M_RESOURCE_BYTES 513
133 
134 //--------------------------------------------------------------------------------------------------
135 /**
136  * Communication info codes
137  */
138 //--------------------------------------------------------------------------------------------------
139 #define LE_AVC_COMM_INFO_UDP_NO_ERR 0
140 
141 //--------------------------------------------------------------------------------------------------
142 /**
143  */
144 //--------------------------------------------------------------------------------------------------
145 #define LE_AVC_COMM_INFO_UDP_OPEN_ERR 1
146 
147 //--------------------------------------------------------------------------------------------------
148 /**
149  */
150 //--------------------------------------------------------------------------------------------------
151 #define LE_AVC_COMM_INFO_UDP_CLOSE_ERR 2
152 
153 //--------------------------------------------------------------------------------------------------
154 /**
155  */
156 //--------------------------------------------------------------------------------------------------
157 #define LE_AVC_COMM_INFO_UDP_SEND_ERR 3
158 
159 //--------------------------------------------------------------------------------------------------
160 /**
161  */
162 //--------------------------------------------------------------------------------------------------
163 #define LE_AVC_COMM_INFO_UDP_RECV_ERR 4
164 
165 //--------------------------------------------------------------------------------------------------
166 /**
167  */
168 //--------------------------------------------------------------------------------------------------
169 #define LE_AVC_COMM_INFO_UDP_CONNECT_ERR 5
170 
171 //--------------------------------------------------------------------------------------------------
172 /**
173  */
174 //--------------------------------------------------------------------------------------------------
175 #define LE_AVC_COMM_INFO_BEARER_UP 6
176 
177 //--------------------------------------------------------------------------------------------------
178 /**
179  */
180 //--------------------------------------------------------------------------------------------------
181 #define LE_AVC_COMM_INFO_BEARER_DOWN 7
182 
183 //--------------------------------------------------------------------------------------------------
184 /**
185  */
186 //--------------------------------------------------------------------------------------------------
187 #define LE_AVC_COMM_INFO_PDP_CONTEXT 8
188 
189 //--------------------------------------------------------------------------------------------------
190 /**
191  */
192 //--------------------------------------------------------------------------------------------------
193 #define LE_AVC_COMM_INFO_COAP_201_CREATED 65
194 
195 //--------------------------------------------------------------------------------------------------
196 /**
197  */
198 //--------------------------------------------------------------------------------------------------
199 #define LE_AVC_COMM_INFO_COAP_202_DELETED 66
200 
201 //--------------------------------------------------------------------------------------------------
202 /**
203  */
204 //--------------------------------------------------------------------------------------------------
205 #define LE_AVC_COMM_INFO_COAP_204_CHANGED 68
206 
207 //--------------------------------------------------------------------------------------------------
208 /**
209  */
210 //--------------------------------------------------------------------------------------------------
211 #define LE_AVC_COMM_INFO_COAP_205_CONTENT 69
212 
213 //--------------------------------------------------------------------------------------------------
214 /**
215  */
216 //--------------------------------------------------------------------------------------------------
217 #define LE_AVC_COMM_INFO_COAP_231_CONTINUE 95
218 
219 //--------------------------------------------------------------------------------------------------
220 /**
221  */
222 //--------------------------------------------------------------------------------------------------
223 #define LE_AVC_COMM_INFO_COAP_400_BAD_REQUEST 128
224 
225 //--------------------------------------------------------------------------------------------------
226 /**
227  */
228 //--------------------------------------------------------------------------------------------------
229 #define LE_AVC_COMM_INFO_COAP_401_UNAUTHORIZED 129
230 
231 //--------------------------------------------------------------------------------------------------
232 /**
233  */
234 //--------------------------------------------------------------------------------------------------
235 #define LE_AVC_COMM_INFO_COAP_402_BAD_OPTION 130
236 
237 //--------------------------------------------------------------------------------------------------
238 /**
239  */
240 //--------------------------------------------------------------------------------------------------
241 #define LE_AVC_COMM_INFO_COAP_404_NOT_FOUND 132
242 
243 //--------------------------------------------------------------------------------------------------
244 /**
245  */
246 //--------------------------------------------------------------------------------------------------
247 #define LE_AVC_COMM_INFO_COAP_405_METHOD_NOT_ALLOWED 133
248 
249 //--------------------------------------------------------------------------------------------------
250 /**
251  */
252 //--------------------------------------------------------------------------------------------------
253 #define LE_AVC_COMM_INFO_COAP_406_NOT_ACCEPTABLE 134
254 
255 //--------------------------------------------------------------------------------------------------
256 /**
257  */
258 //--------------------------------------------------------------------------------------------------
259 #define LE_AVC_COMM_INFO_COAP_408_REQ_ENTITY_INCOMPLETE 136
260 
261 //--------------------------------------------------------------------------------------------------
262 /**
263  */
264 //--------------------------------------------------------------------------------------------------
265 #define LE_AVC_COMM_INFO_COAP_412_PRECONDITION_FAILED 140
266 
267 //--------------------------------------------------------------------------------------------------
268 /**
269  */
270 //--------------------------------------------------------------------------------------------------
271 #define LE_AVC_COMM_INFO_COAP_413_ENTITY_TOO_LARGE 141
272 
273 //--------------------------------------------------------------------------------------------------
274 /**
275  */
276 //--------------------------------------------------------------------------------------------------
277 #define LE_AVC_COMM_INFO_COAP_500_INTERNAL_SERVER_ERROR 160
278 
279 //--------------------------------------------------------------------------------------------------
280 /**
281  */
282 //--------------------------------------------------------------------------------------------------
283 #define LE_AVC_COMM_INFO_COAP_501_NOT_IMPLEMENTED 161
284 
285 //--------------------------------------------------------------------------------------------------
286 /**
287  */
288 //--------------------------------------------------------------------------------------------------
289 #define LE_AVC_COMM_INFO_COAP_503_SERVICE_UNAVAILABLE 163
290 
291 //--------------------------------------------------------------------------------------------------
292 /**
293  * When used as a Server ID, indicate that the operation is applicable to all servers.
294  */
295 //--------------------------------------------------------------------------------------------------
296 #define LE_AVC_SERVER_ID_ALL_SERVERS 65535
297 
298 //--------------------------------------------------------------------------------------------------
299 /**
300  * Server ID of the AirVantage server (by convention).
301  */
302 //--------------------------------------------------------------------------------------------------
303 #define LE_AVC_SERVER_ID_AIRVANTAGE 1
304 
305 //--------------------------------------------------------------------------------------------------
306 /**
307  * Config tree root to store the SIM APDU data
308  */
309 //--------------------------------------------------------------------------------------------------
310 #define LE_AVC_CONFIG_TREE_ROOT "avcService:/"
311 
312 //--------------------------------------------------------------------------------------------------
313 /**
314  * Config tree entry to store the SIM APDU data
315  */
316 //--------------------------------------------------------------------------------------------------
317 #define LE_AVC_CONFIG_SIM_APDU_PATH "SIM_APDU"
318 
319 //--------------------------------------------------------------------------------------------------
320 /**
321  * Config tree entry to store the SIM APDU response
322  */
323 //--------------------------------------------------------------------------------------------------
324 #define LE_AVC_CONFIG_SIM_APDU_RESP_PATH "SIM_APDU_RESP"
325 
326 //--------------------------------------------------------------------------------------------------
327 /**
328  * Status of session or update
329  *
330  * If an update is pending, it must first be downloaded and then installed.
331  */
332 //--------------------------------------------------------------------------------------------------
333 typedef enum
334 {
336  ///< No updates pending
338  ///< Update pending download
340  ///< Download in progress
342  ///< Download has completed
344  ///< An error occurred downloading the update
346  ///< Install is pending (implies download complete)
348  ///< Install in progress
350  ///< Update has been successfully installed
352  ///< An error occurred installing the update
354  ///< Uninstall is pending
356  ///< Uninstall in progress
358  ///< App has been successfully uninstalled
360  ///< An error occurred uninstalling the update
362  ///< Session with AirVantage device management server started
364  ///< Session with bootstrap server started
366  ///< Session with AirVantage device management server or bootstrap
367  ///< server stopped
369  ///< Session with AirVantage device management server or bootstrap
370  ///< server failed
372  ///< Device reboot is pending
374  ///< Connection to the server is required. This is necessary when
375  ///< firmware package is installed (after a platform reboot). Also
376  ///< necessary after software update if device reboots(or session stops)
377  ///< in the middle of software update.
379  ///< Authentication with AirVantage device management server or
380  ///< bootstrap server started
382  ///< Authentication with AirVantage device management server or
383  ///< bootstrap server failed
385  ///< Package is certified sent by a trusted server
387  ///< Package is not certified sent by a trusted server
389  ///< Download timeout
390 }
392 
393 
394 //--------------------------------------------------------------------------------------------------
395 /**
396  * Operations which require user agreement
397  */
398 //--------------------------------------------------------------------------------------------------
399 typedef enum
400 {
402  ///< User agreement for connection
404  ///< User agreement for download
406  ///< User agreement for install
408  ///< User agreement for uninstall
410  ///< User agreement for reboot
411 }
413 
414 
415 //--------------------------------------------------------------------------------------------------
416 /**
417  * Request to open or close avms session.
418  */
419 //--------------------------------------------------------------------------------------------------
420 typedef enum
421 {
423  ///< Request by user app to open AV session
425  ///< Request by user app to close AV session
426 }
428 
429 
430 //--------------------------------------------------------------------------------------------------
431 /**
432  * The type of pending update
433  */
434 //--------------------------------------------------------------------------------------------------
435 typedef enum
436 {
437  LE_AVC_UNKNOWN_UPDATE = 0,
438  ///<
439  LE_AVC_FIRMWARE_UPDATE = 1,
440  ///<
441  LE_AVC_FRAMEWORK_UPDATE = 2,
442  ///<
443  LE_AVC_APPLICATION_UPDATE = 3
444  ///<
445 }
447 
448 
449 //--------------------------------------------------------------------------------------------------
450 /**
451  * Error code used to provide diagnostic information after a failure (includes both download and
452  * install failure).
453  *
454  * @note
455  * Additional information may also be available in the target device's system log.
456  */
457 //--------------------------------------------------------------------------------------------------
458 typedef enum
459 {
461  ///< No error.
463  ///< Encountered a bad package, package download can not be
464  ///< resumed.
466  ///< Something failed while doing install/download, package
467  ///< download can not be resumed.
469  ///< Security check failure while installing the package,
470  ///< package download can not be resumed.
472  ///< RAM issue during package download, package download can be
473  ///< resumed but a platform reboot is requires.
475  ///< Network issue during package download (IP issues), package
476  ///< download can be resumed.
478  ///< Flash issue during package download, package download can
479  ///< not be resumed.
481  ///< Not enough space in flash to store the package
482 }
484 
485 
486 //--------------------------------------------------------------------------------------------------
487 /**
488  * Session type indicates whether the device is connected to the bootstrap server or the
489  * device management server.
490  */
491 //--------------------------------------------------------------------------------------------------
492 typedef enum
493 {
495  ///< Bootstrap session.
497  ///< Device Management session.
499  ///< Session type invalid.
500 }
502 
503 
504 //--------------------------------------------------------------------------------------------------
505 /**
506  * Status of the device credentials
507  */
508 //--------------------------------------------------------------------------------------------------
509 typedef enum
510 {
512  ///< Neither Bootstrap nor Device Management
513  ///< credential is provisioned.
515  ///< Bootstrap credential is provisioned but Device
516  ///< Management credential is not provisioned.
518  ///< Device Management credential is provisioned.
519 }
521 
522 
523 //--------------------------------------------------------------------------------------------------
524 /**
525  * Type of the configuration to pass to the API
526  */
527 //--------------------------------------------------------------------------------------------------
528 typedef enum
529 {
531  ///< SIM APDU response
532 }
534 
535 
536 //--------------------------------------------------------------------------------------------------
537 /**
538  * Reference type used by Add/Remove functions for EVENT 'le_avc_StatusEvent'
539  */
540 //--------------------------------------------------------------------------------------------------
541 typedef struct le_avc_StatusEventHandler* le_avc_StatusEventHandlerRef_t;
542 
543 
544 //--------------------------------------------------------------------------------------------------
545 /**
546  * Reference type used by Add/Remove functions for EVENT 'le_avc_SessionRequestEvent'
547  */
548 //--------------------------------------------------------------------------------------------------
549 typedef struct le_avc_SessionRequestEventHandler* le_avc_SessionRequestEventHandlerRef_t;
550 
551 
552 //--------------------------------------------------------------------------------------------------
553 /**
554  * Reference type used by Add/Remove functions for EVENT 'le_avc_CommInfo'
555  */
556 //--------------------------------------------------------------------------------------------------
557 typedef struct le_avc_CommInfoHandler* le_avc_CommInfoHandlerRef_t;
558 
559 
560 //--------------------------------------------------------------------------------------------------
561 /**
562  * Reference returned by BlockInstall function and used by UnblockInstall function
563  */
564 //--------------------------------------------------------------------------------------------------
565 typedef struct le_avc_BlockRequest* le_avc_BlockRequestRef_t;
566 
567 
568 //--------------------------------------------------------------------------------------------------
569 /**
570  * Handler for update availability status
571  */
572 //--------------------------------------------------------------------------------------------------
573 typedef void (*le_avc_StatusHandlerFunc_t)
574 (
575  le_avc_Status_t updateStatus,
576  ///< status of pending update, if available
577  int32_t totalNumBytes,
578  ///< Total number of bytes to be downloaded
579  ///< only valid when updateStatus is one of
580  ///< DOWNLOAD_PENDING, DOWNLOAD_IN_PROGRESS or DOWNLOAD_COMPLETE.
581  ///< returns -1 if value is unknown
582  int32_t progress,
583  ///< Task completion in percentage
584  ///< Valid when updateStatus is one of DOWNLOAD_IN_PROGRESS,
585  ///< INSTALL_IN_PROGRESS or UNINSTALL_IN_PROGRESS.
586  ///< returns -1 if value is unknown
587  void* contextPtr
588  ///<
589 );
590 
591 //--------------------------------------------------------------------------------------------------
592 /**
593  * Handler for receiving session open or close request.
594  */
595 //--------------------------------------------------------------------------------------------------
597 (
598  le_avc_SessionRequest_t request,
599  ///< Request to open or close AV session
600  void* contextPtr
601  ///<
602 );
603 
604 //--------------------------------------------------------------------------------------------------
605 /**
606  * Handler for receiving communication information.
607  */
608 //--------------------------------------------------------------------------------------------------
609 typedef void (*le_avc_CommInfoHandlerFunc_t)
610 (
611  uint8_t code,
612  ///< Communication information code
613  const char* LE_NONNULL str,
614  ///< Communication information string
615  void* contextPtr
616  ///<
617 );
618 
619 
620 //--------------------------------------------------------------------------------------------------
621 /**
622  * Get if this client bound locally.
623  */
624 //--------------------------------------------------------------------------------------------------
625 LE_SHARED bool ifgen_le_avc_HasLocalBinding
626 (
627  void
628 );
629 
630 
631 //--------------------------------------------------------------------------------------------------
632 /**
633  * Init data that is common across all threads
634  */
635 //--------------------------------------------------------------------------------------------------
636 LE_SHARED void ifgen_le_avc_InitCommonData
637 (
638  void
639 );
640 
641 
642 //--------------------------------------------------------------------------------------------------
643 /**
644  * Perform common initialization and open a session
645  */
646 //--------------------------------------------------------------------------------------------------
647 LE_SHARED le_result_t ifgen_le_avc_OpenSession
648 (
649  le_msg_SessionRef_t _ifgen_sessionRef,
650  bool isBlocking
651 );
652 
653 //--------------------------------------------------------------------------------------------------
654 /**
655  * Add handler function for EVENT 'le_avc_StatusEvent'
656  *
657  * This event provides information on update availability status
658  */
659 //--------------------------------------------------------------------------------------------------
660 LE_SHARED le_avc_StatusEventHandlerRef_t ifgen_le_avc_AddStatusEventHandler
661 (
662  le_msg_SessionRef_t _ifgen_sessionRef,
663  le_avc_StatusHandlerFunc_t handlerPtr,
664  ///< [IN]
665  void* contextPtr
666  ///< [IN]
667 );
668 
669 //--------------------------------------------------------------------------------------------------
670 /**
671  * Remove handler function for EVENT 'le_avc_StatusEvent'
672  */
673 //--------------------------------------------------------------------------------------------------
674 LE_SHARED void ifgen_le_avc_RemoveStatusEventHandler
675 (
676  le_msg_SessionRef_t _ifgen_sessionRef,
678  ///< [IN]
679 );
680 
681 //--------------------------------------------------------------------------------------------------
682 /**
683  * Add handler function for EVENT 'le_avc_SessionRequestEvent'
684  *
685  * This event provides information on session open or close request.
686  */
687 //--------------------------------------------------------------------------------------------------
688 LE_SHARED le_avc_SessionRequestEventHandlerRef_t ifgen_le_avc_AddSessionRequestEventHandler
689 (
690  le_msg_SessionRef_t _ifgen_sessionRef,
692  ///< [IN]
693  void* contextPtr
694  ///< [IN]
695 );
696 
697 //--------------------------------------------------------------------------------------------------
698 /**
699  * Remove handler function for EVENT 'le_avc_SessionRequestEvent'
700  */
701 //--------------------------------------------------------------------------------------------------
702 LE_SHARED void ifgen_le_avc_RemoveSessionRequestEventHandler
703 (
704  le_msg_SessionRef_t _ifgen_sessionRef,
706  ///< [IN]
707 );
708 
709 //--------------------------------------------------------------------------------------------------
710 /**
711  * Add handler function for EVENT 'le_avc_CommInfo'
712  *
713  * This event provides communication errors.
714  */
715 //--------------------------------------------------------------------------------------------------
716 LE_SHARED le_avc_CommInfoHandlerRef_t ifgen_le_avc_AddCommInfoHandler
717 (
718  le_msg_SessionRef_t _ifgen_sessionRef,
719  le_avc_CommInfoHandlerFunc_t handlerPtr,
720  ///< [IN]
721  void* contextPtr
722  ///< [IN]
723 );
724 
725 //--------------------------------------------------------------------------------------------------
726 /**
727  * Remove handler function for EVENT 'le_avc_CommInfo'
728  */
729 //--------------------------------------------------------------------------------------------------
730 LE_SHARED void ifgen_le_avc_RemoveCommInfoHandler
731 (
732  le_msg_SessionRef_t _ifgen_sessionRef,
733  le_avc_CommInfoHandlerRef_t handlerRef
734  ///< [IN]
735 );
736 
737 //--------------------------------------------------------------------------------------------------
738 /**
739  * Start a session with the AirVantage server
740  *
741  * This will cause a query to be sent to the server, for pending updates.
742  *
743  * @return
744  * - LE_OK if connection request has been sent.
745  * - LE_FAULT on failure
746  * - LE_DUPLICATE if already connected.
747  */
748 //--------------------------------------------------------------------------------------------------
749 LE_SHARED le_result_t ifgen_le_avc_StartSession
750 (
751  le_msg_SessionRef_t _ifgen_sessionRef
752 );
753 
754 //--------------------------------------------------------------------------------------------------
755 /**
756  * Start a session with a specific Device Management (DM) server.
757  *
758  * This function is similar to le_avc_StartSession(), with the main difference of adding extra
759  * parameter to specify the Server ID of the DM server; this way, it provides flexibility to
760  * connect to any DM server, not just AirVantage.
761  *
762  * For example, the device may need to communicate with EDM server that is providing support
763  * for the SIM Reachability features (LWM2M proprietory object 33408).
764  *
765  * Reserved Server IDs are:
766  * 0 for Bootstrap server
767  * 1 for AirVantage server
768  * 1000 for EDM server
769  *
770  * @note DM servers may have different capabilities in terms of which LWM2M objects they support.
771  * For instance, EDM server supports only one specific type of object (Object 33408), and does
772  * not support Objects 5 and 9, which means it doesn't allow SOTA/FOTA operations.
773  *
774  * @note To initiate a session with AirVantage server, it's preferable to use le_avc_StartSession()
775  * which exists specifically for this purpose.
776  *
777  * @note If the device doesn't have credentials for the specificed DM server, the boostrapping
778  * process will be automatically initiated.
779  *
780  * @return
781  * - LE_OK if connection request has been sent.
782  * - LE_FAULT on failure
783  * - LE_DUPLICATE if already connected to the server.
784  */
785 //--------------------------------------------------------------------------------------------------
786 LE_SHARED le_result_t ifgen_le_avc_StartDmSession
787 (
788  le_msg_SessionRef_t _ifgen_sessionRef,
789  uint16_t serverId,
790  ///< [IN] Short ID of the DM server. If equals to ALL_SERVERS, the
791  ///< session will be started with all available DM servers.
792  bool isAutoDisconnect
793  ///< [IN] Whether the session should be auto disconnected
794 );
795 
796 //--------------------------------------------------------------------------------------------------
797 /**
798  * Stop a session with the DM server
799  *
800  * If a download is in progress and the user agreement is enabled, this suspends the download,
801  * otherwise if the user agreement is disabled, a new connection is automatically initiated in order
802  * to resume the download.
803  *
804  * @return
805  * - LE_OK on success
806  * - LE_FAULT on failure
807  * - LE_DUPLICATE if already disconnected
808  */
809 //--------------------------------------------------------------------------------------------------
810 LE_SHARED le_result_t ifgen_le_avc_StopSession
811 (
812  le_msg_SessionRef_t _ifgen_sessionRef
813 );
814 
815 //--------------------------------------------------------------------------------------------------
816 /**
817  * Send a specific message to the server to be sure that the route between the device and the server
818  * is available.
819  * This API needs to be called when any package download is over (successfully or not) and before
820  * sending any notification on asset data to the server.
821  *
822  * @return
823  * - LE_OK when the treatment is launched
824  * - LE_FAULT on failure
825  * - LE_UNSUPPORTED when the API is not supported
826  *
827  */
828 //--------------------------------------------------------------------------------------------------
829 LE_SHARED le_result_t ifgen_le_avc_CheckRoute
830 (
831  le_msg_SessionRef_t _ifgen_sessionRef
832 );
833 
834 //--------------------------------------------------------------------------------------------------
835 /**
836  * Defer the currently pending connection, for the given number of minutes
837  *
838  * @return
839  * - LE_OK on success
840  * - LE_FAULT on failure
841  */
842 //--------------------------------------------------------------------------------------------------
843 LE_SHARED le_result_t ifgen_le_avc_DeferConnect
844 (
845  le_msg_SessionRef_t _ifgen_sessionRef,
846  uint32_t deferMinutes
847  ///< [IN]
848 );
849 
850 //--------------------------------------------------------------------------------------------------
851 /**
852  * Accept the currently pending download
853  *
854  * @return
855  * - LE_OK on success
856  * - LE_FAULT on failure
857  */
858 //--------------------------------------------------------------------------------------------------
859 LE_SHARED le_result_t ifgen_le_avc_AcceptDownload
860 (
861  le_msg_SessionRef_t _ifgen_sessionRef
862 );
863 
864 //--------------------------------------------------------------------------------------------------
865 /**
866  * Defer the currently pending download, for the given number of minutes
867  *
868  * @return
869  * - LE_OK on success
870  * - LE_FAULT on failure
871  */
872 //--------------------------------------------------------------------------------------------------
873 LE_SHARED le_result_t ifgen_le_avc_DeferDownload
874 (
875  le_msg_SessionRef_t _ifgen_sessionRef,
876  uint32_t deferMinutes
877  ///< [IN]
878 );
879 
880 //--------------------------------------------------------------------------------------------------
881 /**
882  * Accept the currently pending install
883  *
884  * @return
885  * - LE_OK on success
886  * - LE_FAULT on failure
887  */
888 //--------------------------------------------------------------------------------------------------
889 LE_SHARED le_result_t ifgen_le_avc_AcceptInstall
890 (
891  le_msg_SessionRef_t _ifgen_sessionRef
892 );
893 
894 //--------------------------------------------------------------------------------------------------
895 /**
896  * Defer the currently pending install
897  *
898  * @return
899  * - LE_OK on success
900  * - LE_FAULT on failure
901  */
902 //--------------------------------------------------------------------------------------------------
903 LE_SHARED le_result_t ifgen_le_avc_DeferInstall
904 (
905  le_msg_SessionRef_t _ifgen_sessionRef,
906  uint32_t deferMinutes
907  ///< [IN]
908 );
909 
910 //--------------------------------------------------------------------------------------------------
911 /**
912  * Accept the currently pending uninstall
913  *
914  * @return
915  * - LE_OK on success
916  * - LE_FAULT on failure
917  */
918 //--------------------------------------------------------------------------------------------------
919 LE_SHARED le_result_t ifgen_le_avc_AcceptUninstall
920 (
921  le_msg_SessionRef_t _ifgen_sessionRef
922 );
923 
924 //--------------------------------------------------------------------------------------------------
925 /**
926  * Defer the currently pending uninstall
927  *
928  * @return
929  * - LE_OK on success
930  * - LE_FAULT on failure
931  */
932 //--------------------------------------------------------------------------------------------------
933 LE_SHARED le_result_t ifgen_le_avc_DeferUninstall
934 (
935  le_msg_SessionRef_t _ifgen_sessionRef,
936  uint32_t deferMinutes
937  ///< [IN]
938 );
939 
940 //--------------------------------------------------------------------------------------------------
941 /**
942  * Accept the currently pending reboot
943  *
944  * @note When this function is called, a 2-second timer is launched and the reboot function is
945  * called when the timer expires.
946  *
947  * @return
948  * - LE_OK on success
949  * - LE_FAULT on failure
950  */
951 //--------------------------------------------------------------------------------------------------
952 LE_SHARED le_result_t ifgen_le_avc_AcceptReboot
953 (
954  le_msg_SessionRef_t _ifgen_sessionRef
955 );
956 
957 //--------------------------------------------------------------------------------------------------
958 /**
959  * Defer the currently pending reboot
960  *
961  * @return
962  * - LE_OK on success
963  * - LE_FAULT on failure
964  */
965 //--------------------------------------------------------------------------------------------------
966 LE_SHARED le_result_t ifgen_le_avc_DeferReboot
967 (
968  le_msg_SessionRef_t _ifgen_sessionRef,
969  uint32_t deferMinutes
970  ///< [IN]
971 );
972 
973 //--------------------------------------------------------------------------------------------------
974 /**
975  * Get the update type of the currently pending update
976  *
977  * @return
978  * - LE_OK on success
979  * - LE_FAULT if not available
980  */
981 //--------------------------------------------------------------------------------------------------
982 LE_SHARED le_result_t ifgen_le_avc_GetUpdateType
983 (
984  le_msg_SessionRef_t _ifgen_sessionRef,
985  le_avc_UpdateType_t* updateTypePtr
986  ///< [OUT]
987 );
988 
989 //--------------------------------------------------------------------------------------------------
990 /**
991  * Get the name for the currently pending app update
992  *
993  * @return
994  * - LE_OK on success
995  * - LE_FAULT if not available, or isn't APPL_UPDATE type
996  */
997 //--------------------------------------------------------------------------------------------------
998 LE_SHARED le_result_t ifgen_le_avc_GetAppUpdateName
999 (
1000  le_msg_SessionRef_t _ifgen_sessionRef,
1001  char* updateName,
1002  ///< [OUT]
1003  size_t updateNameSize
1004  ///< [IN]
1005 );
1006 
1007 //--------------------------------------------------------------------------------------------------
1008 /**
1009  * Prevent any pending updates from being installed.
1010  *
1011  * @return
1012  * - Reference for block update request (to be used later for unblocking updates)
1013  * - NULL if the operation was not successful
1014  */
1015 //--------------------------------------------------------------------------------------------------
1016 LE_SHARED le_avc_BlockRequestRef_t ifgen_le_avc_BlockInstall
1017 (
1018  le_msg_SessionRef_t _ifgen_sessionRef
1019 );
1020 
1021 //--------------------------------------------------------------------------------------------------
1022 /**
1023  * Allow any pending updates to be installed
1024  */
1025 //--------------------------------------------------------------------------------------------------
1026 LE_SHARED void ifgen_le_avc_UnblockInstall
1027 (
1028  le_msg_SessionRef_t _ifgen_sessionRef,
1029  le_avc_BlockRequestRef_t blockRef
1030  ///< [IN] block request ref returned by le_avc_BlockInstall
1031 );
1032 
1033 //--------------------------------------------------------------------------------------------------
1034 /**
1035  * Function to get error code when update fails.
1036  *
1037  * @return
1038  * - Error code of encountered error.
1039  * - ERR_NONE if update is in any other state.
1040  */
1041 //--------------------------------------------------------------------------------------------------
1042 LE_SHARED le_avc_ErrorCode_t ifgen_le_avc_GetErrorCode
1043 (
1044  le_msg_SessionRef_t _ifgen_sessionRef
1045 );
1046 
1047 //--------------------------------------------------------------------------------------------------
1048 /**
1049  * Function to read the current session type, or the last session type if there is no
1050  * active session.
1051  *
1052  * @return
1053  * - SessionType
1054  */
1055 //--------------------------------------------------------------------------------------------------
1056 LE_SHARED le_avc_SessionType_t ifgen_le_avc_GetSessionType
1057 (
1058  le_msg_SessionRef_t _ifgen_sessionRef
1059 );
1060 
1061 //--------------------------------------------------------------------------------------------------
1062 /**
1063  * Function to read the http status of the last download.
1064  *
1065  * @return
1066  * - HttpStatus as defined in RFC 7231, Section 6.
1067  */
1068 //--------------------------------------------------------------------------------------------------
1069 LE_SHARED uint16_t ifgen_le_avc_GetHttpStatus
1070 (
1071  le_msg_SessionRef_t _ifgen_sessionRef
1072 );
1073 
1074 //--------------------------------------------------------------------------------------------------
1075 /**
1076  * Function to read the polling timer.
1077  *
1078  * @return
1079  * - LE_OK on success
1080  * - LE_FAULT if not available
1081  * - LE_OUT_OF_RANGE if the polling timer value is out of range (0 to 525600).
1082  */
1083 //--------------------------------------------------------------------------------------------------
1084 LE_SHARED le_result_t ifgen_le_avc_GetPollingTimer
1085 (
1086  le_msg_SessionRef_t _ifgen_sessionRef,
1087  uint32_t* pollingTimerPtr
1088  ///< [OUT] Polling timer interval, minutes
1089 );
1090 
1091 //--------------------------------------------------------------------------------------------------
1092 /**
1093  * Function to read the retry timers.
1094  *
1095  * @return
1096  * - LE_OK on success.
1097  * - LE_FAULT if not able to read the timers.
1098  * - LE_OUT_OF_RANGE if one of the retry timers is out of range (0 to 20160).
1099  */
1100 //--------------------------------------------------------------------------------------------------
1101 LE_SHARED le_result_t ifgen_le_avc_GetRetryTimers
1102 (
1103  le_msg_SessionRef_t _ifgen_sessionRef,
1104  uint16_t* timerValuePtr,
1105  ///< [OUT] Array of retry timer intervals, minutes.
1106  size_t* timerValueSizePtr
1107  ///< [INOUT]
1108 );
1109 
1110 //--------------------------------------------------------------------------------------------------
1111 /**
1112  * Function to read APN configuration.
1113  *
1114  * @return
1115  * - LE_OK on success.
1116  * - LE_FAULT if there is any error while reading.
1117  * - LE_OVERFLOW if the buffer provided is too small.
1118  */
1119 //--------------------------------------------------------------------------------------------------
1120 LE_SHARED le_result_t ifgen_le_avc_GetApnConfig
1121 (
1122  le_msg_SessionRef_t _ifgen_sessionRef,
1123  char* apnName,
1124  ///< [OUT]
1125  size_t apnNameSize,
1126  ///< [IN]
1127  char* userName,
1128  ///< [OUT]
1129  size_t userNameSize,
1130  ///< [IN]
1131  char* userPwd,
1132  ///< [OUT]
1133  size_t userPwdSize
1134  ///< [IN]
1135 );
1136 
1137 //--------------------------------------------------------------------------------------------------
1138 /**
1139  * Function to write APN configuration.
1140  *
1141  * @return
1142  * - LE_OK on success.
1143  * - LE_OVERFLOW if one of the input strings is too long.
1144  */
1145 //--------------------------------------------------------------------------------------------------
1146 LE_SHARED le_result_t ifgen_le_avc_SetApnConfig
1147 (
1148  le_msg_SessionRef_t _ifgen_sessionRef,
1149  const char* LE_NONNULL apnName,
1150  ///< [IN]
1151  const char* LE_NONNULL userName,
1152  ///< [IN]
1153  const char* LE_NONNULL userPwd
1154  ///< [IN]
1155 );
1156 
1157 //--------------------------------------------------------------------------------------------------
1158 /**
1159  * Function to set the polling timer to a value in minutes.
1160  *
1161  * @return
1162  * - LE_OK on success.
1163  * - LE_OUT_OF_RANGE if the polling timer value is out of range (0 to 525600).
1164  */
1165 //--------------------------------------------------------------------------------------------------
1166 LE_SHARED le_result_t ifgen_le_avc_SetPollingTimer
1167 (
1168  le_msg_SessionRef_t _ifgen_sessionRef,
1169  uint32_t pollingTimer
1170  ///< [IN] Polling timer interval, minutes
1171 );
1172 
1173 //--------------------------------------------------------------------------------------------------
1174 /**
1175  * Function to set the retry timers.
1176  *
1177  * @return
1178  * - LE_OK on success.
1179  * - LE_FAULT if not able to set the timers.
1180  * - LE_OUT_OF_RANGE if one of the retry timers is out of range (0 to 20160).
1181  */
1182 //--------------------------------------------------------------------------------------------------
1183 LE_SHARED le_result_t ifgen_le_avc_SetRetryTimers
1184 (
1185  le_msg_SessionRef_t _ifgen_sessionRef,
1186  const uint16_t* timerValuePtr,
1187  ///< [IN] Array of retry timer intervals, minutes.
1188  size_t timerValueSize
1189  ///< [IN]
1190 );
1191 
1192 //--------------------------------------------------------------------------------------------------
1193 /**
1194  * Function to retrieve status of the credentials provisioned on the device.
1195  *
1196  * @return
1197  * LE_AVC_NO_CREDENTIAL_PROVISIONED
1198  * - If neither Bootstrap nor Device Management credential is provisioned.
1199  * LE_AVC_BS_CREDENTIAL_PROVISIONED
1200  * - If Bootstrap credential is provisioned but Device Management credential is
1201  * not provisioned.
1202  * LE_AVC_DM_CREDENTIAL_PROVISIONED
1203  * - If Device management key is provisioned.
1204  */
1205 //--------------------------------------------------------------------------------------------------
1206 LE_SHARED le_avc_CredentialStatus_t ifgen_le_avc_GetCredentialStatus
1207 (
1208  le_msg_SessionRef_t _ifgen_sessionRef
1209 );
1210 
1211 //--------------------------------------------------------------------------------------------------
1212 /**
1213  * Function to set user agreements for download, install, reboot, connection and uninstall.
1214  *
1215  * @return
1216  * - LE_OK on success.
1217  * - LE_FAULT if failed to configure user agreement.
1218  */
1219 //--------------------------------------------------------------------------------------------------
1220 LE_SHARED le_result_t ifgen_le_avc_SetUserAgreement
1221 (
1222  le_msg_SessionRef_t _ifgen_sessionRef,
1223  le_avc_UserAgreement_t updateStatus,
1224  ///< [IN] Operation for which user agreements has to be set.
1225  bool enable
1226  ///< [IN] true = enable, false = disable.
1227 );
1228 
1229 //--------------------------------------------------------------------------------------------------
1230 /**
1231  * Function to get user agreements for download, install, reboot, connection and uninstall.
1232  *
1233  * @return
1234  * - LE_OK on success.
1235  * - LE_FAULT if failed to read user agreement state.
1236  */
1237 //--------------------------------------------------------------------------------------------------
1238 LE_SHARED le_result_t ifgen_le_avc_GetUserAgreement
1239 (
1240  le_msg_SessionRef_t _ifgen_sessionRef,
1241  le_avc_UserAgreement_t updateStatus,
1242  ///< [IN] Operation for which user agreements has to be read.
1243  bool* enablePtr
1244  ///< [OUT] true = enable, false = disable.
1245 );
1246 
1247 //--------------------------------------------------------------------------------------------------
1248 /**
1249  * Function to read a resource from a LWM2M object
1250  *
1251  * @return
1252  * - LE_OK on success.
1253  * - LE_FAULT if failed.
1254  * - LE_UNSUPPORTED if unsupported.
1255  */
1256 //--------------------------------------------------------------------------------------------------
1257 LE_SHARED le_result_t ifgen_le_avc_ReadLwm2mResource
1258 (
1259  le_msg_SessionRef_t _ifgen_sessionRef,
1260  uint16_t objectId,
1261  ///< [IN] Object identifier
1262  uint16_t objectInstanceId,
1263  ///< [IN] Object instance identifier
1264  uint16_t resourceId,
1265  ///< [IN] Resource identifier
1266  uint16_t resourceInstanceId,
1267  ///< [IN] Resource instance identifier
1268  char* data,
1269  ///< [OUT] String of requested resources to be read
1270  size_t dataSize
1271  ///< [IN]
1272 );
1273 
1274 //--------------------------------------------------------------------------------------------------
1275 /**
1276  * Function to set the NAT timeout
1277  *
1278  * This function sets the NAT timeout in volatile memory.
1279  * When data need to be sent by the client, a check is made between this NAT timeout value and the
1280  * time when last data were received from the server or sent to the server.
1281  * If one of these times is greater than the NAT timeout, a DTLS resume is initiated.
1282  * Default value if this function is not called: 40 seconds.
1283  * Value 0 will deactivate any DTLS resume.
1284  * This function can be called at any time.
1285  */
1286 //--------------------------------------------------------------------------------------------------
1287 LE_SHARED void ifgen_le_avc_SetNatTimeout
1288 (
1289  le_msg_SessionRef_t _ifgen_sessionRef,
1290  uint32_t timeout
1291  ///< [IN] Timeout (unit: seconds)
1292 );
1293 
1294 //--------------------------------------------------------------------------------------------------
1295 /**
1296  * Check whether the session is started for a given Server Id.
1297  *
1298  * @return
1299  * - true if session is started
1300  * - false otherwise
1301  */
1302 //--------------------------------------------------------------------------------------------------
1303 LE_SHARED bool ifgen_le_avc_IsSessionStarted
1304 (
1305  le_msg_SessionRef_t _ifgen_sessionRef,
1306  uint16_t serverId
1307  ///< [IN] Short Server ID
1308 );
1309 /** @} **/
1310 #endif // LE_AVC_COMMON_H_INCLUDE_GUARD
Definition: le_avc_common.h:462
Bootstrap session.
Definition: le_avc_common.h:494
Definition: le_avc_common.h:365
Package is not certified sent by a trusted server.
Definition: le_avc_common.h:386
Download timeout.
Definition: le_avc_common.h:388
#define LE_SHARED
Definition: le_basics.h:287
Download has completed.
Definition: le_avc_common.h:341
No error.
Definition: le_avc_common.h:460
Definition: le_avc_common.h:474
Request by user app to open AV session.
Definition: le_avc_common.h:422
le_avc_ErrorCode_t
Definition: le_avc_common.h:458
Definition: le_avc_common.h:465
le_result_t
Definition: le_basics.h:46
le_avc_CredentialStatus_t
Definition: le_avc_common.h:509
Device Management credential is provisioned.
Definition: le_avc_common.h:517
Definition: le_avc_common.h:373
struct le_avc_CommInfoHandler * le_avc_CommInfoHandlerRef_t
Definition: le_avc_common.h:557
An error occurred installing the update.
Definition: le_avc_common.h:351
Package is certified sent by a trusted server.
Definition: le_avc_common.h:384
Not enough space in flash to store the package.
Definition: le_avc_common.h:480
Update has been successfully installed.
Definition: le_avc_common.h:349
Uninstall in progress.
Definition: le_avc_common.h:355
void(* le_avc_CommInfoHandlerFunc_t)(uint8_t code, const char *LE_NONNULL str, void *contextPtr)
Definition: le_avc_common.h:610
User agreement for connection.
Definition: le_avc_common.h:401
SIM APDU response.
Definition: le_avc_common.h:530
Definition: le_avc_common.h:378
An error occurred downloading the update.
Definition: le_avc_common.h:343
Uninstall is pending.
Definition: le_avc_common.h:353
Device Management session.
Definition: le_avc_common.h:496
Device reboot is pending.
Definition: le_avc_common.h:371
Session type invalid.
Definition: le_avc_common.h:498
Definition: le_avc_common.h:511
struct le_avc_BlockRequest * le_avc_BlockRequestRef_t
Definition: le_avc_common.h:565
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
le_avc_SessionRequest_t
Definition: le_avc_common.h:420
le_avc_SessionType_t
Definition: le_avc_common.h:492
Install in progress.
Definition: le_avc_common.h:347
Definition: le_avc_common.h:514
void(* le_avc_StatusHandlerFunc_t)(le_avc_Status_t updateStatus, int32_t totalNumBytes, int32_t progress, void *contextPtr)
Definition: le_avc_common.h:574
void(* le_avc_SessionRequestHandlerFunc_t)(le_avc_SessionRequest_t request, void *contextPtr)
Definition: le_avc_common.h:597
Definition: le_avc_common.h:471
User agreement for reboot.
Definition: le_avc_common.h:409
le_avc_UpdateType_t
Definition: le_avc_common.h:435
Session with bootstrap server started.
Definition: le_avc_common.h:363
User agreement for install.
Definition: le_avc_common.h:405
Definition: le_avc_common.h:477
le_avc_Status_t
Definition: le_avc_common.h:333
Definition: le_avc_common.h:468
Definition: le_avc_common.h:368
struct le_avc_SessionRequestEventHandler * le_avc_SessionRequestEventHandlerRef_t
Definition: le_avc_common.h:549
Definition: le_avc_common.h:381
le_avc_ConfigType_t
Definition: le_avc_common.h:528
App has been successfully uninstalled.
Definition: le_avc_common.h:357
Update pending download.
Definition: le_avc_common.h:337
Install is pending (implies download complete)
Definition: le_avc_common.h:345
User agreement for uninstall.
Definition: le_avc_common.h:407
Request by user app to close AV session.
Definition: le_avc_common.h:424
struct le_avc_StatusEventHandler * le_avc_StatusEventHandlerRef_t
Definition: le_avc_common.h:541
No updates pending.
Definition: le_avc_common.h:335
Download in progress.
Definition: le_avc_common.h:339
User agreement for download.
Definition: le_avc_common.h:403
An error occurred uninstalling the update.
Definition: le_avc_common.h:359
Session with AirVantage device management server started.
Definition: le_avc_common.h:361
le_avc_UserAgreement_t
Definition: le_avc_common.h:399