Mistake on this page?
Report an issue in GitHub or email us
CellularCommon.h
1 /*
2  * Copyright (c) 2018, Arm Limited and affiliates.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef CELLULAR_COMMON_
19 #define CELLULAR_COMMON_
20 
21 #include <stdint.h>
22 #include "nsapi_types.h"
23 
25  nsapi_error_t error; /* possible error code */
26  int status_data; /* cellular_event_status related enum or other info in int format. Check cellular_event_status comments.*/
27  bool final_try; /* This flag is true if state machine is used and this was the last try. State machine does goes to idle. */
28 
30  {
31  error = NSAPI_ERROR_OK;
32  status_data = -1;
33  final_try = false;
34  }
35 };
36 
37 /**
38  * Cellular specific event changes.
39  * Connect and disconnect are handled via NSAPI_EVENT_CONNECTION_STATUS_CHANGE
40  * All enum types have struct *cell_callback_data_t in intptr_t with possible error code in cell_callback_data_t.error.
41  * Most enum values also have some enum in cell_callback_data_t.enumeration, check comments below.
42  */
43 typedef enum cellular_event_status {
44  CellularDeviceReady = NSAPI_EVENT_CELLULAR_STATUS_BASE, /* Modem is powered and ready to receive commands. cell_callback_data_t.status_data will be -1 */
45  CellularSIMStatusChanged = NSAPI_EVENT_CELLULAR_STATUS_BASE + 1, /* SIM state changed. cell_callback_data_t.status_data will be enum SimState. See enum SimState in ../API/CellularSIM.h*/
46  CellularRegistrationStatusChanged = NSAPI_EVENT_CELLULAR_STATUS_BASE + 2, /* Registering status changed. cell_callback_data_t.status_data will be enum RegistrationStatus. See enum RegistrationStatus in ../API/CellularNetwork.h*/
47  CellularRegistrationTypeChanged = NSAPI_EVENT_CELLULAR_STATUS_BASE + 3, /* Registration type changed. cell_callback_data_t.status_data will be enum RegistrationType. See enum RegistrationType in ../API/CellularNetwork.h*/
48  CellularCellIDChanged = NSAPI_EVENT_CELLULAR_STATUS_BASE + 4, /* Network Cell ID have changed. cell_callback_data_t.status_data will be int cellid*/
49  CellularRadioAccessTechnologyChanged = NSAPI_EVENT_CELLULAR_STATUS_BASE + 5, /* Network roaming status have changed. cell_callback_data_t.status_data will be enum RadioAccessTechnology See enum RadioAccessTechnology in ../API/CellularNetwork.h*/
50  CellularAttachNetwork = NSAPI_EVENT_CELLULAR_STATUS_BASE + 6, /* cell_callback_data_t.status_data will be enum AttachStatus. See enum AttachStatus in ../API/CellularNetwork.h */
51  CellularActivatePDPContext = NSAPI_EVENT_CELLULAR_STATUS_BASE + 7, /* NSAPI_ERROR_OK in cell_callback_data_t.error on successfully PDP Context activated or negative error */
52 } cellular_connection_status_t;
53 
54 #endif // CELLULAR_COMMON_
signed int nsapi_error_t
Type used to represent error codes.
Definition: nsapi_types.h:95
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.