Package libprs500 :: Module prstypes :: Class Command
[hide private]
[frames] | no frames]

Class Command

source code


Defines the structure of command packets sent to the device.

Instance Methods [hide private]
  __init__(self, packet)

Inherited from TransferBuffer: __add__, __getslice__, __str__, pack, unpack

Inherited from TransferBuffer (private): _normalize

Inherited from list: __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __gt__, __hash__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__


Class Methods [hide private]

Inherited from TransferBuffer: phex


Class Variables [hide private]
  number = An unsigned int stored in 4 bytes starting at byte 0
Command number.
  type = An unsigned long long stored in 8 bytes starting at ...
Known types are 0x00 and 0x01.
  length = An unsigned int stored in 4 bytes starting at byte 12
Length of the data part of this packet

Properties [hide private]
  data
The data part of this command.

Inherited from object: __class__


Method Details [hide private]

__init__(self, packet)
(Constructor)

source code 
Parameters:
  • packet - len(packet) > 15 or packet > 15
Overrides: TransferBuffer.__init__

Class Variable Details [hide private]

number


Command number. C{unsigned int} stored in 4 bytes at byte 0.

Command numbers are:
     0 GetUsbProtocolVersion
     1 ReqUsbConnect
    
    10 FskFileOpen
    11 FskFileClose
    12 FskGetSize
    13 FskSetSize
    14 FskFileSetPosition
    15 FskGetPosition
    16 FskFileRead
    17 FskFileWrite
    18 FskFileGetFileInfo
    19 FskFileSetFileInfo
    1A FskFileCreate
    1B FskFileDelete
    1C FskFileRename
    
    30 FskFileCreateDirectory
    31 FskFileDeleteDirectory
    32 FskFileRenameDirectory
    33 FskDirectoryIteratorNew
    34 FskDirectoryIteratorDispose
    35 FskDirectoryIteratorGetNext
    
    52 FskVolumeGetInfo
    53 FskVolumeGetInfoFromPath
    
    80 FskFileTerminate
   
   100 ConnectDevice
   101 GetProperty
   102 GetMediaInfo
   103 GetFreeSpace
   104 SetTime
   105 DeviceBeginEnd
   106 UnlockDevice
   107 SetBulkSize 
   
   110 GetHttpRequest
   111 SetHttpRespponse
   112 Needregistration
   114 GetMarlinState
  
   200 ReqDiwStart
   201 SetDiwPersonalkey
   202 GetDiwPersonalkey
   203 SetDiwDhkey
   204 GetDiwDhkey
   205 SetDiwChallengeserver
   206 GetDiwChallengeserver
   207 GetDiwChallengeclient
   208 SetDiwChallengeclient
   209 GetDiwVersion
   20A SetDiwWriteid
   20B GetDiwWriteid
   20C SetDiwSerial
   20D GetDiwModel
   20C SetDiwSerial
   20E GetDiwDeviceid
   20F GetDiwSerial
   210 ReqDiwCheckservicedata
   211 ReqDiwCheckiddata
   212 ReqDiwCheckserialdata
   213 ReqDiwFactoryinitialize
   214 GetDiwMacaddress
   215 ReqDiwTest
   216 ReqDiwDeletekey
  
   300 UpdateChangemode
   301 UpdateDeletePartition
   302 UpdateCreatePartition
   303 UpdateCreatePartitionWithImage
   304 UpdateGetPartitionSize

Value:
An unsigned int stored in 4 bytes starting at byte 0                   
      

type

Known types are 0x00 and 0x01. Acknowledge commands are always type 0x00
Value:
An unsigned long long stored in 8 bytes starting at byte 4             
      

length

Length of the data part of this packet
Value:
An unsigned int stored in 4 bytes starting at byte 12                  
      

Property Details [hide private]

data

The data part of this command. Returned/set as/by a TransferBuffer. Stored at byte 16.

Setting it by default changes self.length to the length of the new buffer. You may have to reset it to the significant part of the buffer. You would normally use the command property of ShortCommand or LongCommand instead.
Get Method:
unreachable.fget(self)
Set Method:
unreachable.fset(self, buffer)
Delete Method:
None