huawei_modem/
error_codes.rs

1//! Typed representations of modem error codes.
2#![allow(missing_docs)]
3/// A CMS (SMS-related) error code.
4///
5/// I can't be bothered to write out all the error code meanings twice. If you hit the `[src]`
6/// button in rustdoc, it'll take you to the definition of this `enum`, where the meanings of each
7/// variant are annotated with `#[fail(display)]` attributes.
8///
9/// Obviously, this means that this `enum` has a rather useful `Display` implementation.
10#[derive(FromPrimitive, Fail, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
11pub enum CmsError {
12    #[fail(display = "Unassigned (unallocated) number")]
13    UnassignedNumber = 1,
14    #[fail(display = "Operatior determined barring")]
15    OperatorDeterminedBarring = 8,
16    #[fail(display = "Call barred")]
17    CallBarred = 10,
18    #[fail(display = "Short message transfer rejected")]
19    TransferRejected = 21,
20    #[fail(display = "Destination out of service")]
21    DestinationOutOfService = 27,
22    #[fail(display = "Unidentified subscriber")]
23    UnidentifiedSubscriber = 28,
24    #[fail(display = "Facility rejected")]
25    FacilityRejected = 29,
26    #[fail(display = "Unknown subscriber")]
27    UnknownSubscriber = 30,
28    #[fail(display = "Network out of order")]
29    NetworkOutOfOrder = 38,
30    #[fail(display = "Temporary failure")]
31    TemporaryFailure = 41,
32    #[fail(display = "Congestion")]
33    Congestion = 42,
34    #[fail(display = "Resources unavailable, unspecified")]
35    ResourcesUnavailable = 47,
36    #[fail(display = "Requested facility not subscribed")]
37    NotSubscribed = 50,
38    #[fail(display = "Requested facility not implemented")]
39    NotImplemented = 69,
40    #[fail(display = "Invalid short message transfer reference value")]
41    InvalidReferenceValue = 81,
42    #[fail(display = "Invalid message, unspecified")]
43    InvalidMessage = 95,
44    #[fail(display = "Invalid mandatory information")]
45    InvalidMandatoryInformation = 96,
46    #[fail(display = "Message type non-existent or not implemented")]
47    NonexistentMessageType = 97,
48    #[fail(display = "Message not compatible with short message protocol state")]
49    IncompatibleMessage = 98,
50    #[fail(display = "Information element non-existent or not implemented")]
51    NonexistentInformationElement = 99,
52    #[fail(display = "Protocol error, unspecified")]
53    ProtocolError = 111,
54    #[fail(display = "Internetworking, unspecified")]
55    InternetworkingError = 127,
56    #[fail(display = "ME failure")]
57    MeFailure = 300,
58    #[fail(display = "SMS service of ME reserved")]
59    SmsServiceReserved = 301,
60    #[fail(display = "Operation not allowed")]
61    NotAllowed = 302,
62    #[fail(display = "Operation not supported")]
63    NotSupported = 303,
64    #[fail(display = "Invalid PDU mode parameter")]
65    InvalidPduModeParameter = 304,
66    #[fail(display = "Invalid text mode parameter")]
67    InvalidTextModeParameter = 305,
68    #[fail(display = "(U)SIM not inserted")]
69    SimNotInserted = 310,
70    #[fail(display = "(U)SIM PIN required")]
71    SimPinRequired = 311,
72    #[fail(display = "PH-(U)SIM PIN required")]
73    PhSimPinRequired = 312,
74    #[fail(display = "(U)SIM failure")]
75    SimFailure = 313,
76    #[fail(display = "(U)SIM busy")]
77    SimBusy = 314,
78    #[fail(display = "(U)SIM wrong")]
79    SimWrong = 315,
80    #[fail(display = "(U)SIM PUK required")]
81    SimPukRequired = 316,
82    #[fail(display = "(U)SIM PIN2 required")]
83    SimPin2Required = 317,
84    #[fail(display = "(U)SIM PUK2 required")]
85    SimPuk2Required = 318,
86    #[fail(display = "Memory failure")]
87    MemoryFailure = 320,
88    #[fail(display = "Invalid memory index")]
89    InvalidMemoryIndex = 321,
90    #[fail(display = "Memory full")]
91    MemoryFull = 322,
92    #[fail(display = "SMSC address unknown")]
93    SmscAddressUnknown = 330,
94    #[fail(display = "No network service")]
95    NoNetworkService = 331,
96    #[fail(display = "Network timeout")]
97    NetworkTimeout = 332,
98    #[fail(display = "No `+CNMA` acknowledgement expected")]
99    NoCnmaAcknowledgementExpected = 340,
100    #[fail(display = "Unknown error")]
101    UnknownError = 500,
102}