Skip to contents

This function validates a single IMEI number against a list of valid IMEIs.

Usage

validate_this_imei(this_imei, this_id = NULL, valid_imeis)

Arguments

this_imei

The IMEI number to validate.

this_id

The survey ID associated with the IMEI (optional).

valid_imeis

A vector of valid IMEI numbers to check against.

Value

A list with three elements:

  • imei: The validated IMEI if found, otherwise NA

  • alert_number: An alert code (1, 2, or 3) if validation fails, otherwise NA

  • survey_id: The provided survey ID

Details

Alert codes:

  • 1: IMEI is too short (less than 5 digits)

  • 2: Multiple valid IMEIs match the provided IMEI

  • 3: No valid IMEI matches the provided IMEI