Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

thread806-497350

Status
Not open for further replies.

3491842093

Instructor
Apr 16, 2008
1
BE
Here's some code in VB that convert (siemens) Dect IPUI in IPEI:
Note that the code is not optimized. Anyone of you could make a better job than this. But, if U are lazy, simply copy-paste it.


What you need is a form, two textboxes (one named txtIPUI; the other one named TextBox1) and a command button (named Button1):



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strDato As String
Dim strConvertito As String
Dim strPrima As String
Dim strSeconda As String
Dim StrUnificata As String
Dim i As Integer
Dim CONTROLLO As Integer


Dim test As Double
Dim PrimaParte As Double
Dim SecondaParte As Double

Dim convertito As String
txtIPUI.Text = UCase(txtIPUI.Text)


strDato = txtIPUI.Text
strPrima = Mid(strDato, 2, 4)
strSeconda = Mid(strDato, 6)

strPrima = Hex2Dec(strPrima)
strSeconda = Hex2Dec(strSeconda)

Do While Len(strPrima) < 5
strPrima = "0" & strPrima
Loop

Do While Len(strSeconda) < 7
strSeconda = "0" & strSeconda
Loop

StrUnificata = strPrima & strSeconda

For i = 1 To Len(StrUnificata)
test = test + (i * Val(Mid(StrUnificata, i, 1)))


Next
CONTROLLO = (Val(test) Mod 11)


convertito = StrUnificata & CStr(CONTROLLO)

TextBox1.Text = "IPEI= " & convertito

If Not Len(convertito) = 13 Then
MsgBox("Attention! Ipei lenght incorrect." & vbCrLf & "Verificare IPUI", MsgBoxStyle.Critical + vbOKOnly, "Damn!!!")

End If


End Sub
Public Function Hex2Dec(ByVal numero)
Dim n, i, cifra, decimale
decimale = 0
n = Len(numero)
For i = 1 To n
decimale = decimale * 16
cifra = Mid(numero, i, 1)
decimale = decimale + InStr("0123456789ABCDEF", cifra) - 1
Next
Hex2Dec = decimale
End Function



 
Dear All

Anyway a KIRK 500 or KIRK 1500 system ( now sold by Polycom) can "listen" the registrations (subscrptions) of new DECT handsets, so you can see in clear text the IPEI code.
This logged data can be copied/pasted into the correct fields in the admin menu in the KIRK administration program.
If you have an IPUI code and you want to convert it to an IPEI number, or vice versa, you should use this link.


///doktor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top