📄 motop2kmode readme eng.txt
字号:
unit MotoP2KMode;
interface
uses
Windows, Messages, SysUtils, MotoSysUtils, Classes, USBCtrls;
const
SeemBufSize = 10000;
type
// attribute of a file
TP2KFileAttr = set of (pfaReadOnly, // ReadOnly
pfaHidden, // Hidden
pfaSystem, // System
pfaVolume, // Volume
pfaDirectory, // Directory
pfaArchive, // to not use
pfaNDIS, // to not use
pfaOnlyOpen); // Default
TP2KFileSeekParam = (sbyPos,sbyStartPos,sbyEndPos);
TP2KFile = record
Size: LongWord;
Attr: TP2KFileAttr;
Name: string;
end;
PP2KFile = ^TP2KFile;
TP2KFiles = array of TP2KFile;
PP2KFiles = ^TP2KFiles;
TP2KProgressFile = function(AFile:TP2KFile):boolean;
TP2KProgressCopyFile = function(Pos,Size:integer):boolean;
TP2KBuff = type tbytearray;
PP2KBuff = ^TP2KBuff;
TSeemBuff = array[0..SeemBufSize] of byte;
PSeemBuff = ^TSeemBuff;
TCameraFormat = (cfVGA,
cfQVGA,
cfSQVGA,
cfQQVGA,
cfQQQVGA,
cfCIF,
cfQCIF,
cfSQCIF,
cf1280x960,
cf1280x1024);
// Additional commands of management of the camera
TCameraOption = (coAmbientLigth, // AmbientLigth
coExposure, // Exposure
coLigthSource); // LigthSource
TKeys = (key0,key1,key2,key3,key4,key5,key6,key7,key8,key9, // 0..9
keyZ,keyR, // *,#
keyOptLeft,keyOptRigth2,keyOptRigth,KeyOptMenu,
keyConnect,keyDisconnect,
keyVolumeUp,keyVolumeDown,
keySmart,
keyJoyUp,keyJoyDown,keyJoyLeft,keyJoyRigth,keyJoyMenu
);
TVersionMode = (vmPlatform,
vmDSP,
vmHardware,
vmLanguagePackID,
vmRelease,
vmGPSChipset,
vmDRM,
vmAPPlatform,
vmPreloadedContent,
vmAPLanguagePack,
vmAPSetup);
TAudioFunc = (afVibrationOn,
afVibrationOff,
afSideToneOn,
afSideToneOff,
afEchoCnclOn,
afEchoCnclOff,
afNoiseSuppOn,
afNoiseSuppOff);
TLedsMode = (lmKeyBoardOn, // Leds KeyBoard On
lmKeyBoardOff, // Leds KeyBoard Off
lmMainDisplayOn, // Leds Display On
lmMainDisplayOff, // Leds Display Off
// Leds Colour of the ext keyboard:
lmExtKeyboardBlack, // Black (off)
lmExtKeyboardRed, // Red
lmExtKeyboardGreen, // Green
lmExtKeyboardYellow, // Yellow
lmExtKeyboardBlue, // Blue
lmExtKeyboardMagenta, // Magenta
lmExtKeyboardCyan, // Cyan
lmExtKeyboarWhite); // White
type
TDebugType = (dtInformation,dtError);
type
TP2KDebugEvent = procedure(const AItem:TMotoP2KModemItem; const ADebugText:string;
const ADebugType:TDebugType; const ASubError:boolean) of object;
TMotoP2KModemItem = class(TCollectionItem)
public
function IsOpened : boolean; // Whether checks is open the device
function Open : boolean; // Open the device
function Close : boolean; // Close the device
function Restart : boolean; // Generate a software restart
function Suspend(Active:boolean) : boolean; // terminate normal mode and enter test mode
function isSuspend : boolean; // Whether checks is enter test mode the device
function PowerOff : boolean; // Power down the device
// Camera - This command allows the user to control the camera in the device. This command is only available on products that support a camera.
function CameraInicialization(Option:TCameraFormat) : boolean; // Initialization of management of the camera. Option - Type of expansion
function CameraDeInicialization : boolean; // DeInitialization of management of the camera
function CameraFoto(FileName:string) : boolean; // To make a snapshot of the camera. FileName - Name of a file on the device
function CameraOption(Option:TCameraOption; Value:byte) : boolean; // Additional commands of management of the camera
// Switching of modes
function SwitchATMode : boolean; // P2k to AT mode
function SwitchFlash : boolean; // P2k to Flash mode
function SwitchTest : boolean; // P2k to Test mode. Do not use this mode.
// Seem
function SeemRead( // Reading Seem of the device
Seem, // Seem in HEX format
Rec, // Record in HEX format
Ofs, // Position of start of reading. If 0 that at first
Size:word; // The size of reading. If 0 that all
var Data: TSeemBuff; // The buffer of a conclusion
var DataSize:Word // The size of the Buffer of a conclusion
):boolean;
function SeemWrite( // Writing Seem of the device
Seem, // Seem in HEX format
Rec, // Record in HEX format
Ofs, // Position of start of reading. If 0 that at first
Size:word; // The size of the Buffer of input. Necessarily it is more 0
const Data: TSeemBuff // The buffer of input
):boolean;
// Info
function SeemGetPhoneModel : string; // Reception of Model of the telephone
function SeemSetPhoneModel(Model:string):boolean; // Establishment of Model of the telephone
function SeemGetFlexVersion : string; // Reception of Flex version of the telephone
function SeemSetFlexVersion(Flex:string):boolean; // Establishment of Flex version of the telephone
function SeemGetUnblockCode : string; // Reception of Unblock Code of the telephone
function SeemSetUnblockCode(Code:string):boolean; // Reception of Unblock Code of the telephone
function SeemGetProtectiveCode : string; // Reception of Protective Code of the telephone
function SeemSetProtectiveCode(Code:string):boolean; // Reception of Protective Code of the telephone
function SeemGetIMEI : string; // Reception of IMEI of the telephone
function SeemGetIMSI : string; // Reception of IMSI of the telephone
function SeemGetPDSVersion : string; // Reception of PDS version of the telephone
function InfoGetVersion(Mode:TVersionMode) : string; // Reception of the additional information
function KeysDown(Key:TKeys):boolean; // Perform key strokes
function ControlAudioFunc(AudioFunc:TAudioFunc) : boolean; // Testing of the command. Do not use the given command
function Leds(LedsMode:TLedsMode):boolean; // Handles the leds on the display
// Activates different file system requests to and from phone
function DrivesGetList:string; // Reception of the list of disks of the telephone. A separator is symbols #13#10
function DrivesGetFreeSpase(Drive:string):integer; // Reception of the size of free space on a disk
// File
function FileGetCount(FileMask:string='*'):integer; // Reception of length of the found files on a mask
function FileGetList( // Reception of the list of files
const FileCount:integer; // length of files. Result of function FileGetCount
List:TP2KFiles; // The buffer of reception. Can be nil
Progress:TP2KProgressFile // Progress of reception of the list of files. Can be nil
):boolean;
function FileDelete( // Deleting of a file
const FileName:string // Name of a file
):boolean;
function FileSetAttr( // Change of attribute of a file
const FileName:string; // Name of a file
const Attr:TP2KFileAttr // attribute of a file
):boolean;
function FileDownload( // Downloading of a file from the telephone on the computer
const FileName, // Name of a file on telephone
NewFileName:string; // Name of a file on computer
BuffSize, // The size of the buffer. No more than 4096 bytes. recommend 4000;
FileSize:integer; // The size of a file on the telephone. Is necessary for progress. Can be 0
AProgress:TP2KProgressCopyFile // Progress of copying
):boolean;
function FileUpload( // Uploading of a file from the computer on the telephone
const FileName, // Name of a file on computer
NewFileName:string; // Name of a file on telephone
BuffSize:integer; // The size of the buffer. No more than 1024 bytes. recommend 1000;
AProgress:TP2KProgressCopyFile // Progress of copying
):boolean;
// To not use the following procedures, If you not the expert
function FRACFileOpen(const FileName:string;const FileAttr: TP2KFileAttr):boolean;
function FRACFileRead(var Buff:PP2KBuff; const BuffSize:integer):integer;
function FRACFileWrite(const BuffSize:integer; const Buff:PP2KBuff):boolean;
function FRACFileSeec(const Seec:integer;SeekParam:TP2KFileSeekParam):boolean;
function FRACFileClose:boolean;
published
property ModemInfo: TUSBDevice read FModemInfo; // USB the information on the device
end;
TMotoP2KModemList = class(TCollection)
public
function GetItemID(ID:cardinal):TMotoP2KModemItem; // Reception of the device on DeviceID
procedure Update; // To update the list of the found devices
property Items[Index:integer]:TMotoP2KModemItem; // To receive the device on its index
end;
TMotoP2KMode = class(TComponent)
published
property About: string; // The information on components
property DeviceList : TMotoP2KModemList; // The list of the found devices
property OnArrival: TNotifyEvent; // Event at connection of the new device. Can be carried out and at connection not only telephone
property OnRemove: TNotifyEvent; // Event at disconnect of the old device. Can be carried out and at connection not only telephone
property OnDebug: TP2KDebugEvent; // Event at dubug: Broad gully of operations;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -