Browse Source

fixed stuff

feature/2015
Hans-Gert Dahmen 13 years ago
parent
commit
fe8f3302c0
  1. 29
      can/lap.h

29
can/lap.h

@ -13,28 +13,28 @@
* Types * Types
*/ */
// "inherits" from can_message // "inherits" from can_message
typedef struct { typedef struct {
can_addr addr_src; can_addr addr_src;
can_addr addr_dst; can_addr addr_dst;
can_port port_src; can_port port_src;
can_port port_dst; can_port port_dst;
unsigned char dlc; unsigned char dlc;
unsigned char cmd; unsigned char cmd;
uint16_t index; uint16_t index;
uint16_t size; uint16_t size;
uint16_t address; uint16_t address;
} sdo_message; } sdo_message;
// "inherits" from can_message // "inherits" from can_message
typedef struct{ typedef struct{
can_addr addr_src; can_addr addr_src;
can_addr addr_dst; can_addr addr_dst;
can_port port_src; can_port port_src;
can_port port_dst; can_port port_dst;
unsigned char dlc; unsigned char dlc;
unsigned char cmd; unsigned char cmd;
unsigned char data[7]; unsigned char data[7];
} pdo_message; } pdo_message;
/**************************************************************************** /****************************************************************************
@ -44,13 +44,13 @@ typedef struct{
typedef enum { PORT_MGT=0x30, PORT_LAMPE=0x20, PORT_SDO=0x15, PORT_SDO_DATA=0x16, PORT_LAPD=0x18, typedef enum { PORT_MGT=0x30, PORT_LAMPE=0x20, PORT_SDO=0x15, PORT_SDO_DATA=0x16, PORT_LAPD=0x18,
PORT_BORG=0x23, PORT_MOOD=0x17, PORT_REMOTE=0x21, PORT_GATE=0x22, PORT_CHUCK=0x26 } ports; PORT_BORG=0x23, PORT_MOOD=0x17, PORT_REMOTE=0x21, PORT_GATE=0x22, PORT_CHUCK=0x26 } ports;
typedef enum { FKT_MGT_PING=0x00, FKT_MGT_PONG=0x01, typedef enum { FKT_MGT_PING=0x00, FKT_MGT_PONG=0x01,
FKT_MGT_RESET=0x02, FKT_MGT_AWAKE=0x03, FKT_MGT_TIMEREQUEST=0x04, FKT_MGT_TIMEREPLY=0x05 } lap_mgt_fkts; FKT_MGT_RESET=0x02, FKT_MGT_AWAKE=0x03, FKT_MGT_TIMEREQUEST=0x04, FKT_MGT_TIMEREPLY=0x05 } lap_mgt_fkts;
typedef enum { FKT_LAMPE_SET=0x00, FKT_LAMPE_SETMASK=0x01, typedef enum { FKT_LAMPE_SET=0x00, FKT_LAMPE_SETMASK=0x01,
FKT_LAMPE_SETDELAY=0x02, FKT_LAMPE_ADD=0x03 } lap_lampe_fkts; FKT_LAMPE_SETDELAY=0x02, FKT_LAMPE_ADD=0x03 } lap_lampe_fkts;
typedef enum { FKT_BORG_INFO=0x00, FKT_BORG_MODE=0x01, FKT_BORG_SCROLLTEXT_RESET=0x02, typedef enum { FKT_BORG_INFO=0x00, FKT_BORG_MODE=0x01, FKT_BORG_SCROLLTEXT_RESET=0x02,
FKT_BORG_SCROLLTEXT_APPEND=0x03 } lap_borg_fkts; FKT_BORG_SCROLLTEXT_APPEND=0x03 } lap_borg_fkts;
typedef enum { FKT_ONOFF_INFO=0, FKT_ONOFF_SET=1, FKT_ONOFF_GET=2, typedef enum { FKT_ONOFF_INFO=0, FKT_ONOFF_SET=1, FKT_ONOFF_GET=2,
@ -80,7 +80,7 @@ typedef enum { FKT_MOOD_INFO=0x00, FKT_MOOD_GET=0x01, FKT_MOOD_SET=0x02, FKT_MOO
/**************************************************************************** /****************************************************************************
* STUBS: LAP Core Services * STUBS: LAP Core Services
*/ */
// send ping to dst // send ping to dst
@ -89,10 +89,15 @@ void lap_ping( can_addr dst );
// send reset request to dst // send reset request to dst
void lap_reset( can_addr dst ); void lap_reset( can_addr dst );
#ifdef LAP_TIME_EXTENSION
//variables to save the last received hours and minutes
extern uint8_t lap_time_h, lap_time_m, lap_time_update;
#endif
/** /**
* ServiceDataObject routinen * ServiceDataObject routinen
* *
unsigned char *sdo_readbuf(sdo_message *first_message, unsigned char *sdo_readbuf(sdo_message *first_message,
unsigned char length, unsigned char *actuallength); unsigned char length, unsigned char *actuallength);
unsigned char sdo_sendbuf(sdo_message *fst_msg, unsigned char *buf, unsigned char len); unsigned char sdo_sendbuf(sdo_message *fst_msg, unsigned char *buf, unsigned char len);
@ -113,7 +118,7 @@ while(1) {
char *buf = lap_read(msg, length); char *buf = lap_read(msg, length);
if ( !buf ) continue; if ( !buf ) continue;
// interpret buffer // interpret buffer
} }
*/ */

Loading…
Cancel
Save