New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cellular: Add AT+CCID and AT+CGSN #7217

Merged
merged 2 commits into from Jun 19, 2018

Conversation

Projects
None yet
7 participants
@AriParkkila
Contributor

AriParkkila commented Jun 14, 2018

Description

Added new methods in cellular API:

  • CellularInformation::get_serial_number to read SN and IMEI of modem with AT+CGSN
  • CellularSIM::get_iccid to read ICCID of SIM card with AT+CCID

Fixes Arm internal ref IOTCELL-1091.

Doxygen and return types of the CellularInformation class were fixed at the same.

Usage example:

CellularInformation *info = _cellularDevice->open_information(_serial);
char buf[100];
if (info->get_serial_number(buf, sizeof(buf), CellularInformation::SN) == 0) {
    tr_info("SN: %s", buf);
}
_cellularDevice->close_information();

Pull request type

[ ] Fix
[ ] Refactor
[ ] New target
[X] Feature
[ ] Breaking change
@AriParkkila

This comment has been minimized.

Contributor

AriParkkila commented Jun 14, 2018

@mirelachirica @jarvte please review

@@ -21,7 +21,8 @@
#include <stddef.h>
#include "nsapi_types.h"
namespace mbed {
namespace mbed
{

This comment has been minimized.

@0xc0170

0xc0170 Jun 14, 2018

Member

as it was - it was good ( see astyle in the travis ). It shows more style issues

Style changes, own commit please

This comment has been minimized.

@AriParkkila

AriParkkila Jun 14, 2018

Contributor

This follows Mbed OS coding guidelines, see astyle in https://os.mbed.com/teams/SDK-Development/wiki/mbed-sdk-coding-style

This comment has been minimized.

@0xc0170

0xc0170 Jun 14, 2018

Member

That is the old one. Please do not use it. Anyway, from there "Braces - K&R (see the exception 1 TBS below)" . this { should be attached.

Use https://os.mbed.com/docs/latest/reference/style.html (points to astylerc file that is in our codebase) . Travis runs this and can show you how this breaks the style defined there.

Taken from Travis:

-namespace mbed
-{
+namespace mbed {
 
 /**
  *  Class CellularInformation
  *
  *  An abstract interface that provides information about cellular device.
  */
-class CellularInformation
-{
+class CellularInformation {
@@ -18,12 +18,16 @@
#ifndef CELLULAR_SIM_H_
#define CELLULAR_SIM_H_
#include <stddef.h>

This comment has been minimized.

@0xc0170

0xc0170 Jun 14, 2018

Member

how does this relates to the new API addition?

This comment has been minimized.

@AriParkkila

AriParkkila Jun 14, 2018

Contributor

That's for size_t definition.

@0xc0170 0xc0170 added the needs: work label Jun 14, 2018

@AriParkkila AriParkkila force-pushed the AriParkkila:cellular-info-sim branch from 7739d8d to 44365bc Jun 14, 2018

* @param buf_size max length of manufacturer identification is 2048 characters
* @return on success read character count, on failure negative error code
* @return zero on success, on failure negative error code

This comment has been minimized.

@mirelachirica

mirelachirica Jun 14, 2018

Contributor

Internal ticket IOTCELL-1097 to unify comments about return values on APIs returning nsapi_error_t.
Suggest: "NSAPI_ERROR_OK on success, or following error codes: -list of possible error codes-"

@AriParkkila

This comment has been minimized.

Contributor

AriParkkila commented Jun 14, 2018

This is working with UBLOX_C027, but I noticed that other cellular targets need more work.

@AriParkkila

This comment has been minimized.

Contributor

AriParkkila commented Jun 15, 2018

@mirelachirica @jarvte please re-review target specific adaptation

@AriParkkila

This comment has been minimized.

Contributor

AriParkkila commented Jun 18, 2018

@0xc0170 this should be now good for merge, I think.

@0xc0170 0xc0170 changed the title from Cellular: Added AT+CCID and AT+CGSN to Cellular: Add AT+CCID and AT+CGSN Jun 18, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jun 18, 2018

/morph build

@0xc0170 0xc0170 added needs: CI and removed needs: work labels Jun 18, 2018

@mbed-ci

This comment has been minimized.

mbed-ci commented Jun 18, 2018

Build : SUCCESS

Build number : 2368
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7217/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jun 18, 2018

/morph uvisor-test

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jun 19, 2018

@AnttiKauppila @jarvte Can you rereview please?

@cmonr cmonr removed the needs: review label Jun 19, 2018

@cmonr cmonr merged commit fcfe6e1 into ARMmbed:master Jun 19, 2018

14 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 918 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9600 cycles (+21 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 9964B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@AriParkkila AriParkkila deleted the AriParkkila:cellular-info-sim branch Sep 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment