Constructors

Accessors

  • get device(): string
  • A getter method to retrieve a unique identifier for the modem device.

    Returns string

    A string that represents the unique device identifier.

  • get isOpen(): boolean
  • Checks whether the modem is currently open and connected. This can be used to verify the connection status before attempting to send commands or messages.

    Returns boolean

    True if the modem is connected, otherwise false.

  • get queueLength(): number
  • Retrieves the total length of the command queue.

    Returns number

    The total number of commands currently queued for execution.

Methods

  • Checks if the modem is responsive by sending a basic AT command.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<{
        status: "OK";
    }>

    A promise that resolves if the modem responds correctly.

  • Checks the SIM card memory usage for stored SMS messages.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<SimMemoryInformation>

    A promise that resolves with the SIM memory usage information.

  • Closes the connection to the modem. This method stops processing AT commands, disconnects the communicator interface.

    Returns Promise<void>

  • Deletes all SMS messages stored on the modem.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<void>

  • Deletes a specified SMS message and its referenced messages. This method is designed to delete both the specified SMS message and any referenced messages.

    Parameters

    • message: PduSms

      The SMS message to be deleted along with its referenced messages.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<{
        deleted: number[];
        failed: number[];
    }>

    A promise that resolves a object containing arrays of deleted and failed message indexes.

  • Deletes a specific SMS message by its index.

    Parameters

    • id: number

      The index of the SMS message to be deleted.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<void>

  • Executes a given AT command on the modem.

    Parameters

    • command: string

      The AT command to be executed.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    • Optional cmdtimeout: number

      Optional timeout for the command execution.

    Returns Promise<CommandResponse>

    A promise that resolves with the command response or rejects with an error.

  • Retrieves a list of available networks that the modem can see at the moment.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<{
        name: string;
        numeric: undefined | string;
        shortName: undefined | string;
        status: string;
    }[]>

    A promise that resolves with a list of available networks.

  • Retrieves the own phone number stored in the modem.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<{
        name: string;
        phoneNumber: string;
    }>

    A promise that resolves with the name and phone number.

  • Retrieves the product serial number of the modem.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<string>

    A promise that resolves with the modem's serial number.

  • Retrieves information about the currently registered network.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<{
        mode: string;
        name: undefined | string;
        numeric: undefined | string;
        shortName: undefined | string;
    }>

    A promise with an object containing network information.

  • Retrieves information about the current network signal strength and quality.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<{
        signalQuality: number;
        signalStrength: number;
    }>

    A promise with an object containing signal quality and strength.

  • Retrieves the SMS inbox from the SIM card. It constructs an array of PduSms objects representing the messages in the inbox. If message concatenation is enabled, it combines concatenated messages into a single PduSms object.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<PduSms[]>

    A promise that resolves with an array of PduSms objects representing SMS messages in the inbox.

  • Hangs up the current call. Sends an ATH command to the modem to terminate the ongoing call.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<void>

  • Initializes the modem with specified settings. This includes checking the modem's status, resetting it, setting echo mode, providing a PIN if required, executing a custom initialization command, setting the modem mode to PDU, and enabling caller identification.

    Parameters

    • prio: boolean = true

      Whether this action should be prioritised in the command queue.

    Returns Promise<void>

  • Opens the connection to the modem and initiates the connection.

    Returns Promise<void>

  • Reads an SMS message by its index.

    Parameters

    • id: number

      The index of the SMS message to be read.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<PduSms>

    A promise that resolves with the parsed SMS message.

  • Parameters

    • eventName: keyof EventTypes
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: unknown[]

          Returns void

    Returns void

  • Selects the phone book storage to be used for subsequent operations.

    Parameters

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<void>

  • Sends a PDU (Protocol Data Unit) formatted SMS using the provided PDU class.

    Type Parameters

    • T extends Deliver | Submit

    Parameters

    • pdu: T

      The PDU object representing the SMS to be sent.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<SendSmsSuccess<T>>

    A promise indicating the success of the SMS sending.

  • Sends an SMS message to a specified number. Allows for sending flash SMS by setting the data coding scheme accordingly.

    Parameters

    • number: string

      The recipient's phone number.

    • message: string

      The text message to be sent.

    • flashSms: boolean = false

      Whether the message should be sent as a flash SMS.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<SendSmsSuccess<Submit>>

    A promise that resolves when the SMS has been sent.

  • Sends a USSD command to the modem for execution.

    Parameters

    • command: string

      The USSD command to be executed.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<void>

  • Sets the own phone number in the modem's phone book storage. This method first selects the phone book storage and then writes the provided phone number and name into it.

    Parameters

    • phoneNumber: string

      The phone number to set as the own number.

    • name: string = 'OwnNumber'

      The name associated with the phone number, defaults to 'OwnNumber'.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<void>

  • Writes an entry to the phone book storage.

    Parameters

    • phoneNumber: string

      The phone number to store.

    • name: string

      The name associated with the phone number.

    • prio: boolean = false

      Whether this action should be prioritised in the command queue.

    Returns Promise<void>

Generated using TypeDoc