fixed wrong types names
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{ BePascal - A pascal wrapper around the BeOS API
|
{ BePascal - A pascal wrapper around the BeOS API
|
||||||
Copyright (C) 2002 Eric Jourde
|
Copyright (C) 2002-2003 Eric Jourde
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
@@ -15,82 +15,81 @@
|
|||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
}
|
}
|
||||||
unit joystick;
|
unit Joystick;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
beobj, SupportDefs, os;
|
BeObj, OS, SupportDefs;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
BJoystick = class(TBeObject)
|
BJoystick = class(TBeObject)
|
||||||
private
|
private
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create; override;
|
constructor Create; override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function Open(portName : PChar) : Status_t;
|
|
||||||
|
function Open(portName : PChar) : status_t;
|
||||||
|
function Open_1(portName : PChar; enter_enhanced : boolean) : status_t;
|
||||||
|
|
||||||
procedure Close;
|
procedure Close;
|
||||||
function Open_1(portName : PChar; enter_enhanced : boolean):Status_t;
|
|
||||||
|
|
||||||
function Update: Status_t;
|
function Update : status_t;
|
||||||
function SetMaxLatency( max_latency:TBigtime_t): Status_t;
|
function SetMaxLatency(max_latency : bigtime_t) : status_t;
|
||||||
function CountDevices : Cardinal;
|
function CountDevices : Cardinal;
|
||||||
function GetDeviceName( n : Integer; name : PChar; bufSize: Tsize_t): Status_t;
|
function GetDeviceName(n : Integer; name : PChar; bufSize : size_t) : status_t;
|
||||||
|
|
||||||
function CountSticks: Cardinal;
|
function CountSticks : Cardinal;
|
||||||
function CountAxes:Cardinal;
|
function CountAxes : Cardinal;
|
||||||
function CountHats:Cardinal;
|
function CountHats : Cardinal;
|
||||||
function CountButtons:Cardinal;
|
function CountButtons : Cardinal;
|
||||||
function GetAxisValues( out_values : Integer; for_stick : cardinal): Status_t;
|
function GetAxisValues(out_values : Integer; for_stick : Cardinal): status_t;
|
||||||
function ButtonValues(for_stick: cardinal):Cardinal;
|
function ButtonValues(for_stick : Cardinal) : Cardinal;
|
||||||
function IsCalibrationEnabled:boolean;
|
function IsCalibrationEnabled : boolean;
|
||||||
function EnableCalibration (calibrates : boolean): Status_t;
|
function EnableCalibration(calibrates : boolean) : status_t;
|
||||||
|
|
||||||
//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean;
|
// function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean;
|
||||||
// function GetAxisNameAt(index: cardinal; BString *out_name): Status_t;
|
// function GetAxisNameAt(index: cardinal; BString *out_name): Status_t;
|
||||||
// function GetHatNameAt( index: cardinal,BString *out_name): Status_t;
|
// function GetHatNameAt( index: cardinal,BString *out_name): Status_t;
|
||||||
// function GetButtonNameAt( index: cardinal,BString *out_name): Status_t; c
|
// function GetButtonNameAt( index: cardinal,BString *out_name): Status_t; c
|
||||||
// function GetControllerModule( BString *out_name): Status_t;
|
// function GetControllerModule( BString *out_name): Status_t;
|
||||||
// function GetControllerName( BString *out_name): Status_t;
|
// function GetControllerName( BString *out_name): Status_t;
|
||||||
// function GetHatValues( uint8 *out_hats;for_stick: cardinal): Status_t;
|
// function GetHatValues( uint8 *out_hats;for_stick: cardinal): Status_t;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function BJoystick_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BJoystick_Create';
|
function BJoystick_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BJoystick_Create';
|
||||||
procedure BJoystick_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Free';
|
procedure BJoystick_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Free';
|
||||||
|
|
||||||
function BJoystick_Open(AObject : TCPlusObject; portName : PChar):Status_t ; cdecl; external BePascalLibName name 'BJoystick_Open';
|
function BJoystick_Open(AObject : TCPlusObject; portName : PChar) : status_t ; cdecl; external BePascalLibName name 'BJoystick_Open';
|
||||||
function BJoystick_Open_1(AObject : TCPlusObject; portName : PChar; enter_enhanced : boolean):Status_t; cdecl; external BePascalLibName name 'BJoystick_Open_1';
|
function BJoystick_Open_1(AObject : TCPlusObject; portName : PChar; enter_enhanced : boolean) : status_t; cdecl; external BePascalLibName name 'BJoystick_Open_1';
|
||||||
|
|
||||||
procedure BJoystick_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Close';
|
procedure BJoystick_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BJoystick_Close';
|
||||||
function BJoystick_Update(AObject : TCPlusObject): Status_t; cdecl; external BePascalLibName name 'BJoystick_Update';
|
function BJoystick_Update(AObject : TCPlusObject) : status_t; cdecl; external BePascalLibName name 'BJoystick_Update';
|
||||||
function BJoystick_SetMaxLatency(AObject : TCPlusObject; max_latency:TBigtime_t): Status_t; cdecl; external BePascalLibName name 'BJoystick_SetMaxLatency';
|
function BJoystick_SetMaxLatency(AObject : TCPlusObject; max_latency : bigtime_t) : status_t; cdecl; external BePascalLibName name 'BJoystick_SetMaxLatency';
|
||||||
function BJoystick_CountDevices(AObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountDevices';
|
function BJoystick_CountDevices(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountDevices';
|
||||||
function BJoystick_GetDeviceName(AObject : TCPlusObject; n : Integer; name : PChar; bufSize: Tsize_t): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetDeviceName';
|
function BJoystick_GetDeviceName(AObject : TCPlusObject; n : Integer; name : PChar; bufSize : size_t) : status_t; cdecl; external BePascalLibName name 'BJoystick_GetDeviceName';
|
||||||
|
|
||||||
function BJoystick_CountSticks(BAObject : TCPlusObject): Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountSticks';
|
function BJoystick_CountSticks(BAObject : TCPlusObject): Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountSticks';
|
||||||
function BJoystick_CountAxes(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountAxes';
|
function BJoystick_CountAxes(BAObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountAxes';
|
||||||
function BJoystick_CountHats(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountHats';
|
function BJoystick_CountHats(BAObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountHats';
|
||||||
function BJoystick_CountButtons(BAObject : TCPlusObject):Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountButtons';
|
function BJoystick_CountButtons(BAObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BJoystick_CountButtons';
|
||||||
function BJoystick_GetAxisValues(BAObject : TCPlusObject; out_values : Integer; for_stick : cardinal): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisValues';
|
function BJoystick_GetAxisValues(BAObject : TCPlusObject; out_values : Integer; for_stick : Cardinal): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisValues';
|
||||||
function BJoystick_ButtonValues(BAObject : TCPlusObject;for_stick: cardinal):Cardinal; cdecl; external BePascalLibName name 'BJoystick_ButtonValues';
|
function BJoystick_ButtonValues(BAObject : TCPlusObject;for_stick : Cardinal) : Cardinal; cdecl; external BePascalLibName name 'BJoystick_ButtonValues';
|
||||||
function BJoystick_IsCalibrationEnabled(BAObject : TCPlusObject):boolean; cdecl; external BePascalLibName name 'BJoystick_IsCalibrationEnabled';
|
function BJoystick_IsCalibrationEnabled(BAObject : TCPlusObject) : Boolean; cdecl; external BePascalLibName name 'BJoystick_IsCalibrationEnabled';
|
||||||
function BJoystick_EnableCalibration(BAObject : TCPlusObject;calibrates : boolean): Status_t; cdecl; external BePascalLibName name 'BJoystick_EnableCalibration';
|
function BJoystick_EnableCalibration(BAObject : TCPlusObject; calibrates : Boolean): Status_t; cdecl; external BePascalLibName name 'BJoystick_EnableCalibration';
|
||||||
|
|
||||||
//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean; cdecl; external BePascalLibName name 'BJoystick_EnterEnhancedMode';
|
//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref) : Boolean; cdecl; external BePascalLibName name 'BJoystick_EnterEnhancedMode';
|
||||||
//function BJoystick_GetHatValues(BAObject : TCPlusObject, uint8 *out_hats;for_stick: cardinal): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetHatValues';
|
//function BJoystick_GetHatValues(BAObject : TCPlusObject, uint8 *out_hats;for_stick: cardinal) : status_t; cdecl; external BePascalLibName name 'BJoystick_GetHatValues';
|
||||||
//function BJoystick_GetAxisNameAt(BAObject : TCPlusObject;index: cardinal; BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisNameAt';
|
//function BJoystick_GetAxisNameAt(BAObject : TCPlusObject;index: cardinal; BString *out_name) : status_t; cdecl; external BePascalLibName name 'BJoystick_GetAxisNameAt';
|
||||||
//function BJoystick_GetHatNameAt(BAObject : TCPlusObject; index: cardinal, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetHatNameAt';
|
//function BJoystick_GetHatNameAt(BAObject : TCPlusObject; index: cardinal, BString *out_name) : status_t; cdecl; external BePascalLibName name 'BJoystick_GetHatNameAt';
|
||||||
//function BJoystick_GetButtonNameAt(BAObject : TCPlusObject; index: cardinal,BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetButtonNameAt';
|
//function BJoystick_GetButtonNameAt(BAObject : TCPlusObject; index: cardinal,BString *out_name) : status_t; cdecl; external BePascalLibName name 'BJoystick_GetButtonNameAt';
|
||||||
//function BJoystick_GetControllerModule(BAObject : TCPlusObject, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerModule';
|
//function BJoystick_GetControllerModule(BAObject : TCPlusObject, BString *out_name) : status_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerModule';
|
||||||
//function BJoystick_GetControllerName(BAObject : TCPlusObject, BString *out_name): Status_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerName';
|
//function BJoystick_GetControllerName(BAObject : TCPlusObject, BString *out_name) : status_t; cdecl; external BePascalLibName name 'BJoystick_GetControllerName';
|
||||||
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
constructor BJoystick.Create;
|
constructor BJoystick.Create;
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
@@ -104,117 +103,111 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function BJoystick.Open(portName : PChar) : status_t;
|
||||||
function BJoystick.Open(portName : PChar) : Status_t;
|
|
||||||
begin
|
begin
|
||||||
result := BJoystick_Open(CPlusObject, portName);
|
Result := BJoystick_Open(CPlusObject, portName);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.Open_1( portName : PChar; enter_enhanced : boolean):Status_t;
|
function BJoystick.Open_1(portName : PChar; enter_enhanced : boolean) : status_t;
|
||||||
begin
|
begin
|
||||||
result := BJoystick_Open_1(CPlusObject, portName , enter_enhanced);
|
Result := BJoystick_Open_1(CPlusObject, portName, enter_enhanced);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure BJoystick.Close;
|
procedure BJoystick.Close;
|
||||||
begin
|
begin
|
||||||
BJoystick_Close(CPlusObject);
|
BJoystick_Close(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.Update: Status_t;
|
function BJoystick.Update : status_t;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_Update(CPlusObject);
|
Result := BJoystick_Update(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.SetMaxLatency(max_latency:TBigtime_t): Status_t;
|
function BJoystick.SetMaxLatency(max_latency : bigtime_t) : status_t;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_SetMaxLatency(CPlusObject, max_latency);
|
Result := BJoystick_SetMaxLatency(CPlusObject, max_latency);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.CountDevices :Cardinal;
|
function BJoystick.CountDevices :Cardinal;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_CountDevices(CPlusObject);
|
Result := BJoystick_CountDevices(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.GetDeviceName( n : Integer; name : PChar; bufSize: Tsize_t): Status_t;
|
function BJoystick.GetDeviceName(n : Integer; name : PChar; bufSize : size_t) : status_t;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_GetDeviceName(CPlusObject, n, name, bufSize );
|
Result := BJoystick_GetDeviceName(CPlusObject, n, name, bufSize);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean;
|
//function BJoystick_EnterEnhancedMode(BAObject : TCPlusObject; const entry_ref *ref): Boolean;
|
||||||
|
|
||||||
function BJoystick.CountSticks: Cardinal;
|
function BJoystick.CountSticks : Cardinal;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_CountSticks(CPlusObject);
|
Result := BJoystick_CountSticks(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.CountAxes:Cardinal;
|
function BJoystick.CountAxes : Cardinal;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_CountAxes(CPlusObject);
|
Result := BJoystick_CountAxes(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.CountHats:Cardinal;
|
function BJoystick.CountHats : Cardinal;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_CountHats(CPlusObject);
|
Result := BJoystick_CountHats(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.CountButtons:Cardinal;
|
function BJoystick.CountButtons : Cardinal;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_CountButtons(CPlusObject);
|
Result := BJoystick_CountButtons(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.GetAxisValues( out_values : Integer; for_stick : cardinal): Status_t;
|
function BJoystick.GetAxisValues(out_values : Integer; for_stick : Cardinal) : status_t;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_GetAxisValues(CPlusObject, out_values, for_stick);
|
Result := BJoystick_GetAxisValues(CPlusObject, out_values, for_stick);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//function BJoystick.GetHatValues( uint8 *out_hats ; for_stick: cardinal): Status_t;
|
//function BJoystick.GetHatValues(uint8 *out_hats ; for_stick : cardinal) : status_t;
|
||||||
//begin
|
//begin
|
||||||
// result:=BJoystick_GetHatValues( out_hats,for_stick);
|
// Result := BJoystick_GetHatValues(out_hats, for_stick);
|
||||||
//end;
|
//end;
|
||||||
|
|
||||||
function BJoystick.ButtonValues(for_stick: cardinal):Cardinal;
|
function BJoystick.ButtonValues(for_stick : cardinal) : Cardinal;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_ButtonValues(CPlusObject,for_stick);
|
Result := BJoystick_ButtonValues(CPlusObject, for_stick);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//function BJoystick.GetAxisNameAt(index: cardinal; BString *out_name): Status_t;
|
//function BJoystick.GetAxisNameAt(index : cardinal; BString *out_name) : status_t;
|
||||||
//begin
|
//begin
|
||||||
// result:=BJoystick_GetAxisNameAt(CPlusObject,index,out_name);
|
// Result := BJoystick_GetAxisNameAt(CPlusObject, index, out_name);
|
||||||
//end;
|
//end;
|
||||||
|
|
||||||
//function BJoystick.GetHatNameAt( index: cardinal,BString *out_name): Status_t;
|
//function BJoystick.GetHatNameAt(index : cardinal,BString *out_name) : status_t;
|
||||||
//begin
|
//begin
|
||||||
// result:=BJoystick_GetHatNameAt(CPlusObject, index,out_name);
|
// Result := BJoystick_GetHatNameAt(CPlusObject, index,out_name);
|
||||||
//end;
|
//end;
|
||||||
|
|
||||||
//function BJoystick.GetButtonNameAt( index: cardinal,BString *out_name): Status_t;
|
//function BJoystick.GetButtonNameAt(index : cardinal, BString *out_name) : status_t;
|
||||||
//begin
|
//begin
|
||||||
// result:=BJoystick_GetButtonNameAt(CPlusObject, index,out_name);
|
// Result := BJoystick_GetButtonNameAt(CPlusObject, index, out_name);
|
||||||
//end;
|
//end;
|
||||||
|
|
||||||
//function BJoystick.GetControllerModule( BString *out_name): Status_t;
|
//function BJoystick.GetControllerModule(BString *out_name) : status_t;
|
||||||
//begin
|
//begin
|
||||||
// result:=BJoystick_GetControllerModule(CPlusObject, out_name);
|
// Result := BJoystick_GetControllerModule(CPlusObject, out_name);
|
||||||
//end;
|
//end;
|
||||||
|
|
||||||
//function BJoystick.GetControllerName( BString: *out_name): Status_t;
|
//function BJoystick.GetControllerName(BString : *out_name) : status_t;
|
||||||
//begin
|
//begin
|
||||||
// result:=BJoystick_GetControllerName(CPlusObject, out_name);
|
// Result := BJoystick_GetControllerName(CPlusObject, out_name);
|
||||||
//end;
|
//end;
|
||||||
|
|
||||||
function BJoystick.IsCalibrationEnabled:boolean;
|
function BJoystick.IsCalibrationEnabled : Boolean;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_IsCalibrationEnabled(CPlusObject);
|
Result := BJoystick_IsCalibrationEnabled(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BJoystick.EnableCalibration( calibrates : boolean): Status_t;
|
function BJoystick.EnableCalibration(calibrates : boolean) : status_t;
|
||||||
begin
|
begin
|
||||||
result:=BJoystick_EnableCalibration(CPlusObject, calibrates);
|
Result := BJoystick_EnableCalibration(CPlusObject, calibrates);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
end.
|
||||||
end.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{ BePascal - A pascal wrapper around the BeOS API
|
{ BePascal - A pascal wrapper around the BeOS API
|
||||||
Copyright (C) 2002 Olivier Coursiere
|
Copyright (C) 2002-2003 Olivier Coursiere
|
||||||
|
|
||||||
This library is free software; you can redistribute it and/or
|
This library is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU Library General Public
|
modify it under the terms of the GNU Library General Public
|
||||||
@@ -15,16 +15,16 @@
|
|||||||
License along with this library; if not, write to the Free
|
License along with this library; if not, write to the Free
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
}
|
}
|
||||||
unit serialport;
|
unit SerialPort;
|
||||||
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
beobj, SupportDefs, os;
|
BeObj, OS, SupportDefs;
|
||||||
|
|
||||||
type
|
type
|
||||||
// Pascal enum start at 0 (like in C++). We are lucky because we can't
|
// Pascal enum start at 0 (like in C++). We are lucky because we can't
|
||||||
// initialize enum values yet (?) in FreePascal ;-)
|
// initialize enum values yet (?) in FreePascal ;-)
|
||||||
DataRate = (B_0_BPS, B_50_BPS, B_75_BPS, B_110_BPS, B_134_BPS,
|
DataRate = (B_0_BPS, B_50_BPS, B_75_BPS, B_110_BPS, B_134_BPS,
|
||||||
B_150_BPS, B_200_BPS, B_300_BPS, B_600_BPS, B_1200_BPS,
|
B_150_BPS, B_200_BPS, B_300_BPS, B_600_BPS, B_1200_BPS,
|
||||||
B_1800_BPS, B_2400_BPS, B_4800_BPS, B_9600_BPS, B_19200_BPS,
|
B_1800_BPS, B_2400_BPS, B_4800_BPS, B_9600_BPS, B_19200_BPS,
|
||||||
@@ -48,15 +48,15 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create; override;
|
constructor Create; override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function Open(portName : PChar) : Status_t;
|
function Open(portName : PChar) : status_t;
|
||||||
procedure Close;
|
procedure Close;
|
||||||
|
|
||||||
function Read(buf : PChar; count : Size_t) : TSSize_t;
|
function Read(buf : PChar; count : size_t) : ssize_t;
|
||||||
function Write(const buf : PChar; count : Size_t) : TSSize_t;
|
function Write(const buf : PChar; count : size_t) : ssize_t;
|
||||||
|
|
||||||
procedure SetBlocking(Blocking : boolean);
|
procedure SetBlocking(Blocking : Boolean);
|
||||||
function SetTimeout(microSeconds : TBigtime_t) : Status_t;
|
function SetTimeout(microSeconds : bigtime_t) : status_t;
|
||||||
function SeDataRate(bitsPerSecond : DataRate) : Status_t;
|
function SeDataRate(bitsPerSecond : DataRate) : status_t;
|
||||||
function GeDataRate : DataRate;
|
function GeDataRate : DataRate;
|
||||||
procedure SeDataBits(numBits : DataBits);
|
procedure SeDataBits(numBits : DataBits);
|
||||||
function GeDataBits : DataBits;
|
function GeDataBits : DataBits;
|
||||||
@@ -66,21 +66,21 @@ type
|
|||||||
function GeParityMode : ParityMode;
|
function GeParityMode : ParityMode;
|
||||||
procedure ClearInput;
|
procedure ClearInput;
|
||||||
procedure ClearOutput;
|
procedure ClearOutput;
|
||||||
|
|
||||||
procedure SetFlowControl(method : Cardinal);
|
procedure SetFlowControl(method : Cardinal);
|
||||||
function GetFlowControl : Cardinal;
|
function GetFlowControl : Cardinal;
|
||||||
function SetDTR(asserted : boolean) : Status_t;
|
function SetDTR(asserted : Boolean) : status_t;
|
||||||
function SetRTS(asserted : boolean) : Status_t;
|
function SetRTS(asserted : Boolean) : status_t;
|
||||||
function NumCharsAvailable(var wait_until_this_many : integer) : Status_t;
|
function NumCharsAvailable(var wait_until_this_many : Integer) : status_t;
|
||||||
|
|
||||||
|
function IsCTS : Boolean;
|
||||||
|
function IsDSR : Boolean;
|
||||||
|
function IsRI : Boolean;
|
||||||
|
function IsDCD : Boolean;
|
||||||
|
function WaitForInput : ssize_t;
|
||||||
|
|
||||||
function IsCTS : boolean;
|
function CountDevices : Integer;
|
||||||
function IsDSR : boolean;
|
function GetDeviceName(n : Integer; name : PChar; bufSize : size_t) : status_t;
|
||||||
function IsRI : boolean;
|
|
||||||
function IsDCD : boolean;
|
|
||||||
function WaitForInput : TSSize_t;
|
|
||||||
|
|
||||||
function CountDevices : integer;
|
|
||||||
function GetDeviceName(n : integer; name : PChar; bufSize : Size_t) : Status_t;
|
|
||||||
|
|
||||||
property DataRate : DataRate read GeDataRate write SeDataRate;
|
property DataRate : DataRate read GeDataRate write SeDataRate;
|
||||||
property DataBits : DataBits read GeDataBits write SeDataBits;
|
property DataBits : DataBits read GeDataBits write SeDataBits;
|
||||||
@@ -90,13 +90,13 @@ type
|
|||||||
|
|
||||||
function BSerialPort_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BSerialPort_Create';
|
function BSerialPort_Create(AObject : TBeObject) : TCPlusObject; cdecl; external BePascalLibName name 'BSerialPort_Create';
|
||||||
procedure BSerialPort_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_Free';
|
procedure BSerialPort_Free(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_Free';
|
||||||
function BSerialPort_Open(AObject : TCPlusObject; portName : PChar) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_Open';
|
function BSerialPort_Open(AObject : TCPlusObject; portName : PChar) : status_t; cdecl; external BePascalLibName name 'BSerialPort_Open';
|
||||||
procedure BSerialPort_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_Close';
|
procedure BSerialPort_Close(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_Close';
|
||||||
function BSerialPort_Read(AObject : TCPlusObject; buf : PChar; count : Size_t) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_Read';
|
function BSerialPort_Read(AObject : TCPlusObject; buf : PChar; count : size_t) : ssize_t; cdecl; external BePascalLibName name 'BSerialPort_Read';
|
||||||
function BSerialPort_Write(AObject : TCPlusObject; const buf : PChar; count : Size_t) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_Write';
|
function BSerialPort_Write(AObject : TCPlusObject; const buf : PChar; count : Size_t) : ssize_t; cdecl; external BePascalLibName name 'BSerialPort_Write';
|
||||||
procedure BSerialPort_SetBlocking(AObject : TCPlusObject; Blocking : boolean); cdecl; external BePascalLibName name 'BSerialPort_SetBlocking';
|
procedure BSerialPort_SetBlocking(AObject : TCPlusObject; Blocking : Boolean); cdecl; external BePascalLibName name 'BSerialPort_SetBlocking';
|
||||||
function BSerialPort_SetTimeout(AObject : TCPlusObject; microSeconds : TBigtime_t) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetTimeout';
|
function BSerialPort_SetTimeout(AObject : TCPlusObject; microSeconds : bigtime_t) : status_t; cdecl; external BePascalLibName name 'BSerialPort_SetTimeout';
|
||||||
function BSerialPort_SeDataRate(AObject : TCPlusObject; bitsPerSecond : DataRate) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SeDataRate';
|
function BSerialPort_SeDataRate(AObject : TCPlusObject; bitsPerSecond : DataRate) : status_t; cdecl; external BePascalLibName name 'BSerialPort_SeDataRate';
|
||||||
function BSerialPort_DataRate(AObject : TCPlusObject) : DataRate; cdecl; external BePascalLibName name 'BSerialPort_DataRate';
|
function BSerialPort_DataRate(AObject : TCPlusObject) : DataRate; cdecl; external BePascalLibName name 'BSerialPort_DataRate';
|
||||||
procedure BSerialPort_SeDataBits(AObject : TCPlusObject; numBits : DataBits); cdecl; external BePascalLibName name 'BSerialPort_SeDataBits';
|
procedure BSerialPort_SeDataBits(AObject : TCPlusObject; numBits : DataBits); cdecl; external BePascalLibName name 'BSerialPort_SeDataBits';
|
||||||
function BSerialPort_DataBits(AObject : TCPlusObject) : DataBits; cdecl; external BePascalLibName name 'BSerialPort_DataBits';
|
function BSerialPort_DataBits(AObject : TCPlusObject) : DataBits; cdecl; external BePascalLibName name 'BSerialPort_DataBits';
|
||||||
@@ -108,16 +108,16 @@ procedure BSerialPort_ClearInput(AObject : TCPlusObject); cdecl; external BePasc
|
|||||||
procedure BSerialPort_ClearOutput(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_ClearOutput';
|
procedure BSerialPort_ClearOutput(AObject : TCPlusObject); cdecl; external BePascalLibName name 'BSerialPort_ClearOutput';
|
||||||
procedure BSerialPort_SetFlowControl(AObject : TCPlusObject; method : Cardinal); cdecl; external BePascalLibName name 'BSerialPort_SetFlowControl';
|
procedure BSerialPort_SetFlowControl(AObject : TCPlusObject; method : Cardinal); cdecl; external BePascalLibName name 'BSerialPort_SetFlowControl';
|
||||||
function BSerialPort_FlowControl(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BSerialPort_FlowControl';
|
function BSerialPort_FlowControl(AObject : TCPlusObject) : Cardinal; cdecl; external BePascalLibName name 'BSerialPort_FlowControl';
|
||||||
function BSerialPort_SetDTR(AObject : TCPlusObject; asserted : boolean) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetDTR';
|
function BSerialPort_SetDTR(AObject : TCPlusObject; asserted : Boolean) : status_t; cdecl; external BePascalLibName name 'BSerialPort_SetDTR';
|
||||||
function BSerialPort_SetRTS(AObject : TCPlusObject; asserted : boolean) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_SetRTS';
|
function BSerialPort_SetRTS(AObject : TCPlusObject; asserted : Boolean) : status_t; cdecl; external BePascalLibName name 'BSerialPort_SetRTS';
|
||||||
function BSerialPort_NumCharsAvailable(AObject : TCPlusObject; var wait_until_this_many : integer) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_NumCharsAvailable';
|
function BSerialPort_NumCharsAvailable(AObject : TCPlusObject; var wait_until_this_many : Integer) : Status_t; cdecl; external BePascalLibName name 'BSerialPort_NumCharsAvailable';
|
||||||
function BSerialPort_IsCTS(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsCTS';
|
function BSerialPort_IsCTS(AObject : TCPlusObject) : Boolean; cdecl; external BePascalLibName name 'BSerialPort_IsCTS';
|
||||||
function BSerialPort_IsDSR(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsDSR';
|
function BSerialPort_IsDSR(AObject : TCPlusObject) : Boolean; cdecl; external BePascalLibName name 'BSerialPort_IsDSR';
|
||||||
function BSerialPort_IsRI(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsRI';
|
function BSerialPort_IsRI(AObject : TCPlusObject) : Boolean; cdecl; external BePascalLibName name 'BSerialPort_IsRI';
|
||||||
function BSerialPort_IsDCD(AObject : TCPlusObject) : boolean; cdecl; external BePascalLibName name 'BSerialPort_IsDCD';
|
function BSerialPort_IsDCD(AObject : TCPlusObject) : Boolean; cdecl; external BePascalLibName name 'BSerialPort_IsDCD';
|
||||||
function BSerialPort_WaitForInput(AObject : TCPlusObject) : TSSize_t; cdecl; external BePascalLibName name 'BSerialPort_WaitForInput';
|
function BSerialPort_WaitForInput(AObject : TCPlusObject) : ssize_t; cdecl; external BePascalLibName name 'BSerialPort_WaitForInput';
|
||||||
function BSerialPort_CountDevices(AObject : TCPlusObject) : integer; cdecl; external BePascalLibName name 'BSerialPort_CountDevices';
|
function BSerialPort_CountDevices(AObject : TCPlusObject) : Integer; cdecl; external BePascalLibName name 'BSerialPort_CountDevices';
|
||||||
function BSerialPort_GetDeviceName(AObject : TCPlusObject; n : integer; name : PChar; bufSize : Size_t): Status_t; cdecl; external BePascalLibName name 'BSerialPort_GetDeviceName';
|
function BSerialPort_GetDeviceName(AObject : TCPlusObject; n : Integer; name : PChar; bufSize : Size_t): Status_t; cdecl; external BePascalLibName name 'BSerialPort_GetDeviceName';
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@@ -134,7 +134,7 @@ begin
|
|||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.Open(portName : PChar) : Status_t;
|
function BSerialPort.Open(portName : PChar) : status_t;
|
||||||
begin
|
begin
|
||||||
result := BSerialPort_Open(CPlusObject, portName);
|
result := BSerialPort_Open(CPlusObject, portName);
|
||||||
end;
|
end;
|
||||||
@@ -144,27 +144,27 @@ begin
|
|||||||
BSerialPort_Close(CPlusObject);
|
BSerialPort_Close(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.Read(buf : PChar; count : Size_t) : TSSize_t;
|
function BSerialPort.Read(buf : PChar; count : size_t) : ssize_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_Read(CPlusObject, buf, count);
|
Result := BSerialPort_Read(CPlusObject, buf, count);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.Write(const buf : PChar; count : Size_t) : TSSize_t;
|
function BSerialPort.Write(const buf : PChar; count : size_t) : ssize_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_Write(CPlusObject, buf, count);
|
Result := BSerialPort_Write(CPlusObject, buf, count);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure BSerialPort.SetBlocking(Blocking : boolean);
|
procedure BSerialPort.SetBlocking(Blocking : Boolean);
|
||||||
begin
|
begin
|
||||||
BSerialPort_SetBlocking(CPlusObject, Blocking);
|
BSerialPort_SetBlocking(CPlusObject, Blocking);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.SetTimeout(microSeconds : TBigtime_t) : Status_t;
|
function BSerialPort.SetTimeout(microSeconds : bigtime_t) : status_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_SetTimeout(CPlusObject, microSeconds);
|
Result := BSerialPort_SetTimeout(CPlusObject, microSeconds);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.SeDataRate(bitsPerSecond : DataRate) : Status_t;
|
function BSerialPort.SeDataRate(bitsPerSecond : DataRate) : status_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_SeDataRate(CPlusObject, bitsPerSecond);
|
Result := BSerialPort_SeDataRate(CPlusObject, bitsPerSecond);
|
||||||
end;
|
end;
|
||||||
@@ -224,54 +224,54 @@ begin
|
|||||||
Result := BSerialPort_FlowControl(CPlusObject);
|
Result := BSerialPort_FlowControl(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.SetDTR(asserted : boolean) : Status_t;
|
function BSerialPort.SetDTR(asserted : Boolean) : status_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_SetDTR(CPlusObject, asserted);
|
Result := BSerialPort_SetDTR(CPlusObject, asserted);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.SetRTS(asserted : boolean) : Status_t;
|
function BSerialPort.SetRTS(asserted : Boolean) : status_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_SetRTS(CPlusObject, asserted);
|
Result := BSerialPort_SetRTS(CPlusObject, asserted);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.NumCharsAvailable(var wait_until_this_many : integer) : Status_t;
|
function BSerialPort.NumCharsAvailable(var wait_until_this_many : Integer) : status_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_NumCharsAvailable(CPlusObject, wait_until_this_many);
|
Result := BSerialPort_NumCharsAvailable(CPlusObject, wait_until_this_many);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.IsCTS : boolean;
|
function BSerialPort.IsCTS : Boolean;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_IsCTS(CPlusObject);
|
Result := BSerialPort_IsCTS(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.IsDSR : boolean;
|
function BSerialPort.IsDSR : Boolean;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_IsDSR(CPlusObject);
|
Result := BSerialPort_IsDSR(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.IsRI : boolean;
|
function BSerialPort.IsRI : Boolean;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_IsRI(CPlusObject);
|
Result := BSerialPort_IsRI(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.IsDCD : boolean;
|
function BSerialPort.IsDCD : Boolean;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_IsDCD(CPlusObject);
|
Result := BSerialPort_IsDCD(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.WaitForInput : TSSize_t;
|
function BSerialPort.WaitForInput : ssize_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_WaitForInput(CPlusObject);
|
Result := BSerialPort_WaitForInput(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.CountDevices : integer;
|
function BSerialPort.CountDevices : Integer;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_CountDevices(CPlusObject);
|
Result := BSerialPort_CountDevices(CPlusObject);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function BSerialPort.GetDeviceName(n : integer; name : PChar; bufSize : Size_t) : Status_t;
|
function BSerialPort.GetDeviceName(n : Integer; name : PChar; bufSize : size_t) : status_t;
|
||||||
begin
|
begin
|
||||||
Result := BSerialPort_GetDeviceName(CPlusObject, n, name, bufSize);
|
Result := BSerialPort_GetDeviceName(CPlusObject, n, name, bufSize);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
Reference in New Issue
Block a user