Модуль "Obex" - основные константы и переменные

Рубрика: Исходники
Среда, 21 апреля 2010 г.
Просмотров: 153
последняя версия: 3.0.9 build 961 beta
от 07 декабря 2007 г.
unit uObex;
interface
// Use "IrDA OBEX Protocol v1.2" for more information.
// Use "TMS Async32" helps for more information.
const // Packet types
      opcode_Connect    = $80;
      opcode_Disconnect = $81;
      opcode_Put        = $02;
      opcode_PutLast    = $82;
      opcode_Get        = $03;
      opcode_GetLast    = $83;
      opcode_SetPath    = $85;
      opcode_Abort      = $0FF;

      // Header types
      hdr_Count         = $0C0;
      hdr_Name          = $001;
      hdr_Type          = $042;
      hdr_Length        = $0C3;
      hdr_Time          = $044;
      hdr_Target        = $005;
      hdr_Body          = $048;
      hdr_BodyEnd       = $049;
      hdr_ConnectionID  = $0CB;
      hdr_ObjectClass   = $04F;
      // Response codes
      res_Continue      = $010;
      res_ContinueLast  = $090;
      res_OK            = $020;
      res_OKLast        = $0A0;
      res_NotModified   = $0B4;
      res_BadRequest    = $0C0;
      res_Unauthorized  = $0C1;
      res_TimeOut       = $0C8;
      res_MediaFail     = $0CF;
      res_Forbidden     = $0C3;
      res_NotFound      = $0C4;
      res_NoSpace       = $0CD;
      // Image indexes
      img_Unknown       = 0;
      img_JPEG          = 1;
      img_GIF           = 2;
      img_3GPP          = 3;
      img_MP3           = 4;
      img_Folder        = 5;    
type
     // Really user smaller (for V635 = 2048), but stay 8K for compatible with protocol.
     TBuffer  = array [0..8191] of byte;
     PBuffer  = ^TBuffer;
var // Sings = all supported response codes
    // ErrSigns = error response codes
    Signs:       set of byte = [res_Continue, res_ContinueLast, res_OK, res_OKLast, res_NotModified, res_BadRequest,
                                res_Unauthorized, res_TimeOut, res_MediaFail, res_Forbidden, res_NotFound, res_NoSpace];
    ErrSigns:    set of byte = [res_NotModified, res_BadRequest, res_Unauthorized, res_TimeOut, res_MediaFail,
                                res_Forbidden, res_NotFound, res_NoSpace];
    Buffer:      TBuffer;
    BufLen:      Word = 0;
    OBEX_Opened: Boolean = False;     // OBEX connected?
    DL_Mode:     Boolean = False;     // Download mode?
    UL_Mode:     Boolean = False;     // Upload mode?
    AbortTrans:  Boolean = False;     // Abort current transaction?
    StopEvent:   Boolean = False;     // Stop port notifier handling (app close)&
    // "SETPATH" request pattern (w/o "Name" header). Ready for "Parent" jump.
    PatternDir:  array [0..9] of char  = #$85#$00#$0A#$02#$00#$CB#$00#$00#$00#$00;
    PatternDir2:  array [0..9] of char  = #$85#$00#$0A#$02#$00#$CB#$00#$00#$00#$01;
    // "SETPATH" Root request (for "Root" jump)
    RootDir:     array [0..12] of char = #$85#$00#$0D#$02#$00#$CB#$00#$00#$00#$00#$01#$00#$03;
    RootDir2:     array [0..12] of char = #$85#$00#$0D#$02#$00#$CB#$00#$00#$00#$01#$01#$00#$03;
    // "GET" <folder> request
    GetPathCmd:  array [0..37] of char = #$83#$00#$26#$CB#$00#$00#$00#$00#$01#$00#$05#$00#$00#$42#$00#$19'x-obex/folder-listing'#0;
    GetPathCmd2:  array [0..37] of char = #$83#$00#$26#$CB#$00#$00#$00#$01#$01#$00#$05#$00#$00#$42#$00#$19'x-obex/folder-listing'#0;
    // "CONNECT" request
    ConnStr:     array [0..25] of char = #$80#$00#$1A#$12#$00#$20#$00#$46#$00#$13#$F9#$EC#$7B#$C4#$95#$3C#$11#$D2#$98#$4E#$52#$54#$00#$DC#$9E#$09;
    //                                     80  00  1A  12  00  20  00  46  00  13  F9  EC 7 B  C4  95  3C  11  D2  98  4E  52  54  00  DC  9E  09
    
    // "DISCONNECT" request
    DisConnStr:   array [0..7] of char  = #$81#$00#$08#$CB#$00#$00#$00#$00;
    DisConnStr2:  array [0..7] of char  = #$81#$00#$08#$CB#$00#$00#$00#$01;
    //  81 00 08 CB 00 00 00 01
    
    // "GET" file request
    GetFile:     array [0..10] of char = #$83#$FF#$FF#$CB#$00#$00#$00#$00#$01#$FF#$FF;
    GetFile2:     array [0..10] of char = #$83#$FF#$FF#$CB#$00#$00#$00#$01#$01#$FF#$FF;
    // "PUT (DELETE)" file request
    DelFile:     array [0..10] of char = #$82#$FF#$FF#$CB#$00#$00#$00#$00#$01#$FF#$FF;
    DelFile2:     array [0..10] of char = #$82#$FF#$FF#$CB#$00#$00#$00#$01#$01#$FF#$FF;
    // "PUT" file request
    PutFile:     array [0..15] of char = #$82#$FF#$FF#$CB#$00#$00#$00#$00#$C3#$00#$00#$FF#$FF#$01#$FF#$FF;
    PutFile2:     array [0..15] of char = #$82#$FF#$FF#$CB#$00#$00#$00#$01#$C3#$00#$00#$FF#$FF#$01#$FF#$FF;
Rambler's Top100