BatteryLevel Property

Description:

The BatteryLevel property returns the battery charge level remaining in percentage if a battery is present in the GSM Modem or Phone. If there is no battery detected or if there is a power fault, BatteryCharge property returns the value -1

   

Usage intBatteryLevel = ObjectName.BatteryLevel
Value Type Integer
Access Mode Read Only
Valid Values
  • -1 : If there is no battery or if there is a power fault
  • 0 to 100 : Battery charge level remaining (in percentage)

Usage Example:

Visual Basic / ASP (VBScript)
Dim objSMS As mCore.SMS
Set objSMS = New mCore.SMS
' You can also use Set objSMS = CreateObject("mCore.SMS")
' In case of ASP (VBScript) to create object use
' Set objSMS = Server.CreateObject("mCore.SMS")
' In ASP use Response.Write instead of MsgBox
objSMS.Port = "COM2"
objSMS.BaudRate = 57600
objSMS.Parity = "N"
objSMS.DataBits = 8
objSMS.StopBits = "1"
' It is not necessary to execute the 'Connect' method.
' Connection state is detected internally by mCore and
' the 'Connect' method is executed accordingly.
MsgBox objSMS.IMEI
MsgBox objSMS.Manufacturer
MsgBox objSMS.Model
MsgBox objSMS.Revision
MsgBox objSMS.BatteryLevel
' Disconnect method is executed internally
' whenever the SMS object is terminated.
Set objSMS = Nothing

   

Copyright © IG Logix Softech Pvt Ltd, All Rights Reserved