23 #ifndef _USB_PACKET_H_
24 #define _USB_PACKET_H_
27 #include <libplayercommon/playercommon.h>
31 unsigned char usb_message_header;
32 unsigned char usb_command_identifier;
33 unsigned char command_type;
34 unsigned char unused0;
35 unsigned char unused1;
36 unsigned char unused2;
37 unsigned short can_message_header;
38 unsigned char unused3;
39 unsigned char can_message[8];
40 unsigned char usb_message_checksum;
44 unsigned char pkt_data[18];
51 unsigned short make_can_header(
long id,
unsigned int dlc,
unsigned int flags );
52 unsigned char compute_checksum();
57 typedef enum { CANA_DEV, USB_CMD_RESET } CommandType;
76 USBIO() { fd = -1; synced =
false; }
77 int Init(
const char *dev);
T min(T a, T b)
Return the minimum of a, b.
Definition: utility.h:91
#define PLAYER_WARN1(msg, a)
Definition: error.h:90
Definition: usb_packet.h:30
#define PLAYER_MSG3(level, msg, a, b, c)
Definition: error.h:108
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
Definition: usb_packet.h:71
Generic message header.
Definition: player.h:162
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
virtual void Main(void)=0
Main method for driver thread.
int ReadInt(int section, const char *name, int value)
Read an integer value.
double ReadLength(int section, const char *name, double value)
Read a length (includes unit conversion, if any).
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:95
#define PLAYER_ERROR2(msg, a, b)
Definition: error.h:83
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
virtual int MainSetup()
Sets up the resources needed by the driver thread.
Definition: imagebase.cc:83
virtual void MainQuit()
Cleanup method for driver thread (called when main exits)
Definition: imagebase.cc:104
Definition: imagebase.h:62
int ReadDeviceAddr(player_devaddr_t *addr, int section, const char *name, int code, int index, const char *key)
Read a device id.
Class for loading configuration file information.
Definition: configfile.h:197
A device address.
Definition: player.h:146
An autopointer for the message queue.
Definition: message.h:74
#define PLAYER_ERROR1(msg, a)
Definition: error.h:82
#define PLAYER_ERROR(msg)
Definition: error.h:81
Base class for drivers which oeprate with a thread.
Definition: driver.h:553
Definition: usb_packet.h:48
Base class for all drivers.
Definition: driver.h:109
Definition: usb_packet.h:43
#define PLAYER_MSG0(level, msg)
General messages.
Definition: error.h:105
#define PLAYER_MSG2(level, msg, a, b)
Definition: error.h:107
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76
T max(T a, T b)
Return the maximum of a, b.
Definition: utility.h:104