Cellular / 4G

Pre-requisite: The user has to be signed in to perform the following operations.

A cellular Trail camera carries a SIM and draws on a data pool shared by the space. device.simCardDetail reports the iccId, imei, provider and current operator; the FourG cluster (0xFC21) exposes the FourGDataOff and FourGLowDataMode switches (Cluster.supportDataOff() / isDataOff(), supportLowDataMode() / isOnLowDataMode()).

The calls below validate a SIM before pairing, read the pool, list the data passes on offer (DataPassPurchaseType: Recurring, ManualTopUp, AutoTopUp) and read the auto top-up plan. PairingSessionKey requests for a cellular camera use SessionType.FOUR_G.


Validate the SIM ID of a 4G device

To validate the sim number of a 4g device, The following method can be used:

  • spaceId (required): The space ID of the device.
  • request (required): The request object containing the sim number to validate.
InstaVision.deviceServices.validateSimId(
  spaceId = "spaceId",
  request = ValidateSimId(simNumber = "simNumber"),
  onSuccess = {
    // The sim id was validated successfully
  },
  onError = { error ->
    // The error object contains the error code and message
  },
)


Get 4G data remaining and total data

To get the 4G data remaining and total data, the following method can be called.

InstaVision.spaceServices.getCellularData(
  spaceId = "spaceId",
  onSuccess = { cellularData ->
    // The cellularData object contains the 4G data remaining and total data
  },
  onError = { error ->
    // The error object contains the error code and message
  }
)

Get SIM card operator based on provider id

To get the SIM card operator based on provider id, the following method can be called.

  • spaceId (required): The id of the space.
  • providerId (required): The id of the SIM provider.
  • iccId (required): The ICCID of the SIM card.
InstaVision.spaceServices.getOperators(
  spaceId = "spaceId",
  providerId = "providerId",
  iccId = "iccId",
  onSuccess = { operators ->
    // The list of operators is returned
  },
  onError = { error ->
    // The error object contains the error code and message
  }
)

Get data recharge details

To get the data recharge details, the following method can be called.

  • purchaseType - (optional) The type of purchase. Possible values are “Recurring”, “ManualTopUp”, “AutoTopUp”.
  • purchaseId - (optional) The unique identifier of the purchase.
    InstaVision.spaceServices.getDataPass(
    spaceId = "spaceId",
    purchaseType = "purchaseType",
    purchaseId = "purchaseId",
    onSuccess = { dataPasses ->
      // The list of data passes is returned
    },
    onError = { error ->
      // The error object contains the error code and message
    }
    )
    

Get auto data top-up details

To get the auto data top-up details, the following method can be called.

InstaVision.spaceServices.getAutoTopUpInfo(
  spaceId = "spaceId",
  onSuccess = { autoTopUp ->
    // The auto data recharge details are returned
  },
  onError = { error ->
    // The error object contains the error code and message
  }
)

This site uses Just the Docs, a documentation theme for Jekyll.