My vb source was bloked so i put it here :
        Public Function echangeobex(ByVal entree As String)
        Try

            Dim i As Integer
            Dim aecrire() As String = Split(entree, ",")
            Dim ecrit As String = Nothing
            Me.TexteASCII.AppendText("TX==>//")
            Me.TexteHEXA.AppendText("TX==>//")
            For i = 0 To aecrire.Length - 1
                'Dim opcode As String = Convert.ToInt32(aecrire.Chars(i) _
                '& aecrire.Chars(i + 1))
                ecrit &= Chr(Convert.ToInt32(aecrire(i), 16))
                Me.TexteASCII.AppendText("[" & Convert.ToInt32(aecrire(i), 
16) & "]")
                Me.TexteHEXA.AppendText("[" & aecrire(i) & "]")

            Next
            Me.TexteASCII.AppendText("//" & vbCrLf)
            Me.TexteHEXA.AppendText("//" & vbCrLf)

            Return ecrit

        Catch ex As Exception
            Return Nothing
            MsgBox(ex.Message)
        End Try
    End Function

    Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal 
e As System.EventArgs) Handles ToolStripButton2.Click

        Try

            With Me.SerialPort1

                Me.ToolStripProgressBar1.Visible = True

                Me.Cursor = Cursors.WaitCursor

                Dim ctrl As Control

                For Each ctrl In Me.Controls

                    Application.DoEvents()

                    ctrl.Cursor = Cursors.WaitCursor

                Next



                If .IsOpen = False Then

                    .Open()

                    Me.ToolStripButton1portop_cl.Text = "Ferme le port"

                End If

                .Write("AT +CKPD=" & Chr(34) & "E" & Chr(34) & vbCrLf)

                Dim UneSec As Long = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 15000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                '.NewLine = vbCrLf

                .Write("AT +CPROT=0" & vbCrLf)

                'Dim UneSec As Long = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Etablit la connection

                '.Write(Chr(128) & Chr(0) & Chr(17) & Chr(17) & Chr(0) & 
Chr(32) & Chr(0) & Chr(192) & Chr(0) & Chr(0) & Chr(0) & Chr(4) & Chr(195) & 
Chr(0) & Chr(0) & Chr(244) & Chr(131))

                .Write(echangeobex("80,00,07,12,00,04,00"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Definit le chemin a /

                .Write(echangeobex("85,00,08,02,00,01,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Liste /

                
.Write(echangeobex("83,00,21,01,00,05,00,00,42,00,19,78,2D,6F,62,65,78,2F,66,6F,6C,64,65,72,2D,6C,69,73,74,69,6E,67,00"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Definit le chemin a IMAGES

                
.Write(echangeobex("85,00,16,02,00,01,00,11,00,49,00,4D,00,41,00,47,00,45,00,53,00,00"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Obtient la liste des dossier et fichiers de IMAGES

                
.Write(echangeobex("83,00,21,01,00,05,00,00,42,00,19,78,2D,6F,62,65,78,2F,66,6F,6C,64,65,72,2D,6C,69,73,74,69,6E,67,00"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Obtient la suite de la liste des dossier

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Obtient le fichier img.jpg

                VersFichier = True

                .DiscardNull = False

                Me.Timer1.Enabled = False

                While .BytesToRead <> 0

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                
.Write(echangeobex("83,00,16,01,00,13,00,69,00,6D,00,67,00,2E,00,6A,00,70,00,67,00,00"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                'Ne pas s'arreter en cours mais continu, allez

                .Write(echangeobex("83,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

                VersFichier = False

                Me.Timer1.Enabled = True

                My.Computer.FileSystem.WriteAllBytes("img.jpg", FichierDest, 
False)

                ReDim FichierDest(0)

                MsgBox("Terminé")



                For Each ctrl In Me.Controls

                    Application.DoEvents()

                    ctrl.Cursor = Cursors.Default

                Next

                Me.Cursor = Cursors.Default



                'Deconection

                .Write(echangeobex("81,00,03"))

                UneSec = Date.Now.Ticks

                While Date.Now.Ticks < UneSec + 25000000

                    My.Application.DoEvents()

                End While

                Me.ToolStripProgressBar1.PerformStep()

            End With

            Me.ToolStripProgressBar1.Value = 0

            Me.ToolStripProgressBar1.Visible = False



        Catch ex As Exception

            MsgBox(ex.Message & "//" & ex.Source)

            Me.ToolStripProgressBar1.Visible = False

        End Try

    End Sub




>From: "surfzoid surfzoid" <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected], [EMAIL PROTECTED]
>Subject: Re: [openobex-users] debugging M341i
>Date: Thu, 12 Oct 2006 21:01:59 +0000
>
>hi everybody, i try to do something working like in VB from windoze for my 
>M341i, so i try to use the monodevel, but i have just litlle knoweldge 
>about vb not C, somebody can help me, i find the file attachment on mono 
>website as sample code to use serial on linux, it do something i can see in 
>irdadump but i don't understand how to send multiple data with a waiting 
>time between each send , i would like to "multiplex" my vb sequence who 
>works fine with sample to just do in first time :
>conect
>list folder
>go into IMAGES dir
>get the img.jpg file
>
>for the mono .cs file you must do as explain here 
>http://www.mono-project.com/HowToSystemIOPorts#Example_Code
>Before i put /dev/ircomm0 to replace the tty.
>and i would like to send binary like byte(0) = 120
>byte(1) = 36 byte(3) = 56 ....
>serialportcom.write(byte,0,xx)
>Thanks
>
>_________________________________________________________________
>Retrouvez tout en un clin d'œil avec Windows Desktop Search ! 
>http://desktop.msn.fr/


><< Principale.vb >>


><< SerialExample.cs >>


>-------------------------------------------------------------------------
>Using Tomcat but need to do more? Need to support web services, security?
>Get stuff done quickly with pre-integrated technology to make your job 
>easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642


>_______________________________________________
>Openobex-users mailing list
>[email protected]
>http://lists.sourceforge.net/lists/listinfo/openobex-users

_________________________________________________________________
Retrouvez tout en un clin d'œil avec Windows Desktop Search ! 
http://desktop.msn.fr/


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to