Linux LITE MBIM  MBPL_SDK_R25_ENG3
BasicConnectDeviceService.h
Go to the documentation of this file.
1 
11 #ifndef __BASIC_CONNECT_DEVICE_SERVICE_H__
12 #define __BASIC_CONNECT_DEVICE_SERVICE_H__
13 
14 #include <stdint.h>
15 #include <wchar.h>
16 #include "MbimTransport.h"
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
27 const uint8_t* BasicConnectDeviceService_Uuid();
28 
46 typedef struct MbimEventEntry
47 {
48  uint8_t DeviceServiceId[MBIM_UUID_SIZE];
49  uint32_t CidCount;
50  uint32_t Cids[MBIM_MAX_CIDS];
52 
53 
69  const uint8_t** ppDeviceServiceId,
70  uint32_t* pCid,
71  uint32_t* pCommandType,
72  uint8_t* informationBuffer,
73  uint32_t* pInformationBufferLength,
74  uint32_t elementCount,
75  MbimEventEntry* elements);
76 
96  MbimTransaction* pTransaction,
97  MbimTransport* pTransport,
98  uint32_t elementCount,
99  MbimEventEntry* pElements);
100 
108 #define MBIMDataClassNone 0x0
109 
110 #define MBIMDataClassGPRS 0x1
111 
112 #define MBIMDataClassEDGE 0x2
113 
114 #define MBIMDataClassUMTS 0x4
115 
116 #define MBIMDataClassHSDPA 0x8
117 
118 #define MBIMDataClassHSUPA 0x10
119 
120 #define MBIMDataClassLTE 0x20
121 
122 #define MBIMDataClassReservedForFutureGSM 0x8f40
123 
124 #define MBIMDataClass1XRTT 0x10000
125 
126 #define MBIMDataClass1XEVDO 0x20000
127 
128 #define MBIMDataClass1XEVDORevA 0x40000
129 
130 #define MBIMDataClass1XEVDV 0x80000
131 
132 #define MBIMDataClass3XRTT 0x100000
133 
134 #define MBIMDataClass1XEVDORevB 0x200000
135 
136 #define MBIMDataClassUMB 0x400000
137 
138 #define MBIMDataClassReservedForFutureCDMA 0x4f800000
139 
140 #define MBIMDataClassCustom 0x80000000
141 
142 const char* MBIMDataClassToString(uint32_t flag);
143 
151 #define MBIMCellularClassGsm 0x1
152 
153 #define MBIMCellularClassCdma 0x2
154 
155 const char* MBIMCellularClassToString(uint32_t flag);
156 
174  uint8_t* informationBuffer,
175  uint32_t informationBufferLength,
176  uint32_t* pElementCount, // in = max number of elements which will be filled, out = number of elements filled by response
177  MbimEventEntry* pElements);
178 
179 typedef enum
180 {
201 
202 const char* MBIMSubscriberReadyStateToString(MBIM_SUBSCRIBER_READY_STATE value);
203 
204 typedef enum
205 {
215 
216 const char* MBIMReadyInfoFlagsToString(MBIM_UNIQUE_ID_FLAGS value);
217 
219 #define MBIM_TELEPHONE_NUMBER_MAX_LEN 22
220 
228 typedef struct
229 {
230  wchar_t value[MBIM_TELEPHONE_NUMBER_MAX_LEN + 1];
232 
244  const uint8_t** ppDeviceServiceId,
245  uint32_t* pCid,
246  uint32_t* pCommandType);
247 
248 /*
249  * Parse a MBIM_CID_SUBSCRIBER_READY_STATUS response.
250  *
251  * @param[in] informationBuffer Response's information data.
252  * @param[in] informationBufferLength Number of bytes of information in response.
253  * @param[out] pReadyState Ready state will be written here.
254  * @param[in,out] pSubscriberIdLen If caller sets *pSubscriberIdLen = 0, on return it will be set to number of wchar_t's
255  * in subscriber Id (excluding NULL-terminator), without returning the pSubscriberId (pSubscriberId may be NULL).
256  * If caller sets *pSubscriberIdLen > 0, function will return the minimum of this value
257  * and the number of wchar_t's available (pSubscriberId must not be NULL). Make sure
258  * pSubscriberId points to buffer of size *pSubscriberIdLen+1 (for NULL-terminator which will be appended).
259  * This allows caller to optionally determine storage required in first call and
260  * retrieve actual data in second call.
261  * @param[out] pSubscriberId SubscriberId.
262  * @param[in,out] pSimIccidLen If caller sets *pSimIccidLen = 0, on return it will be set to number of wchar_t's
263  * in SIM ICCID (excluding NULL-terminator), without returning the pSimIccid (pSimIccid may be NULL).
264  * If caller sets *pSimIccidLen > 0, function will return the minimum of this value
265  * and the number of wchar_t's available (pSimIccid must not be NULL). Make sure
266  * pSimIccid points to buffer of size *pSimIccidLen+1 (for NULL-terminator which will be appended).
267  * This allows caller to optionally determine storage required in first call and
268  * retrieve actual data in second call.
269  * @param[out] pSimIccid SIM ICCID
270  * @param[out] pReadyInfo Ready state info flags.
271  * @param[in,out] pTelephoneNumberCount If caller sets *pTelephoneNumberCount = 0, on return it will be set to number of elements
272  * available, without returning any (pTelephoneNumbers may be NULL).
273  * If caller sets *pTelephoneNumberCount > 0, function will return the minimum of this value
274  * and the number of elements available (pTelephoneNumbers must not be NULL).
275  * This allows caller to optionally determine storage required in first call and
276  * retrieve actual data in second call.
277  * @param[out] pTelephoneNumbers Array of elements to be written to by parsing response.
278  *
279  * @return MBIM_STATUS_SUCCESS on success,
280  * MBIM_STATUS_CUSTOM_PARSE_FAILURE on invalid parameters, or memory issues.
281  */
282 uint32_t BasicConnectDeviceService_SubscriberReadyStatusParse(
283  uint8_t* informationBuffer,
284  uint32_t informationBufferLength,
285  MBIM_SUBSCRIBER_READY_STATE* pReadyState,
286  uint32_t* pSubscriberIdLen,
287  wchar_t* pSubscriberId,
288  uint32_t* pSimIccIdLen,
289  wchar_t* pSimIccId,
290  MBIM_UNIQUE_ID_FLAGS* pReadyInfo,
291  MbimTelephoneNumber* pTelephoneNumbers,
292  uint32_t* pTelephoneNumberCount // in = max number of elements which will be filled, out = number of elements filled by response
293  );
294 
295 
296 typedef enum
297 {
303 
304 const char* MBIMPacketServiceActionToString(MBIM_PACKET_SERVICE_ACTION value);
305 
306 typedef enum
307 {
319 
320 const char* MBIMPacketServiceStateToString(MBIM_PACKET_SERVICE_STATE value);
321 
336  const uint8_t** ppDeviceServiceId,
337  uint32_t* pCid,
338  uint32_t* pCommandType,
339  uint8_t* informationBuffer,
340  uint32_t* pInformationBufferLength, // in = information buffer capacity, out = bytes used
341  MBIM_PACKET_SERVICE_ACTION packetServiceAction);
342 
354  const uint8_t** ppDeviceServiceId,
355  uint32_t* pCid,
356  uint32_t* pCommandType);
357 
358 /*
359  * Parse a MBIM_CID_PACKET_SERVICE response.
360  *
361  * @param[in] informationBuffer Response's information data.
362  * @param[in] informationBufferLength Number of bytes of information in response.
363  * @param[out] pNwError Network error.
364  * @param[out] pPacketServiceState Packet service state.
365  * @param[out] pHighestAvailableDataClass One of the MBIM_DATA_CLASS constants.
366  * @param[out] pUplinkSpeed Uplink speed.
367  * @param[out] pDownlinkSpeed Downlink speed.
368  *
369  * @return MBIM_STATUS_SUCCESS on success,
370  * MBIM_STATUS_CUSTOM_PARSE_FAILURE on invalid parameters, or memory issues.
371  */
372 uint32_t BasicConnectDeviceService_PacketServiceParse(
373  uint8_t* informationBuffer,
374  uint32_t informationBufferLength,
375  uint32_t* pNwError,
376  MBIM_PACKET_SERVICE_STATE* pPacketServiceState,
377  uint32_t* pHighestAvailableDataClass, //(MBIM_DATA_CLASS)
378  uint64_t* pUplinkSpeed,
379  uint64_t* pDownlinkSpeed);
380 
381 
382 typedef enum
383 {
389 
390 const char* MBIMRegisterActionToString(MBIM_REGISTER_ACTION value);
391 
392 typedef enum
393 {
409 
410 const char* MBIMRegisterStateToString(MBIM_REGISTER_STATE value);
411 
412 typedef enum
413 {
421 
422 const char* MBIMRegisterModeToString(MBIM_REGISTER_MODE value);
423 
431 #define MBIM_REGISTRATION_NONE 0x0
432 
433 #define MBIM_REGISTRATION_MANUAL_SELECTION_NOT_AVAILABLE 0x1
434 
435 #define MBIM_REGISTRATION_PACKET_SERVICE_AUTOMATIC_ATTACH 0x2
436 
437 const char* MBIMRegistrationFlagToString(uint32_t flag);
438 
455  const uint8_t** ppDeviceServiceId,
456  uint32_t* pCid,
457  uint32_t* pCommandType,
458  uint8_t* informationBuffer,
459  uint32_t* pInformationBufferLength, // in = information buffer capacity, out = bytes used
460  wchar_t* providerId,
461  MBIM_REGISTER_ACTION registerAction,
462  uint32_t dataClass);
463 
475  const uint8_t** ppDeviceServiceId,
476  uint32_t* pCid,
477  uint32_t* pCommandType);
478 
479 /*
480  * Parse a MBIM_CID_REGISTER_STATE response.
481  *
482  * @param[in] informationBuffer Response's information data.
483  * @param[in] informationBufferLength Number of bytes of information in response.
484  * @param[out] pNwError Network error be written here.
485  * @param[out] pRegisterState Register state.
486  * @param[out] pRegisterMode Register mode.
487  * @param[out] pAvailableDataClasses Bitmap of MBIM_DATA_CLASS flags will be returned here.
488  * @param[out] pCurrentCellularClass Bitmap MBIM_CELLULAR_CLASS flags will be returned here.
489  * @param[in,out] pProviderIdLen If caller sets *pProviderIdLen = 0, on return it will be set to number of wchar_t's
490  * in provider Id (excluding NULL-terminator), without returning the pProviderId (pProviderId may be NULL).
491  * If caller sets *pProviderIdLen > 0, function will return the minimum of this value
492  * and the number of wchar_t's available (pProviderId must not be NULL). Make sure
493  * pProviderId points to buffer of size *pProviderIdLen+1 (for NULL-terminator which will be appended).
494  * This allows caller to optionally determine storage required in first call and
495  * retrieve actual data in second call.
496  * @param[out] pProviderId Buffer to receive provider ID.
497  * @param[in,out] pProviderIdLen If caller sets *pProviderNameLen = 0, on return it will be set to number of wchar_t's
498  * in provider name (excluding NULL-terminator), without returning the pProviderName (pProviderName may be NULL).
499  * If caller sets *pProviderNameLen > 0, function will return the minimum of this value
500  * and the number of wchar_t's available (pProviderName must not be NULL). Make sure
501  * pProviderName points to buffer of size *pProviderNameLen+1 (for NULL-terminator which will be appended).
502  * This allows caller to optionally determine storage required in first call and
503  * retrieve actual data in second call.
504  * @param[out] pProviderName Buffer to receive provider name.
505  * @param[in,out] pRoamingTextLen If caller sets *pRoamingTextLen = 0, on return it will be set to number of wchar_t's
506  * in provider name (excluding NULL-terminator), without returning the pRoamingText (pRoamingText may be NULL).
507  * If caller sets *pRoamingTextLen > 0, function will return the minimum of this value
508  * and the number of wchar_t's available (pRoamingText must not be NULL). Make sure
509  * pRoamingText points to buffer of size *pRoamingTextLen+1 (for NULL-terminator which will be appended).
510  * This allows caller to optionally determine storage required in first call and
511  * retrieve actual data in second call.
512  * @param[out] pRoamingText Buffer to receive provider name.
513  *
514  * @param[out] pRegistrationFlag A bitmap of MBIM_REGISTRATION_FLAGS will be returned.
515  *
516  * @return MBIM_STATUS_SUCCESS on success,
517  * MBIM_STATUS_CUSTOM_PARSE_FAILURE on invalid parameters, or memory issues.
518  */
519 uint32_t BasicConnectDeviceService_RegisterStateParse(
520  uint8_t* informationBuffer,
521  uint32_t informationBufferLength,
522  uint32_t* pNwError,
523  MBIM_REGISTER_STATE* pRegisterState,
524  MBIM_REGISTER_MODE* pRegisterMode,
525  uint32_t* pAvailableDataClasses,
526  uint32_t* pCurrentCellularClass,
527  uint32_t* pProviderIdLen,
528  wchar_t* pProviderId,
529  uint32_t* pProviderNameLen,
530  wchar_t* pProviderName,
531  uint32_t* pRoamingTextLen,
532  wchar_t* pRoamingText,
533  uint32_t* pRegistrationFlag
534  );
535 
537 #define MBIM_ACCESS_STRING_MAX_LEN 100
538 
540 #define MBIM_USER_NAME_MAX_LEN 255
541 
543 #define MBIM_PASSWORD_MAX_LEN 255
544 
545 typedef enum
546 {
547  MBIMActivationCommandDeactivate = 0,
548  MBIMActivationCommandActivate = 1,
549 } MBIM_ACTIVATION_COMMAND;
550 
551 const char* MBIMActivationCommandToString(MBIM_ACTIVATION_COMMAND value);
552 
553 typedef enum
554 {
555  MBIMCompressionNone = 0,
556  MBIMCompressionEnable = 1,
557 } MBIM_COMPRESSION;
558 
559 const char* MBIMCompressionToString(MBIM_COMPRESSION value);
560 
561 typedef enum
562 {
563  MBIMAuthProtocolNone = 0,
564  MBIMAuthProtocolPap = 1,
565  MBIMAuthProtocolChap = 2,
566  MBIMAuthProtocolMsChapV2 = 3,
567 } MBIM_AUTH_PROTOCOL;
568 
569 const char* MBIMAuthProtocolToString(MBIM_AUTH_PROTOCOL value);
570 
571 typedef enum
572 {
573  MBIMContextIPTypeDefault = 0,
574  MBIMContextIPTypeIPv4 = 1,
575  MBIMContextIPTypeIPv6 = 2,
576  MBIMContextIPTypeIPv4v6 = 3,
577  MBIMContextIPTypeIPv4AndIPv6 = 4,
578 } MBIM_CONTEXT_IP_TYPE;
579 
580 const char* MBIMContextIPTypeToString(MBIM_CONTEXT_IP_TYPE value);
581 
582 typedef enum
583 {
584  MBIMActivationStateUnknown = 0,
585  MBIMActivationStateActivated = 1,
586  MBIMActivationStateActivating = 2,
587  MBIMActivationStateDeactivated = 3,
588  MBIMActivationStateDeactivating = 4,
589 } MBIM_ACTIVATION_STATE;
590 
591 const char* MBIMActivationStateToString(MBIM_ACTIVATION_STATE value);
592 
593 typedef enum
594 {
595  MBIMVoiceCallStateNone = 0,
596  MBIMVoiceCallStateInProgress = 1,
597  MBIMVoiceCallStateHangUp = 2,
598 } MBIM_VOICE_CALL_STATE;
599 
600 const char* MBIMVoiceCallStateToString(MBIM_VOICE_CALL_STATE value);
601 
610 #define MBIMContextTypeNone { \
611  0xb4, 0x3f, 0x75, 0x8c, 0xa5, 0x60, 0x4b, 0x46, \
612  0xb3, 0x5e, 0xc5, 0x86, 0x96, 0x41, 0xfb, 0x54 \
613 }
614 
619 #define MBIMContextTypeInternet { \
620  0x7e, 0x5e, 0x2a, 0x7e, 0x4e, 0x6f, 0x72, 0x72, \
621  0x73, 0x6b, 0x65, 0x6e, 0x7e, 0x5e, 0x2a, 0x7e \
622 }
623 
629 #define MBIMContextTypeVpn { \
630  0x9b, 0x9f, 0x7b, 0xbe, 0x89, 0x52, 0x44, 0xb7, \
631  0x83, 0xac, 0xca, 0x41, 0x31, 0x8d, 0xf7, 0xa0 \
632 }
633 
638 #define MBIMContextTypeVoice { \
639  0x88, 0x91, 0x82, 0x94, 0x0e, 0xf4, 0x43, 0x96, \
640  0x8c, 0xca, 0xa8, 0x58, 0x8f, 0xbc, 0x02, 0xb2 \
641 }
642 
647 #define MBIMContextTypeVideoShare { \
648  0x05, 0xa2, 0xa7, 0x16, 0x7c, 0x34, 0x4b, 0x4d, \
649  0x9a, 0x91, 0xc5, 0xef, 0x0c, 0x7a, 0xaa, 0xcc \
650 }
651 
656 #define MBIMContextTypePurchase { \
657  0xb3, 0x27, 0x24, 0x96, 0xac, 0x6c, 0x42, 0x2b, \
658  0xa8, 0xc0, 0xac, 0xf6, 0x87, 0xa2, 0x72, 0x17 \
659 }
660 
664 #define MBIMContextTypeIMS { \
665  0x21, 0x61, 0x0d, 0x01, 0x30, 0x74, 0x4b, 0xce, \
666  0x94, 0x25, 0xb5, 0x3a, 0x07, 0xd6, 0x97, 0xd6 \
667 }
668 
672 #define MBIMContextTypeMMS { \
673  0x46, 0x72, 0x66, 0x64, 0x72, 0x69, 0x6b, 0xc6, \
674  0x96, 0x24, 0xd1, 0xd3, 0x53, 0x89, 0xac, 0xa9 \
675 }
676 
683 #define MBIMContextTypeLocal { \
684  0xa5, 0x7a, 0x9a, 0xfc, 0xb0, 0x9f, 0x45, 0xd7, \
685  0xbb, 0x40, 0x03, 0x3c, 0x39, 0xf6, 0x0d, 0xb9 \
686 }
687 
688 const char* MBIMContextTypeToString(uint8_t* value);
689 
712  const uint8_t** ppDeviceServiceId,
713  uint32_t* pCid,
714  uint32_t* pCommandType,
715  uint8_t* informationBuffer,
716  uint32_t* pInformationBufferLength, // in = information buffer capacity, out = bytes used
717  uint32_t sessionId,
718  MBIM_ACTIVATION_COMMAND activationCommand,
719  wchar_t* accessString,
720  wchar_t* userName,
721  wchar_t* password,
722  MBIM_COMPRESSION compression,
723  MBIM_AUTH_PROTOCOL authProtocol,
724  MBIM_CONTEXT_IP_TYPE ipType,
725  uint8_t* contextType
726  );
727 
742  const uint8_t** ppDeviceServiceId,
743  uint32_t* pCid,
744  uint32_t* pCommandType,
745  uint8_t* informationBuffer,
746  uint32_t* pInformationBufferLength, // in = information buffer capacity, out = bytes used
747  uint32_t sessionId
748  );
749 
750 /*
751  * Parse a MBIM_CID_CONNECT response.
752  *
753  * @param[in] informationBuffer Response's information data.
754  * @param[in] informationBufferLength Number of bytes of information in response.
755  * @param[out] pSessionId Session ID will be written here.
756  * @param[out] pActivationState Activation state will be returned here.
757  * @param[out] pVoiceCallState Voice call state will be returned here.
758  * @param[out] pIPType IP type will be returned here.
759  * @param[out] pContextType Context, one of MBIM_CONTEXT_TYPES will be written here.
760  * Must point to a buffer of MBIM_UUID_SIZE bytes.
761  * @param[out] pNwError Network error be written here.
762  *
763  * @return MBIM_STATUS_SUCCESS on success,
764  * MBIM_STATUS_CUSTOM_PARSE_FAILURE on invalid parameters, or memory issues.
765  */
766 uint32_t BasicConnectDeviceService_ConnectParse(
767  uint8_t* informationBuffer,
768  uint32_t informationBufferLength,
769  uint32_t* pSessionId,
770  MBIM_ACTIVATION_STATE* pActivationState,
771  MBIM_VOICE_CALL_STATE* pVoiceCallState,
772  MBIM_CONTEXT_IP_TYPE* pIPType,
773  uint8_t* pContextType,
774  uint32_t* pNwError);
775 
776 #define MBIM_IPV4_ADDRESS_SIZE 4
777 
785 typedef struct
786 {
787  uint8_t value[MBIM_IPV4_ADDRESS_SIZE];
789 
799 typedef struct
800 {
801  uint32_t OnLinkPrefixLength;
802  MBIM_IPV4_ADDRESS Address;
804 
805 #define MBIM_IPV6_ADDRESS_SIZE 16
806 
814 typedef struct
815 {
816  uint8_t value[MBIM_IPV6_ADDRESS_SIZE];
818 
828 typedef struct
829 {
830  uint32_t OnLinkPrefixLength;
831  MBIM_IPV6_ADDRESS Address;
833 
840 #define MBIM_IPV4_CONFIGURATION_AVAILABLE_ADDRESS 0x1
841 
842 #define MBIM_IPV4_CONFIGURATION_AVAILABLE_GATEWAY 0x2
843 
844 #define MBIM_IPV4_CONFIGURATION_AVAILABLE_DNS 0x4
845 
846 #define MBIM_IPV4_CONFIGURATION_AVAILABLE_MTU 0x8
847 
854 #define MBIM_IPV6_CONFIGURATION_AVAILABLE_ADDRESS 0x1
855 
856 #define MBIM_IPV6_CONFIGURATION_AVAILABLE_GATEWAY 0x2
857 
858 #define MBIM_IPV6_CONFIGURATION_AVAILABLE_DNS 0x4
859 
860 #define MBIM_IPV6_CONFIGURATION_AVAILABLE_MTU 0x8
861 
862 
877  const uint8_t** ppDeviceServiceId,
878  uint32_t* pCid,
879  uint32_t* pCommandType,
880  uint8_t* informationBuffer,
881  uint32_t* pInformationBufferLength, // in = information buffer capacity, out = bytes used
882  uint32_t sessionId
883  );
884 
885 /*
886  * Parse a MBIM_CID_IP_CONFIGURATION response.
887  *
888  * @param[in] informationBuffer Response's information data.
889  * @param[in] informationBufferLength Number of bytes of information in response.
890  * @param[out] pSession Session ID be written here.
891  * @param[out] pIPv4ConfigurationAvailable Bitmask of MBIM_IPV4_CONFIGURATION_AVAILABLE_FLAGS will be returned here.
892  * @param[out] pIPv6ConfigurationAvailable Bitmask of MBIM_IPV6_CONFIGURATION_AVAILABLE_FLAGS will be returned here.
893  * @param[in,out] pIPv4AddressCount If caller sets *pIPv4AddressCount = 0, on return it will be set to number of elements
894  * available, without returning any (pIPv4Addresses may be NULL).
895  * If caller sets *pIPv4AddressCount > 0, function will return the minimum of this value
896  * and the number of elements available (pIPv4Addresses must not be NULL).
897  * This allows caller to optionally determine storage required in first call and
898  * retrieve actual data in second call.
899  * @param[out] pIPv4Addresses Array of IPv4 addresses to be written to by parsing response.
900  * @param[in,out] pIPv6AddressCount If caller sets *pIPv6AddressCount = 0, on return it will be set to number of elements
901  * available, without returning any (pIPv6Addresses may be NULL).
902  * If caller sets *pIPv6AddressCount > 0, function will return the minimum of this value
903  * and the number of elements available (pIPv6Addresses must not be NULL).
904  * This allows caller to optionally determine storage required in first call and
905  * retrieve actual data in second call.
906  * @param[out] pIPv6Addresses Array of IPv6 addresses to be written to by parsing response.
907  * @param[out] pIPv4Gateway Must Must not be NULL. IPv4 gateway if available, will be written here.
908  * @param[out] pIPv6Gateway Must Must not be NULL. IPv6 gateway if available, will be written here.
909  * @param[in,out] pIPv4DnsServerCount If caller sets *pIPv4DnsServerCount = 0, on return it will be set to number of elements
910  * available, without returning any (pIPv4DnsServers may be NULL).
911  * If caller sets *pIPv4DnsServerCount > 0, function will return the minimum of this value
912  * and the number of elements available (pIPv4DnsServers must not be NULL).
913  * This allows caller to optionally determine storage required in first call and
914  * retrieve actual data in second call.
915  * @param[out] pIPv4DnsServers Array of IPv4 DNS servers to be written to by parsing response.
916  * @param[in,out] pIPv6DnsServerCount If caller sets *pIPv6DnsServerCount = 0, on return it will be set to number of elements
917  * available, without returning any (pIPv6DnsServers may be NULL).
918  * If caller sets *pIPv6DnsServerCount > 0, function will return the minimum of this value
919  * and the number of elements available (pIPv6DnsServers must not be NULL).
920  * This allows caller to optionally determine storage required in first call and
921  * retrieve actual data in second call.
922  * @param[out] pIPv6DnsServers Array of IPv6 DNS servers to be written to by parsing response.
923  * @param[out] pIPv4Mtu IPv4 MTU will be written here if available.
924  * @param[out] pIPv6Mtu IPv6 MTU will be written here if available.
925  *
926  * @return MBIM_STATUS_SUCCESS on success,
927  * MBIM_STATUS_CUSTOM_PARSE_FAILURE on invalid parameters, or memory issues.
928  */
929 uint32_t BasicConnectDeviceService_IpConfigurationParse(
930  uint8_t* informationBuffer,
931  uint32_t informationBufferLength,
932  uint32_t* pSessionId,
933  uint32_t* pIPv4ConfigurationAvailable,
934  uint32_t* pIPv6ConfigurationAvailable,
935  uint32_t* pIPv4AddressCount,
936  MBIM_IPV4_ELEMENT* pIPv4Addresses,
937  uint32_t* pIPv6AddressCount,
938  MBIM_IPV6_ELEMENT* pIPv6Addresses,
939  MBIM_IPV4_ADDRESS* pIPv4Gateway,
940  MBIM_IPV6_ADDRESS* pIPv6Gateway,
941  uint32_t* pIPv4DnsServerCount,
942  MBIM_IPV4_ADDRESS* pIPv4DnsServers,
943  uint32_t* pIPv6DnsServerCount,
944  MBIM_IPV6_ADDRESS* pIPv6DnsServers,
945  uint32_t* pIPv4Mtu,
946  uint32_t* pIPv6Mtu);
947 
948 
949 typedef enum
950 {
990 } MBIM_PIN_TYPE;
991 
992 const char* MBIMPinTypeToString(MBIM_PIN_TYPE value);
993 
994 typedef enum
995 {
1000 } MBIM_PIN_STATE;
1001 
1002 const char* MBIMPinStateToString(MBIM_PIN_STATE value);
1003 
1004 typedef enum
1005 {
1015 
1016 const char* MBIMPinOperationToString(MBIM_PIN_OPERATION value);
1017 
1035  const uint8_t** ppDeviceServiceId,
1036  uint32_t* pCid,
1037  uint32_t* pCommandType,
1038  uint8_t* informationBuffer,
1039  uint32_t* pInformationBufferLength, // in = information buffer capacity, out = bytes used
1040  MBIM_PIN_TYPE pinType,
1041  MBIM_PIN_OPERATION pinOperation,
1042  wchar_t* pPin,
1043  wchar_t* pNewPin);
1044 
1056  const uint8_t** ppDeviceServiceId,
1057  uint32_t* pCid,
1058  uint32_t* pCommandType);
1059 
1060 /*
1061  * Parse a MBIM_CID_PIN response.
1062  *
1063  * @param[in] informationBuffer Response's information data.
1064  * @param[in] informationBufferLength Number of bytes of information in response.
1065  * @param[out] pPinType Current PIN type will be written here.
1066  * @param[out] pPinState Current PIN state will be written here.
1067  * @param[out] pRemainingAttempts Remaining attempts to enter PIN info wil be written here.
1068  *
1069  * @return MBIM_STATUS_SUCCESS on success,
1070  * MBIM_STATUS_CUSTOM_PARSE_FAILURE on invalid parameters, or memory issues.
1071  */
1072 uint32_t BasicConnectDeviceService_PinParse(
1073  uint8_t* informationBuffer,
1074  uint32_t informationBufferLength,
1075  MBIM_PIN_TYPE* pPinType,
1076  MBIM_PIN_STATE* pPinState,
1077  uint32_t* pRemainingAttempts);
1078 
1079 typedef enum
1080 {
1086 
1087 const char* MBIMRadioToString(MBIM_RADIO_SWITCH_STATE value);
1088 
1103  const uint8_t** ppDeviceServiceId,
1104  uint32_t* pCid,
1105  uint32_t* pCommandType,
1106  uint8_t* informationBuffer,
1107  uint32_t* pInformationBufferLength, // in = information buffer capacity, out = bytes used
1108  MBIM_RADIO_SWITCH_STATE radioState);
1109 
1121  const uint8_t** ppDeviceServiceId,
1122  uint32_t* pCid,
1123  uint32_t* pCommandType);
1124 
1125 /*
1126  * Parse a MBIM_CID_RADIO_STATE.
1127  *
1128  * @param[in] informationBuffer Response's information data.
1129  * @param[in] informationBufferLength Number of bytes of information in response.
1130  * @param[out] pHwRadioState Current hardware radio state will be written here.
1131  * @param[out] pSwRadioState Current software radio state will be written here.
1132  * @param[out] pRemainingAttempts Remaining attempts to enter PIN info wil be written here.
1133  *
1134  * @return MBIM_STATUS_SUCCESS on success,
1135  * MBIM_STATUS_CUSTOM_PARSE_FAILURE on invalid parameters, or memory issues.
1136  */
1137 uint32_t BasicConnectDeviceService_RadioStateParse(
1138  uint8_t* informationBuffer,
1139  uint32_t informationBufferLength,
1140  MBIM_RADIO_SWITCH_STATE* pHwRadioState,
1141  MBIM_RADIO_SWITCH_STATE* pSwRadioState);
1142 
1143 
1144 
1145 #ifdef __cplusplus
1146 } /* extern "C" { */
1147 #endif
1148 
1149 #endif //__BASIC_CONNECT_DEVICE_SERVICE_H__
Definition: BasicConnectDeviceService.h:213
Definition: BasicConnectDeviceService.h:415
Definition: BasicConnectDeviceService.h:1084
Definition: BasicConnectDeviceService.h:309
Definition: BasicConnectDeviceService.h:228
uint32_t BasicConnectDeviceService_IpConfigurationQueryBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType, uint8_t *informationBuffer, uint32_t *pInformationBufferLength, uint32_t sessionId)
Definition: BasicConnectDeviceService.h:299
MBIM_RADIO_SWITCH_STATE
Definition: BasicConnectDeviceService.h:1079
Definition: BasicConnectDeviceService.h:973
Definition: BasicConnectDeviceService.h:399
#define MBIM_UUID_SIZE
Definition: MbimTransport.h:20
Definition: BasicConnectDeviceService.h:999
Definition: BasicConnectDeviceService.h:301
Definition: BasicConnectDeviceService.h:407
Definition: BasicConnectDeviceService.h:193
const uint8_t * BasicConnectDeviceService_Uuid()
Definition: BasicConnectDeviceService.h:403
Definition: BasicConnectDeviceService.h:965
Definition: BasicConnectDeviceService.h:207
Definition: BasicConnectDeviceService.h:195
uint32_t BasicConnectDeviceService_PinSetBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType, uint8_t *informationBuffer, uint32_t *pInformationBufferLength, MBIM_PIN_TYPE pinType, MBIM_PIN_OPERATION pinOperation, wchar_t *pPin, wchar_t *pNewPin)
uint32_t BasicConnectDeviceService_RadioStateQueryBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType)
Definition: BasicConnectDeviceService.h:981
Definition: BasicConnectDeviceService.h:1082
Definition: BasicConnectDeviceService.h:387
Definition: BasicConnectDeviceService.h:963
MBIM_PACKET_SERVICE_ACTION
Definition: BasicConnectDeviceService.h:296
Definition: BasicConnectDeviceService.h:969
Definition: BasicConnectDeviceService.h:977
Definition: BasicConnectDeviceService.h:1013
Definition: BasicConnectDeviceService.h:313
Definition: MbimTransport.h:136
Definition: BasicConnectDeviceService.h:385
Definition: BasicConnectDeviceService.h:417
Definition: BasicConnectDeviceService.h:317
Definition: BasicConnectDeviceService.h:182
Definition: BasicConnectDeviceService.h:1009
Definition: BasicConnectDeviceService.h:959
uint32_t BasicConnectDeviceService_RegisterStateQueryBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType)
Definition: BasicConnectDeviceService.h:987
#define MBIM_TELEPHONE_NUMBER_MAX_LEN
Definition: BasicConnectDeviceService.h:219
Definition: BasicConnectDeviceService.h:989
uint32_t BasicConnectDeviceService_DeviceServiceSubscribeParse(uint8_t *informationBuffer, uint32_t informationBufferLength, uint32_t *pElementCount, MbimEventEntry *pElements)
uint32_t BasicConnect_DeviceService_PacketServiceSetBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType, uint8_t *informationBuffer, uint32_t *pInformationBufferLength, MBIM_PACKET_SERVICE_ACTION packetServiceAction)
Definition: MbimTransaction.h:72
MBIM_REGISTER_ACTION
Definition: BasicConnectDeviceService.h:382
Definition: BasicConnectDeviceService.h:957
Definition: BasicConnectDeviceService.h:189
MBIM_UNIQUE_ID_FLAGS
Definition: BasicConnectDeviceService.h:204
uint32_t BasicConnectDeviceService_RegisterStateSetBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType, uint8_t *informationBuffer, uint32_t *pInformationBufferLength, wchar_t *providerId, MBIM_REGISTER_ACTION registerAction, uint32_t dataClass)
Definition: BasicConnectDeviceService.h:1011
uint32_t BasicConnectDeviceService_ConnectSetBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType, uint8_t *informationBuffer, uint32_t *pInformationBufferLength, uint32_t sessionId, MBIM_ACTIVATION_COMMAND activationCommand, wchar_t *accessString, wchar_t *userName, wchar_t *password, MBIM_COMPRESSION compression, MBIM_AUTH_PROTOCOL authProtocol, MBIM_CONTEXT_IP_TYPE ipType, uint8_t *contextType)
Definition: BasicConnectDeviceService.h:1007
Definition: BasicConnectDeviceService.h:997
Definition: BasicConnectDeviceService.h:975
Definition: BasicConnectDeviceService.h:46
Definition: BasicConnectDeviceService.h:967
Definition: BasicConnectDeviceService.h:952
Definition: BasicConnectDeviceService.h:419
uint32_t BasicConnectDeviceService_RadioStateSetBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType, uint8_t *informationBuffer, uint32_t *pInformationBufferLength, MBIM_RADIO_SWITCH_STATE radioState)
uint32_t BasicConnectDeviceService_PacketServiceQueryBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType)
Definition: BasicConnectDeviceService.h:983
Definition: BasicConnectDeviceService.h:799
Definition: BasicConnectDeviceService.h:395
Definition: BasicConnectDeviceService.h:199
Definition: BasicConnectDeviceService.h:814
Definition: BasicConnectDeviceService.h:828
Definition: BasicConnectDeviceService.h:785
Definition: BasicConnectDeviceService.h:311
Definition: BasicConnectDeviceService.h:405
Definition: BasicConnectDeviceService.h:401
#define MBIM_MAX_CIDS
Definition: MbimTransport.h:22
uint32_t BasicConnectDeviceService_ConnectQueryBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType, uint8_t *informationBuffer, uint32_t *pInformationBufferLength, uint32_t sessionId)
uint32_t BasicConnectDeviceService_DeviceServiceSubscribeSetBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType, uint8_t *informationBuffer, uint32_t *pInformationBufferLength, uint32_t elementCount, MbimEventEntry *elements)
MBIM_PIN_TYPE
Definition: BasicConnectDeviceService.h:949
Definition: BasicConnectDeviceService.h:191
MBIM_REGISTER_STATE
Definition: BasicConnectDeviceService.h:392
Definition: BasicConnectDeviceService.h:397
MBIM_SUBSCRIBER_READY_STATE
Definition: BasicConnectDeviceService.h:179
struct MbimEventEntry MbimEventEntry
Definition: BasicConnectDeviceService.h:971
Definition: BasicConnectDeviceService.h:197
Definition: BasicConnectDeviceService.h:961
Definition: BasicConnectDeviceService.h:979
int BasicConnectDeviceService_DeviceServiceSubscribeSetSend(MbimTransaction *pTransaction, MbimTransport *pTransport, uint32_t elementCount, MbimEventEntry *pElements)
uint32_t BasicConnectDeviceService_PinQueryBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType)
Definition: BasicConnectDeviceService.h:315
MBIM_PIN_STATE
Definition: BasicConnectDeviceService.h:994
Definition: BasicConnectDeviceService.h:985
uint32_t BasicConnectDeviceService_SubscriberReadyStatusQueryBuild(const uint8_t **ppDeviceServiceId, uint32_t *pCid, uint32_t *pCommandType)
MBIM_PIN_OPERATION
Definition: BasicConnectDeviceService.h:1004
MBIM_REGISTER_MODE
Definition: BasicConnectDeviceService.h:412
MBIM_PACKET_SERVICE_STATE
Definition: BasicConnectDeviceService.h:306

Copyright (c) 2011-2020 Sierra Wireless, Inc. All rights reserved