Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AT_CellularInformation.h Source File

AT_CellularInformation.h

00001 /*
00002  * Copyright (c) 2018, Arm Limited and affiliates.
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef AT_CELLULAR_INFORMATION_H_
00019 #define AT_CELLULAR_INFORMATION_H_
00020 
00021 #include "CellularInformation.h"
00022 #include "ATHandler.h"
00023 #include "AT_CellularDevice.h"
00024 
00025 namespace mbed {
00026 
00027 /**
00028  * Class AT_CellularInformation
00029  *
00030  * Class that provides information about cellular device.
00031  */
00032 class AT_CellularInformation : public CellularInformation {
00033 public:
00034     AT_CellularInformation(ATHandler &at, AT_CellularDevice &device);
00035 
00036     virtual ~AT_CellularInformation();
00037 
00038 public:
00039     virtual nsapi_error_t get_manufacturer(char *buf, size_t buf_size);
00040 
00041     virtual nsapi_error_t get_model(char *buf, size_t buf_size);
00042 
00043     virtual nsapi_error_t get_revision(char *buf, size_t buf_size);
00044 
00045     virtual nsapi_error_t get_serial_number(char *buf, size_t buf_size, SerialNumberType type);
00046 
00047     virtual nsapi_error_t get_imsi(char *imsi, size_t buf_size);
00048 
00049     virtual nsapi_error_t get_iccid(char *buf, size_t buf_size);
00050 
00051     ATHandler &get_at_handler();
00052 protected:
00053     /** Request information text from cellular device
00054      *
00055      *  @param cmd      3gpp command string
00056      *  @param buf      buffer for response
00057      *  @param buf_size buffer size
00058      *  @return         on success read character count, on failure negative error code
00059      */
00060     nsapi_error_t get_info(const char *cmd, char *buf, size_t buf_size);
00061 
00062 protected:
00063     ATHandler &_at;
00064 
00065     AT_CellularDevice &_device;
00066 };
00067 
00068 } // namespace mbed
00069 
00070 #endif // AT_CELLULAR_INFORMATION_H_