Reference   Language | Libraries | Comparison | Changes

MKRNB : NBModem class

getICCID()

Description

Retrieves the SIM's ICCID number. Call this after begin().

Syntax

modem.getICCID()

Parameters

none

Returns

String : the SIM's ICCID number

Example

// libraries
#include <MKRNB.h>

// modem verification object
NBModem modem;

// ICCID variable
String ICCID = "";

void setup() {
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  // start modem  (reset and check response)
  Serial.print("Starting modem test...");
  if (modem.begin()) {
    Serial.println("modem.begin() succeeded");
  } else {
    Serial.println("ERROR, no modem answer.");
    while (1);
  }

  // get ICCID
  Serial.print("ICCID = ");
  Serial.println(modem.getICCID());
}

void loop() {
}

See Also

begin()

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.