Advertisement
Guest User

Untitled

a guest
May 25th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class SMSSender
  2.  
  3.     Public WithEvents Port As New System.IO.Ports.SerialPort
  4.  
  5.     Public Shared Sub SendSMS()
  6.  
  7.         Delay(2)
  8.  
  9.         SMSSender.Port.Write("at+cmgs= 43" & vbCrLf) 'Länge des PDU-Strings übermitteln.
  10.  
  11.         Delay(2)
  12.  
  13.         SMSSender.Port.Write("0001000B811057167913F5000022C337B90CBAD7E5E43268D60EB341E6307B3E4683CA69F7B97C2E8BCBEE10" & Char.ConvertFromUtf32(26) & vbCrLf)
  14.  
  15.     End Sub
  16.  
  17.  
  18.  
  19.     Public Shared Sub Delay(ByVal dblSecs As Double)
  20.  
  21.         Const OneSec As Double = 1.0# / (1440.0# * 60.0#)
  22.         Dim dblWaitTil As Date
  23.         Now.AddSeconds(OneSec)
  24.         dblWaitTil = Now.AddSeconds(OneSec).AddSeconds(dblSecs)
  25.         Do Until Now > dblWaitTil
  26.  
  27.         Loop
  28.  
  29.     End Sub
  30.  
  31. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement