Ver Mensaje Individual
  #31  
Antiguo 24-04-2013
pacocable pacocable is offline
Registrado
 
Registrado: ago 2006
Posts: 9
Reputación: 0
pacocable Va por buen camino
Se conectan casi siempre por puerto com virtual

segun he mirado los moviles al menos nokia se conecta por un com virtual que se crea al conectarlo con sus drivers.asi lo he conectado yo:
procedure TForm1.Button5Click(Sender: TObject);
begin
IF Marcar('COM2',edit3.Text) then
begin
showmessage('llamando');
end
else
begin
showmessage('no llama');
end;
end;

function Marcar(Puerto: String; Telefono: String): Boolean;
var
hPort: THandle;
DCB: TDCB;
Comando: String;
Escritos: Cardinal;
begin
Result:= FALSE;
Puerto:= Uppercase(Puerto);
// Cambiar esto si es necesario un puerto diferente
if (Puerto<>'COM1') and (Puerto<>'COM2') then
begin
showmessage('puerto no valido comprobar panel de control');
exit;
end;

hPort:= CreateFile(PChar('\\.\'+Puerto), GENERIC_READ or GENERIC_WRITE,0, nil,
OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
if hPort<>INVALID_HANDLE_VALUE then
begin
DCB.DCBlength:= sizeof(DCB);
if GetCommState(hPort,DCB) then
begin
// Cambiar esto para una configuracion del puerto diferente
with DCB do
begin
BaudRate := CBR_9600;
ByteSize := 8;
Parity := NOPARITY;
StopBits := ONESTOPBIT;
Flags := $01;
end;
if SetCommState(hPort, DCB) then
begin
PurgeComm(hPort, PURGE_TXABORT or PURGE_RXABORT or PURGE_TXCLEAR or
PURGE_RXCLEAR);
Comando:= 'ATD'+Telefono+#13;
Result := WriteFile(hPort, PChar(Comando)^, Length(Comando), Escritos, nil);

end;
end;
CloseHandle(hPort);
end
else
begin
showmessage('no conetado');
end;
end;
en text3 va el numero de telefono amarcar lo que si me faltan son mas comandos at
Responder Con Cita