elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


+  Foro de elhacker.net
|-+  Informática
| |-+  Electrónica
| | |-+  MPUSBAPI.DLL con FreeBasic [Solucionado!]
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: MPUSBAPI.DLL con FreeBasic [Solucionado!]  (Leído 4,691 veces)
Oceano2012

Desconectado Desconectado

Mensajes: 3


Ver Perfil
MPUSBAPI.DLL con FreeBasic [Solucionado!]
« en: 31 Mayo 2010, 00:48 am »

Problema resuelto aquí: http://www.freebasic.net/forum/viewtopic.php?p=136968


Hola!

Estoy intentando acceder a la librería MPUSBAPI.DLL (que sirve para poder acceder a los microcontroladores de la serie 18Fxx5x por USB), pero no lo consigo. Sabe alguien cómo poder acceder a ella con FreeBasic?

Las funciones más importantes son estas:


* MPUSBOpen
* MPUSBRead
* MPUSBWrite
* MPUSBClose
* MPUSBGetDeviceCount

Os pongo lo que llevo hecho de momento sin resultado satisfactorio:

Código:
Cls

Const MPUS_FAIL = 0
Const MPUSB_SUCCESS = 1
Const MP_WRITE = 0
Const MP_READ = 1
Const MAX_NUM_MPUSB_DEV = 127

Const Vid_Pid = "VID_04D8&PID_000A"
Const Outpipe = "\MCHP_EP3"
Const Inppipe = "\MCHP_EP3"

Dim As UInteger MyInpPipe
Dim As UInteger MyOutPipe

Dim As Integer Count

Dim As Any Ptr hLib

hLib = DylibLoad( "mpusbapi.dll" )
If hLib = 0 Then End

Dim Version As Function () As UInteger
Dim OpenUSB As Function ( ByVal As UInteger, ByVal As String, ByVal As String, ByVal As UInteger, ByVal As UInteger) As Integer
Dim ClosUSB As Function ( ByVal As String ) As Integer
Dim DevCont As Function ( ByVal As String ) As Integer

Version = DyLibSymbol( hLib, "_MPUSBGetDLLVersion" )
OpenUSB = DyLibSymbol( hLib, "_MPUSBOpen" )
ClosUSB = DyLibSymbol( hLib, "_MPUSBClose" )
DevCont = DyLibSymbol( hLib, "_MPUSBGetDeviceCount" )

Count = DevCont(Vid_Pid)

If (Count > 0) Then
MyOutPipe = OpenUSB( 0, Vid_Pid, Outpipe, MP_WRITE, 0 )
MyInpPipe = OpenUSB( 0, Vid_Pid, Inppipe, MP_READ, 0 )
Else
Print "Failed to open data pipes.!"
Sleep
End
EndIf

ClosUSB ( Outpipe )

Sleep

End


« Última modificación: 13 Junio 2010, 00:49 am por Oceano2012 » En línea

imoen


Desconectado Desconectado

Mensajes: 1.589



Ver Perfil
Re: MPUSBAPI.DLL (help!)
« Respuesta #1 en: 31 Mayo 2010, 15:59 pm »

hi friend this is not the right forum to post that, try in programing.


tyr to search for a freebasic implementation of that DLL, or maybe u write one for it



kiss for u .


En línea

Medion Akoya p6624
i-3 370
8 gigas DDR 3 RAM //750 hd 5400
gforce gt425 optimus XDD
Esta es mi casa, mi pueblo , o lo que queda de el aun asi lucharemos ... POR BENALIA....!!

srta imoen
Oceano2012

Desconectado Desconectado

Mensajes: 3


Ver Perfil
Re: MPUSBAPI.DLL (help!) [Solucionado!]
« Respuesta #2 en: 3 Junio 2010, 23:13 pm »

Problema resuelto aquí:

http://www.freebasic.net/forum/viewtopic.php?p=136296
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines