MKRNB - 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() {
}