| controller.h | | controller.h | |
| | | | |
| skipping to change at line 43 | | skipping to change at line 43 | |
| namespace Barry { | | namespace Barry { | |
| | | | |
| // forward declarations | | // forward declarations | |
| class SocketRoutingQueue; | | class SocketRoutingQueue; | |
| | | | |
| namespace Mode { | | namespace Mode { | |
| class Mode; | | class Mode; | |
| class IpModem; | | class IpModem; | |
| class Serial; | | class Serial; | |
| class JavaLoader; | | class JavaLoader; | |
|
| | | class JVMDebug; | |
| } | | } | |
| | | | |
| // | | // | |
| // Controller class | | // Controller class | |
| // | | // | |
| /// The main interface class. This class coordinates the communication to | | /// The main interface class. This class coordinates the communication to | |
| /// a single handheld. This class also owns the only Usb::Device object | | /// a single handheld. This class also owns the only Usb::Device object | |
| /// the handheld. All other classes reference this one for the low level | | /// the handheld. All other classes reference this one for the low level | |
| /// device object. This class owns the only SocketZero object as well, | | /// device object. This class owns the only SocketZero object as well, | |
| /// which is the object that any SocketRoutingQueue is plugged into | | /// which is the object that any SocketRoutingQueue is plugged into | |
| | | | |
| skipping to change at line 74 | | skipping to change at line 75 | |
| /// and m_serial.h for these mode classes. You pass | | /// and m_serial.h for these mode classes. You pass | |
| /// your controller object into these mode constructors | | /// your controller object into these mode constructors | |
| /// to create the mode. | | /// to create the mode. | |
| /// | | /// | |
| class BXEXPORT Controller | | class BXEXPORT Controller | |
| { | | { | |
| friend class Barry::Mode::Mode; | | friend class Barry::Mode::Mode; | |
| friend class Barry::Mode::IpModem; | | friend class Barry::Mode::IpModem; | |
| friend class Barry::Mode::Serial; | | friend class Barry::Mode::Serial; | |
| friend class Barry::Mode::JavaLoader; | | friend class Barry::Mode::JavaLoader; | |
|
| | | friend class Barry::Mode::JVMDebug; | |
| | | | |
| public: | | public: | |
| /// Handheld mode type | | /// Handheld mode type | |
| enum ModeType { | | enum ModeType { | |
| Unspecified, //< default on start up (unused) | | Unspecified, //< default on start up (unused) | |
| Bypass, //< unsupported, unknown | | Bypass, //< unsupported, unknown | |
| Desktop, //< desktop mode required for databa
se | | Desktop, //< desktop mode required for databa
se | |
| //< operation | | //< operation | |
| JavaLoader, //< experimental | | JavaLoader, //< experimental | |
|
| | | JVMDebug, //< experimental | |
| UsbSerData, //< GPRS modem support over USB | | UsbSerData, //< GPRS modem support over USB | |
| UsbSerCtrl //< internally used behind the scene
s | | UsbSerCtrl //< internally used behind the scene
s | |
| }; | | }; | |
| | | | |
| private: | | private: | |
| ProbeResult m_result; | | ProbeResult m_result; | |
| Usb::Device m_dev; | | Usb::Device m_dev; | |
| Usb::Interface *m_iface; | | Usb::Interface *m_iface; | |
| uint32_t m_pin; | | uint32_t m_pin; | |
| | | | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 3 lines changed or added | |
|
| data.h | | data.h | |
| | | | |
| skipping to change at line 77 | | skipping to change at line 77 | |
| void ReleaseBuffer(int datasize = -1); | | void ReleaseBuffer(int datasize = -1); | |
| | | | |
| void AppendHexString(const char *str); | | void AppendHexString(const char *str); | |
| | | | |
| /// set buffer to 0 size, but don't bother overwriting memory with 0 | | /// set buffer to 0 size, but don't bother overwriting memory with 0 | |
| void QuickZap() { m_datasize = 0; } | | void QuickZap() { m_datasize = 0; } | |
| void Zap(); // does a memset too | | void Zap(); // does a memset too | |
| | | | |
| Data& operator=(const Data &other); | | Data& operator=(const Data &other); | |
| | | | |
|
| | | // | |
| | | // Utility functions | |
| | | // | |
| | | // Writing data... basically does a memcpy(dst,src,sizeof(src)) | |
| | | // for each type. Does no endian conversions. | |
| | | // dst is calculated as buffer + offset. | |
| | | // The buffer is expanded automatically if needed. | |
| | | // The offset is advanced by the size of the data. | |
| | | // | |
| | | void MemCpy(size_t &offset, const void *src, size_t size); | |
| | | template <class ValueT> | |
| | | void SetValue(size_t &offset, ValueT value) | |
| | | { | |
| | | this->MemCpy(offset, &value, sizeof(value)); | |
| | | } | |
| | | | |
| // static functions | | // static functions | |
| static void PrintAscii(bool setting) { bPrintAscii = setting; } | | static void PrintAscii(bool setting) { bPrintAscii = setting; } | |
| static bool PrintAscii() { return bPrintAscii; } | | static bool PrintAscii() { return bPrintAscii; } | |
| }; | | }; | |
| | | | |
| BXEXPORT std::istream& operator>> (std::istream &is, Data &data); | | BXEXPORT std::istream& operator>> (std::istream &is, Data &data); | |
| BXEXPORT std::ostream& operator<< (std::ostream &os, const Data &data); | | BXEXPORT std::ostream& operator<< (std::ostream &os, const Data &data); | |
| | | | |
| class BXEXPORT Diff | | class BXEXPORT Diff | |
| { | | { | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 16 lines changed or added | |
|
| protocol.h | | protocol.h | |
| | | | |
| skipping to change at line 87 | | skipping to change at line 87 | |
| #define SB_COMMAND_JL_READY 0x01 | | #define SB_COMMAND_JL_READY 0x01 | |
| #define SB_COMMAND_JL_RESET_REQUIRED 0x78 // Occurs after GOODBYE when
handheld reset is required | | #define SB_COMMAND_JL_RESET_REQUIRED 0x78 // Occurs after GOODBYE when
handheld reset is required | |
| #define SB_COMMAND_JL_COD_IN_USE 0x6c // Perhaps "BUSY" is also a
good name? | | #define SB_COMMAND_JL_COD_IN_USE 0x6c // Perhaps "BUSY" is also a
good name? | |
| #define SB_COMMAND_JL_COD_NOT_FOUND 0x69 | | #define SB_COMMAND_JL_COD_NOT_FOUND 0x69 | |
| #define SB_COMMAND_JL_NOT_SUPPORTED 0x71 // Occurs when device does n
ot support a command | | #define SB_COMMAND_JL_NOT_SUPPORTED 0x71 // Occurs when device does n
ot support a command | |
| | | | |
| // JavaLoader data | | // JavaLoader data | |
| #define SB_DATA_JL_SUCCESS 0x64 // Device has accepted the d
ata packet | | #define SB_DATA_JL_SUCCESS 0x64 // Device has accepted the d
ata packet | |
| #define SB_DATA_JL_INVALID 0x68 // Device returns this code
if the application isn't valid. | | #define SB_DATA_JL_INVALID 0x68 // Device returns this code
if the application isn't valid. | |
| | | | |
|
| | | // JDWP Command set list | |
| | | #define JDWP_CMDSET_VIRTUALMACHINE 1 | |
| | | #define JDWP_CMDSET_REFERECENTYPE 2 | |
| | | #define JDWP_CMDSET_CLASSTYPE 3 | |
| | | #define JDWP_CMDSET_ARRAYTYPE 4 | |
| | | #define JDWP_CMDSET_INTERFACETYPE 5 | |
| | | #define JDWP_CMDSET_METHOD 6 | |
| | | #define JDWP_CMDSET_FIELD 8 | |
| | | #define JDWP_CMDSET_OBJECTREFERENCE 9 | |
| | | #define JDWP_CMDSET_STRINGREFERENCE 10 | |
| | | #define JDWP_CMDSET_THREADREFERENCE 11 | |
| | | #define JDWP_CMDSET_THREADGROUPREFERENCE 12 | |
| | | #define JDWP_CMDSET_ARRAYREFERENCE 13 | |
| | | #define JDWP_CMDSET_CLASSLOADERREFERENCE 14 | |
| | | #define JDWP_CMDSET_EVENTREQUEST 15 | |
| | | #define JDWP_CMDSET_STACKFRAME 16 | |
| | | #define JDWP_CMDSET_CLASSOBJECTREFERENCE 17 | |
| | | #define JDWP_CMDSET_EVENT 64 | |
| | | | |
| | | // JDWP Command list - VirtualMachine | |
| | | #define JDWP_CMD_VERSION 1 | |
| | | #define JDWP_CMD_ALLCLASSES 3 | |
| | | #define JDWP_CMD_ALLTHREADS 4 | |
| | | #define JDWP_CMD_DISPOSE 6 | |
| | | #define JDWP_CMD_IDSIZES 7 | |
| | | #define JDWP_CMD_SUSPEND 8 | |
| | | #define JDWP_CMD_RESUME 9 | |
| | | #define JDWP_CMD_CLASSPATHS 13 | |
| | | | |
| | | // JDWP Command list - EventRequest | |
| | | #define JDWP_CMD_SET 1 | |
| | | | |
| | | // JVMDebug commands | |
| | | #define SB_COMMAND_JVM_UNKNOWN01 0x53 | |
| | | #define SB_COMMAND_JVM_UNKNOWN02 0x01 | |
| | | #define SB_COMMAND_JVM_UNKNOWN03 0x6f | |
| | | #define SB_COMMAND_JVM_UNKNOWN04 0x8a | |
| | | #define SB_COMMAND_JVM_UNKNOWN05 0x90 | |
| | | #define SB_COMMAND_JVM_UNKNOWN06 0x44 | |
| | | #define SB_COMMAND_JVM_UNKNOWN07 0x45 | |
| | | #define SB_COMMAND_JVM_UNKNOWN08 0x54 | |
| | | #define SB_COMMAND_JVM_UNKNOWN09 0x33 | |
| | | #define SB_COMMAND_JVM_UNKNOWN10 0x46 | |
| | | | |
| | | #define SB_COMMAND_JVM_UNKNOWN11 0x0e | |
| | | #define SB_COMMAND_JVM_UNKNOWN12 0x50 | |
| | | #define SB_COMMAND_JVM_UNKNOWN13 0x0d | |
| | | #define SB_COMMAND_JVM_UNKNOWN14 0x85 | |
| | | #define SB_COMMAND_JVM_UNKNOWN15 0x84 | |
| | | | |
| | | #define SB_COMMAND_JVM_GET_MODULES_LIST 0x8d // Get all Java modu | |
| | | les list with their address and ID | |
| | | #define SB_COMMAND_JVM_GET_THREADS_LIST 0x08 // Get all threads c | |
| | | urrently running in the virtual machine | |
| | | #define SB_COMMAND_JVM_GET_CONSOLE_MSG 0x40 // Get console message | |
| | | #define SB_COMMAND_JVM_GO 0x02 // Go | |
| | | #define SB_COMMAND_JVM_GET_STATUS 0x06 // Get status | |
| | | #define SB_COMMAND_JVM_SET_BREAKPOINT 0x21 // Set breakpoint | |
| | | #define SB_COMMAND_JVM_RM_BREAKPOINT 0x22 // Remove breakpoint | |
| | | | |
| | | #define SB_COMMAND_JVM_STOP 0xa502 | |
| | | | |
| | | // JavaDebug response | |
| | | #define SB_COMMAND_JVM_GET_DATA_ENTRY 0x06 | |
| | | | |
| // mode constants | | // mode constants | |
| #define SB_MODE_REQUEST_SOCKET 0x00ff | | #define SB_MODE_REQUEST_SOCKET 0x00ff | |
| | | | |
| // object and attribute ID codes (for ZeroPacket::GetAttribute()) | | // object and attribute ID codes (for ZeroPacket::GetAttribute()) | |
| // meanings for most of these are unknown | | // meanings for most of these are unknown | |
| #define SB_OBJECT_INITIAL_UNKNOWN 0x14 | | #define SB_OBJECT_INITIAL_UNKNOWN 0x14 | |
| #define SB_ATTR_INITIAL_UNKNOWN 0x01 | | #define SB_ATTR_INITIAL_UNKNOWN 0x01 | |
| #define SB_OBJECT_PROFILE 0x08 | | #define SB_OBJECT_PROFILE 0x08 | |
| #define SB_ATTR_PROFILE_DESC 0x02 | | #define SB_ATTR_PROFILE_DESC 0x02 | |
| #define SB_ATTR_PROFILE_PIN 0x04 | | #define SB_ATTR_PROFILE_PIN 0x04 | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 65 lines changed or added | |
|
| router.h | | router.h | |
| | | | |
| skipping to change at line 99 | | skipping to change at line 99 | |
| void ReturnBuffer(Data *buf); | | void ReturnBuffer(Data *buf); | |
| | | | |
| // Thread function for the simple read behaviour... thread is | | // Thread function for the simple read behaviour... thread is | |
| // created in the SpinoffSimpleReadThread() member below. | | // created in the SpinoffSimpleReadThread() member below. | |
| static void *SimpleReadThread(void *userptr); | | static void *SimpleReadThread(void *userptr); | |
| | | | |
| public: | | public: | |
| SocketRoutingQueue(int prealloc_buffer_count = 4); | | SocketRoutingQueue(int prealloc_buffer_count = 4); | |
| ~SocketRoutingQueue(); | | ~SocketRoutingQueue(); | |
| | | | |
|
| | | // | |
| | | // data access | |
| | | // | |
| | | int GetWriteEp() const { return m_writeEp; } | |
| | | int GetReadEp() const { return m_readEp; } | |
| | | | |
| // These functions connect the router to an external Usb::Device | | // These functions connect the router to an external Usb::Device | |
| // object. Normally this is handled automatically by the | | // object. Normally this is handled automatically by the | |
| // Controller class, but are public here in case they are needed. | | // Controller class, but are public here in case they are needed. | |
| void SetUsbDevice(Usb::Device *dev, int writeEp, int readEp); | | void SetUsbDevice(Usb::Device *dev, int writeEp, int readEp); | |
| void ClearUsbDevice(); | | void ClearUsbDevice(); | |
| bool UsbDeviceReady(); | | bool UsbDeviceReady(); | |
| Usb::Device* GetUsbDevice() { return m_dev; } | | Usb::Device* GetUsbDevice() { return m_dev; } | |
| | | | |
| // This class starts out with no buffers, and will grow one buffer | | // This class starts out with no buffers, and will grow one buffer | |
| // at a time if needed. Call this to allocate count buffers | | // at a time if needed. Call this to allocate count buffers | |
| | | | |
End of changes. 1 change blocks. |
| 0 lines changed or deleted | | 6 lines changed or added | |
|
| socket.h | | socket.h | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| #include <queue> | | #include <queue> | |
| #include <memory> | | #include <memory> | |
| #include "router.h" | | #include "router.h" | |
| | | | |
| // forward declarations | | // forward declarations | |
| namespace Usb { class Device; } | | namespace Usb { class Device; } | |
| namespace Barry { | | namespace Barry { | |
| class Data; | | class Data; | |
| class Packet; | | class Packet; | |
| class JLPacket; | | class JLPacket; | |
|
| | | class JVMPacket; | |
| class SocketRoutingQueue; | | class SocketRoutingQueue; | |
| } | | } | |
| | | | |
| namespace Barry { | | namespace Barry { | |
| | | | |
| class Socket; | | class Socket; | |
| typedef std::auto_ptr<Socket> SocketHandle; | | typedef std::auto_ptr<Socket> SocketHandle; | |
| | | | |
| class BXEXPORT SocketZero | | class BXEXPORT SocketZero | |
| { | | { | |
| | | | |
| skipping to change at line 159 | | skipping to change at line 160 | |
| | | | |
| // Send and Receive are available before Open... | | // Send and Receive are available before Open... | |
| // an unopened socket defaults to socket 0, which you need | | // an unopened socket defaults to socket 0, which you need | |
| // in order to set the blackberry mode | | // in order to set the blackberry mode | |
| // The send function will overwrite the zeroSocketSequence byte | | // The send function will overwrite the zeroSocketSequence byte | |
| // *inside* the packet, if the current m_socket is 0. | | // *inside* the packet, if the current m_socket is 0. | |
| void Send(Data &send, int timeout = -1); // send only | | void Send(Data &send, int timeout = -1); // send only | |
| void Send(Data &send, Data &receive, int timeout = -1); // send+recv | | void Send(Data &send, Data &receive, int timeout = -1); // send+recv | |
| void Send(Barry::Packet &packet, int timeout = -1); | | void Send(Barry::Packet &packet, int timeout = -1); | |
| void Receive(Data &receive, int timeout = -1); | | void Receive(Data &receive, int timeout = -1); | |
|
| | | void ReceiveData(Data &receive, int timeout = -1); | |
| | | | |
| // sends the send packet down to the device, fragmenting if | | // sends the send packet down to the device, fragmenting if | |
| // necessary, and returns the response in receive, defragmenting | | // necessary, and returns the response in receive, defragmenting | |
| // if needed | | // if needed | |
| // Blocks until response received or timed out in Usb::Device | | // Blocks until response received or timed out in Usb::Device | |
| void Packet(Data &send, Data &receive, int timeout = -1); | | void Packet(Data &send, Data &receive, int timeout = -1); | |
| void Packet(Barry::Packet &packet, int timeout = -1); | | void Packet(Barry::Packet &packet, int timeout = -1); | |
| void Packet(Barry::JLPacket &packet, int timeout = -1); | | void Packet(Barry::JLPacket &packet, int timeout = -1); | |
|
| | | void Packet(Barry::JVMPacket &packet, int timeout = -1); | |
| | | | |
| | | // Use this function to send packet to JVM instead of Packet functio | |
| | | n | |
| | | void InitSequence(int timeout = -1); | |
| | | void PacketJVM(Data &send, Data &receive, int timeout = -1); | |
| | | | |
| // Use this function to send data packet instead of Packet function | | // Use this function to send data packet instead of Packet function | |
| // Indeed, Packet function is used to send command (and not data) | | // Indeed, Packet function is used to send command (and not data) | |
| void PacketData(Data &send, Data &receive, int timeout = -1); | | void PacketData(Data &send, Data &receive, int timeout = -1); | |
| | | | |
| // some handy wrappers for the Packet() interface | | // some handy wrappers for the Packet() interface | |
| void NextRecord(Data &receive); | | void NextRecord(Data &receive); | |
| | | | |
| // Register a callback for incoming data from the device. | | // Register a callback for incoming data from the device. | |
| // This function assumes that this socket is based on a socketZero | | // This function assumes that this socket is based on a socketZero | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 8 lines changed or added | |
|