[tuxdroid-svn] r163 - in daemon/trunk: . libs
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2007-03-14 14:20:55
|
Author: jaguarondi Date: 2007-03-14 15:20:35 +0100 (Wed, 14 Mar 2007) New Revision: 163 Modified: daemon/trunk/libs/USBDaemon_command_tux.c daemon/trunk/libs/USBDaemon_command_tux.h daemon/trunk/libs/USBDaemon_globals.h daemon/trunk/libs/USBDaemon_status_table.c daemon/trunk/libs/USBDaemon_status_table.h daemon/trunk/libs/USBDaemon_usb_readWrite.c daemon/trunk/main.c Log: - CLN: Corrected some English mistakes Modified: daemon/trunk/libs/USBDaemon_command_tux.c =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.c 2007-03-14 13:15:09 UTC (rev 162) +++ daemon/trunk/libs/USBDaemon_command_tux.c 2007-03-14 14:20:35 UTC (rev 163) @@ -35,32 +35,32 @@ /************************************************************************** */ void commands_dispatcher( unsigned char client_id, /* Client source */ - unsigned char src_trame[16]) /* Source trame */ + unsigned char src_frame[16]) /* Source frame */ { unsigned char ACK_DP; /* daemon processing ack */ - unsigned char data[12]; /* data part of source trame */ + unsigned char data[12]; /* data part of source frame */ unsigned char result[12]; /* result data to return */ - unsigned char tcp_trame[16];/* tcp trame to send */ - unsigned char ack_dp_trame[16]; + unsigned char tcp_frame[16];/* tcp frame to send */ + unsigned char ack_dp_frame[16]; unsigned char i; unsigned char no_ack; no_ack = 0; - /* Cut data part of source trame */ + /* Cut data part of source frame */ for(i = 0; i < 12; i++) { result[i] = 0; - data[i] = src_trame[i + 4]; + data[i] = src_frame[i + 4]; } /* Make source header */ - tcp_trame[0] = src_trame[0]; /* return source */ - tcp_trame[1] = src_trame[1]; /* return sub source */ + tcp_frame[0] = src_frame[0]; /* return source */ + tcp_frame[1] = src_frame[1]; /* return sub source */ - /*--------------------Data disencapsulation---------------------- // */ + /*--------------------Frame and data processing---------------------- */ ACK_DP = ACK_DP_OK; /* Init ACK daemon processing */ /* B1----: Destination */ - switch(src_trame[0]) + switch(src_frame[0]) { /* To Master Daemon---------------------------------------------- */ case DEST_MASTER_DAEMON: @@ -70,14 +70,14 @@ /* To Sub Daemon------------------------------------------------- */ case DEST_SUB_DAEMON: /* B3----Data Type */ - switch(src_trame[2]) + switch(src_frame[2]) { /* Data type command */ case DATA_TP_CMD: /* B4----Command type */ - tcp_trame[2] = DATA_TP_ACK_CMD; - tcp_trame[3] = src_trame[3]; - switch(src_trame[3]) + tcp_frame[2] = DATA_TP_ACK_CMD; + tcp_frame[3] = src_frame[3]; + switch(src_frame[3]) { /* Command type raw */ case SUBDATA_TP_RAW: @@ -97,10 +97,10 @@ break; /* Data type request */ case DATA_TP_REQ: - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = src_trame[3]; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = src_frame[3]; /* B4----Request type */ - switch(src_trame[3]) + switch(src_frame[3]) { /* Request type status */ case SUBDATA_TP_STATUS: @@ -127,14 +127,14 @@ case DEST_TUX: /* TODO sub destinations */ /* B3----Data Type */ - switch(src_trame[2]) + switch(src_frame[2]) { /* Data type command */ case DATA_TP_CMD: - tcp_trame[2] = DATA_TP_ACK_CMD; - tcp_trame[3] = src_trame[3]; + tcp_frame[2] = DATA_TP_ACK_CMD; + tcp_frame[3] = src_frame[3]; /* B4----Command type */ - switch(src_trame[3]) + switch(src_frame[3]) { /* Command type raw */ case SUBDATA_TP_RAW: @@ -152,10 +152,10 @@ break; /* Data type request */ case DATA_TP_REQ: - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = src_trame[3]; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = src_frame[3]; /* B4----Request type */ - switch(src_trame[3]) + switch(src_frame[3]) { /* Request type status */ case SUBDATA_TP_STATUS: @@ -193,23 +193,23 @@ break; } - /* Paste result treatement into tcp trame */ + /* Paste result treatement into tcp frame */ for(i = 0; i < 12; i++) - tcp_trame[i + 4] = result[i]; + tcp_frame[i + 4] = result[i]; /* Send daemon processing ack to client */ - for(i = 0; i < 16; i++)ack_dp_trame[i] = 0; - ack_dp_trame[0] = src_trame[0]; - ack_dp_trame[1] = src_trame[1]; - ack_dp_trame[2] = DATA_TP_ACK_DP; - ack_dp_trame[3] = src_trame[3]; - ack_dp_trame[4] = ACK_DP; + for(i = 0; i < 16; i++)ack_dp_frame[i] = 0; + ack_dp_frame[0] = src_frame[0]; + ack_dp_frame[1] = src_frame[1]; + ack_dp_frame[2] = DATA_TP_ACK_DP; + ack_dp_frame[3] = src_frame[3]; + ack_dp_frame[4] = ACK_DP; if(!no_ack) { - tcp_server_send_raw_to_client(client_id, ack_dp_trame, 16); - /* Send tcp trame to client */ + tcp_server_send_raw_to_client(client_id, ack_dp_frame, 16); + /* Send tcp frame to client */ if(ACK_DP == ACK_DP_OK) { - tcp_server_send_raw_to_client(client_id, tcp_trame, 16); + tcp_server_send_raw_to_client(client_id, tcp_frame, 16); } } } @@ -652,12 +652,12 @@ unsigned char param3 ) { - unsigned char usb_trame[TUX_SEND_LENGTH]; + unsigned char usb_frame[TUX_SEND_LENGTH]; - usb_trame[0] = 0; - usb_trame[1] = cmd; - usb_trame[2] = param1; usb_trame[3] = param2; usb_trame[4] = param3; - return usb_write_TuxDroid(usb_trame); + usb_frame[0] = 0; + usb_frame[1] = cmd; + usb_frame[2] = param1; usb_frame[3] = param2; usb_frame[4] = param3; + return usb_write_TuxDroid(usb_frame); } /************************************************************************ */ @@ -670,10 +670,10 @@ unsigned char param3 ) { - unsigned char usb_trame[TUX_SEND_LENGTH]; + unsigned char usb_frame[TUX_SEND_LENGTH]; - usb_trame[0] = 1; - usb_trame[1] = cmd; - usb_trame[2] = param1; usb_trame[3] = param2; usb_trame[4] = param3; - return usb_write_TuxDroid(usb_trame); + usb_frame[0] = 1; + usb_frame[1] = cmd; + usb_frame[2] = param1; usb_frame[3] = param2; usb_frame[4] = param3; + return usb_write_TuxDroid(usb_frame); } Modified: daemon/trunk/libs/USBDaemon_command_tux.h =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.h 2007-03-14 13:15:09 UTC (rev 162) +++ daemon/trunk/libs/USBDaemon_command_tux.h 2007-03-14 14:20:35 UTC (rev 163) @@ -23,7 +23,7 @@ /*_____________________ D E F I N E S ______________________________________*/ /*_____________________ F U N C T I O N S __________________________________*/ /* COMMANDS FROM CLIENTS DISPATCHER */ -void commands_dispatcher(unsigned char client_id, unsigned char src_trame[16]); +void commands_dispatcher(unsigned char client_id, unsigned char src_frame[16]); void sub_daemon_cmd_struct(unsigned char data[], unsigned char result[], int id_client); void sub_daemon_req_info(unsigned char data[], unsigned char result[], int id_client); void tux_cmd_raw(unsigned char data[], unsigned char result[]); Modified: daemon/trunk/libs/USBDaemon_globals.h =================================================================== --- daemon/trunk/libs/USBDaemon_globals.h 2007-03-14 13:15:09 UTC (rev 162) +++ daemon/trunk/libs/USBDaemon_globals.h 2007-03-14 14:20:35 UTC (rev 163) @@ -35,7 +35,7 @@ #define LIBUSB_DEBUG_LEVEL 1 /*_____________________ G L O B A L S _ V A R I A B L E S _______________________*/ unsigned char CLOSE_DAEMON; -unsigned char SHOW_TRAMES; +unsigned char SHOW_FRAMES; unsigned char SHOW_RAW_STATUS; unsigned short DAEMON_PID; unsigned char SHOW_INVALID_RAW; Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2007-03-14 13:15:09 UTC (rev 162) +++ daemon/trunk/libs/USBDaemon_status_table.c 2007-03-14 14:20:35 UTC (rev 163) @@ -84,23 +84,23 @@ /************************************************************************ */ void update_system_status_table(unsigned char new_status[4]) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0;i < 16;i++)tcp_trame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; + for(i = 0;i < 16;i++)tcp_frame[i] = 0; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; DONGLE_status = new_status[0]; /*RF status change */ if(RF_status != new_status[1]) { RF_status = new_status[1]; - tcp_trame[4] = DATA_STATUS_RF_CONNECTED; - tcp_trame[5] = RF_status; - tcp_server_send_raw(tcp_trame, 16); + tcp_frame[4] = DATA_STATUS_RF_CONNECTED; + tcp_frame[5] = RF_status; + tcp_server_send_raw(tcp_frame, 16); } /* Command status change */ if(CMD_status != new_status[2]) @@ -109,7 +109,7 @@ if((CMD_status == 2)||(CMD_status == 3)) CMD_STATUS_FLAG = 0; } - NUMBER_trames = new_status[3]; + NUMBER_frames = new_status[3]; } /************************************************************************ */ @@ -172,7 +172,7 @@ unsigned char toggle; unsigned char check; unsigned char new_code; - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; code = new_status[1] & 0x3F; @@ -200,14 +200,14 @@ if(new_code) { printf("Remote code : %.2x\n", code); - for(i = 6;i < 16;i++)tcp_trame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; - tcp_trame[4] = DATA_STATUS_IR_CODE; - tcp_trame[5] = code; - tcp_server_send_raw(tcp_trame, 16); + for(i = 6;i < 16;i++)tcp_frame[i] = 0; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; + tcp_frame[4] = DATA_STATUS_IR_CODE; + tcp_frame[5] = code; + tcp_server_send_raw(tcp_frame, 16); } } @@ -216,19 +216,19 @@ /************************************************************************ */ void pong_event(unsigned char pong_number, unsigned char pong_received) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0;i < 16;i++)tcp_trame[i] = 0; + for(i = 0;i < 16;i++)tcp_frame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; - tcp_trame[4] = DATA_STATUS_PONG; - tcp_trame[5] = pong_number; - tcp_trame[6] = pong_received; - tcp_server_send_raw(tcp_trame, 16); + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; + tcp_frame[4] = DATA_STATUS_PONG; + tcp_frame[5] = pong_number; + tcp_frame[6] = pong_received; + tcp_server_send_raw(tcp_frame, 16); } /************************************************************************ */ @@ -236,113 +236,113 @@ /************************************************************************ */ void portb_changed(unsigned char new_value) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0;i < 16;i++)tcp_trame[i] = 0; + for(i = 0;i < 16;i++)tcp_frame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; /* wings motor backward */ if((portb.Byte & 0x01) != (new_value & 0x01)) { - tcp_trame[4] = DATA_STATUS_WINGS_MOTOR_BACKWARD; + tcp_frame[4] = DATA_STATUS_WINGS_MOTOR_BACKWARD; if (portb.bits.PB0) { printf("wings motor backward 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("wings motor backward 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* spin motor backward */ if((portb.Byte & 0x02) != (new_value & 0x02)) { - tcp_trame[4] = DATA_STATUS_SPIN_MOTOR_BACKWARD; + tcp_frame[4] = DATA_STATUS_SPIN_MOTOR_BACKWARD; if (portb.bits.PB1) { printf("spin motor backward 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("spin motor backward 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* spin motor forward */ if((portb.Byte & 0x04) != (new_value & 0x04)) { - tcp_trame[4] = DATA_STATUS_SPIN_MOTOR_FORWARD; + tcp_frame[4] = DATA_STATUS_SPIN_MOTOR_FORWARD; if (portb.bits.PB2) { printf("spin motor forward 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("spin motor forward 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* mouth open position motor */ if((portb.Byte & 0x08) != (new_value & 0x08)) { - tcp_trame[4] = DATA_STATUS_MOUTH_OPEN_POSITION ; + tcp_frame[4] = DATA_STATUS_MOUTH_OPEN_POSITION ; if (portb.bits.PB3) { /* Up */ printf("mouth open position 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { /* Down */ printf("mouth open position 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* mouth close position motor */ if((portb.Byte & 0x10) != (new_value & 0x10)) { - tcp_trame[4] = DATA_STATUS_MOUTH_CLOSED_POSITION; + tcp_frame[4] = DATA_STATUS_MOUTH_CLOSED_POSITION; if (portb.bits.PB4) { printf("mouth close position 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("mouth close position 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* charger inhibit signal */ if((portb.Byte & 0x40) != (new_value & 0x40)) { - tcp_trame[4] = DATA_STATUS_CHARGER_INHIBIT_SIGNAL ; + tcp_frame[4] = DATA_STATUS_CHARGER_INHIBIT_SIGNAL ; if (portb.bits.PB6) { printf("charger inhibit signal 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("charger inhibit signal 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } portb.Byte = new_value; } @@ -352,62 +352,62 @@ /************************************************************************ */ void portc_changed(unsigned char new_value) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0;i < 16;i++)tcp_trame[i] = 0; + for(i = 0;i < 16;i++)tcp_frame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; /* wings position switch */ if((portc.Byte & 0x02) != (new_value & 0x02)) { - tcp_trame[4] = DATA_STATUS_WINGS_POSITION_SWITCH; + tcp_frame[4] = DATA_STATUS_WINGS_POSITION_SWITCH; if (portc.bits.PB1) { printf("wings position switch 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("wings position switch 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* right blue led */ if((portc.Byte & 0x04) != (new_value & 0x04)) { - tcp_trame[4] = DATA_STATUS_RIGHT_BLUE_LED; + tcp_frame[4] = DATA_STATUS_RIGHT_BLUE_LED; if (portc.bits.PB2) { printf("right blue led off\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("right blue led on\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* left blue led */ if((portc.Byte & 0x08) != (new_value & 0x08)) { - tcp_trame[4] = DATA_STATUS_LEFT_BLUE_LED; + tcp_frame[4] = DATA_STATUS_LEFT_BLUE_LED; if (portc.bits.PB3) { printf("left blue led off\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("left blue led on\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } portc.Byte = new_value; } @@ -417,126 +417,126 @@ /************************************************************************ */ void portd_changed(unsigned char new_value) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0;i < 16;i++)tcp_trame[i] = 0; + for(i = 0;i < 16;i++)tcp_frame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; /* head motor for eyes */ if((portd.Byte & 0x01) != (new_value & 0x01)) { - tcp_trame[4] = DATA_STATUS_HEAD_MOTOR_FOR_EYES; + tcp_frame[4] = DATA_STATUS_HEAD_MOTOR_FOR_EYES; if (portd.bits.PB0) { printf("head motor for eyes 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("head motor for eyes 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* head motor for mouth */ if((portd.Byte & 0x02) != (new_value & 0x02)) { - tcp_trame[4] = DATA_STATUS_HEAD_MOTOR_FOR_MOUTH; + tcp_frame[4] = DATA_STATUS_HEAD_MOTOR_FOR_MOUTH; if (portd.bits.PB1) { printf("head motor for mouth 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("head motor for mouth 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16);; + tcp_server_send_raw(tcp_frame, 16);; } /* spin position switch */ if((portd.Byte & 0x08) != (new_value & 0x08)) { - tcp_trame[4] = DATA_STATUS_SPIN_POSITION_SWITCH; + tcp_frame[4] = DATA_STATUS_SPIN_POSITION_SWITCH; if (portd.bits.PB3) { printf("spin position switch 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("spin position switch 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* wings motor forward */ if((portd.Byte & 0x10) != (new_value & 0x10)) { - tcp_trame[4] = DATA_STATUS_WINGS_MOTOR_FORWARD; + tcp_frame[4] = DATA_STATUS_WINGS_MOTOR_FORWARD; if (portd.bits.PB4) { printf("wings motor forward 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("wings motor forward 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* IR led */ if((portd.Byte & 0x20) != (new_value & 0x20)) { - tcp_trame[4] = DATA_STATUS_IR_LED; + tcp_frame[4] = DATA_STATUS_IR_LED; if (portd.bits.PB5) { printf("IR led 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("IR led 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* eyes open position switch */ if((portd.Byte & 0x40) != (new_value & 0x40)) { - tcp_trame[4] = DATA_STATUS_EYES_OPEN_POSITION_SWITCH; + tcp_frame[4] = DATA_STATUS_EYES_OPEN_POSITION_SWITCH; if (portd.bits.PB6) { printf("eyes open position switch 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("eyes open position switch 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* eyes closed position switch */ if((portd.Byte & 0x80) != (new_value & 0x80)) { - tcp_trame[4] = DATA_STATUS_EYES_CLOSED_POSITION_SWITCH; + tcp_frame[4] = DATA_STATUS_EYES_CLOSED_POSITION_SWITCH; if (portd.bits.PB7) { printf("eyes closed position switch 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("eyes closed position switch 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } portd.Byte = new_value; } @@ -546,110 +546,110 @@ /************************************************************************ */ void sensors1_changed(unsigned char new_value) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0;i < 16;i++)tcp_trame[i] = 0; + for(i = 0;i < 16;i++)tcp_frame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; /* Left wing push */ if((sensors1.Byte & 0x01) != (new_value & 0x01)) { - tcp_trame[4] = DATA_STATUS_LEFT_WING_PUSH; + tcp_frame[4] = DATA_STATUS_LEFT_WING_PUSH; if (sensors1.bits.PB0) { printf("Left wing bouton Up\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("Left wing bouton Down\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* Right wing push */ if((sensors1.Byte & 0x02) != (new_value & 0x02)) { - tcp_trame[4] = DATA_STATUS_RIGHT_WING_PUSH; + tcp_frame[4] = DATA_STATUS_RIGHT_WING_PUSH; if (sensors1.bits.PB1) { printf("Right wing bouton Up\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("Right wing bouton Down\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* power plug insertion switch */ if((sensors1.Byte & 0x04) != (new_value & 0x04)) { - tcp_trame[4] = DATA_STATUS_POWER_PLUG_SWITCH; + tcp_frame[4] = DATA_STATUS_POWER_PLUG_SWITCH; if (sensors1.bits.PB2) { printf("power plug insertion switch on\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("power plug insertion switch off\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* Head push */ if((sensors1.Byte & 0x08) != (new_value & 0x08)) { - tcp_trame[4] = DATA_STATUS_HEAD_PUSH_SWITCH; + tcp_frame[4] = DATA_STATUS_HEAD_PUSH_SWITCH; if (sensors1.bits.PB3) { printf("Head bouton Up\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("Head bouton Down\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* Led charger */ if((sensors1.Byte & 0x10) != (new_value & 0x10)) { - tcp_trame[4] = DATA_STATUS_CHARGER_LED_STATUS; + tcp_frame[4] = DATA_STATUS_CHARGER_LED_STATUS; if (sensors1.bits.PB4) { printf("Charger led 1\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } else { printf("Charger led 0\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } /* mute status */ if((sensors1.Byte & 0x80) != (new_value & 0x80)) { - tcp_trame[4] = DATA_STATUS_MUTE_STATUS; + tcp_frame[4] = DATA_STATUS_MUTE_STATUS; if (sensors1.bits.PB7) { printf("mute status off\n"); - tcp_trame[5] = 0; + tcp_frame[5] = 0; } else { printf("mute status on\n"); - tcp_trame[5] = 1; + tcp_frame[5] = 1; } - tcp_server_send_raw(tcp_trame, 16); + tcp_server_send_raw(tcp_frame, 16); } sensors1.Byte = new_value; } @@ -662,22 +662,22 @@ unsigned char new_value_low, unsigned char new_light_mode) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0;i < 16;i++)tcp_trame[i] = 0; + for(i = 0;i < 16;i++)tcp_frame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; - tcp_trame[4] = DATA_STATUS_LIGHT_LEVEL; + tcp_frame[4] = DATA_STATUS_LIGHT_LEVEL; sensors2.level_light_high.Byte = new_value_high; sensors2.level_light_low.Byte = new_value_low; sensors2.light_mode.Byte = new_light_mode; - tcp_trame[5] = new_value_high; - tcp_trame[6] = new_value_low; + tcp_frame[5] = new_value_high; + tcp_frame[6] = new_value_low; } /************************************************************************ */ @@ -688,36 +688,36 @@ unsigned char mouth_position, unsigned char wings_position) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0;i < 16;i++)tcp_trame[i] = 0; + for(i = 0;i < 16;i++)tcp_frame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; if(position1.eyes_position.Byte != eyes_position) { position1.eyes_position.Byte = eyes_position; - tcp_trame[4] = DATA_STATUS_EYES_POSITION_COUNTER; - tcp_trame[5] = eyes_position; - tcp_server_send_raw(tcp_trame, 16); + tcp_frame[4] = DATA_STATUS_EYES_POSITION_COUNTER; + tcp_frame[5] = eyes_position; + tcp_server_send_raw(tcp_frame, 16); } if(position1.mouth_position.Byte != mouth_position) { position1.mouth_position.Byte = mouth_position; - tcp_trame[4] = DATA_STATUS_MOUTH_POSITION_COUNTER; - tcp_trame[5] = mouth_position; - tcp_server_send_raw(tcp_trame, 16); + tcp_frame[4] = DATA_STATUS_MOUTH_POSITION_COUNTER; + tcp_frame[5] = mouth_position; + tcp_server_send_raw(tcp_frame, 16); } if(position1.wings_position.Byte != wings_position) { position1.wings_position.Byte = wings_position; - tcp_trame[4] = DATA_STATUS_WINGS_POSITION_COUNTER; - tcp_trame[5] = wings_position; - tcp_server_send_raw(tcp_trame, 16); + tcp_frame[4] = DATA_STATUS_WINGS_POSITION_COUNTER; + tcp_frame[5] = wings_position; + tcp_server_send_raw(tcp_frame, 16); } } @@ -726,18 +726,18 @@ /************************************************************************ */ void position2_changed(unsigned char spin_position) { - unsigned char tcp_trame[16]; + unsigned char tcp_frame[16]; unsigned char i; - for(i = 0; i < 16; i++)tcp_trame[i] = 0; + for(i = 0; i < 16; i++)tcp_frame[i] = 0; - tcp_trame[0] = SOURCE_TUX; - tcp_trame[1] = SS_DEFAULT; - tcp_trame[2] = DATA_TP_RSP; - tcp_trame[3] = SUBDATA_TP_STATUS; + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; - tcp_trame[4] = DATA_STATUS_SPIN_POSITION_COUNTER; + tcp_frame[4] = DATA_STATUS_SPIN_POSITION_COUNTER; position2.Byte = spin_position; - tcp_trame[5] = spin_position; - tcp_server_send_raw(tcp_trame, 16); + tcp_frame[5] = spin_position; + tcp_server_send_raw(tcp_frame, 16); } Modified: daemon/trunk/libs/USBDaemon_status_table.h =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.h 2007-03-14 13:15:09 UTC (rev 162) +++ daemon/trunk/libs/USBDaemon_status_table.h 2007-03-14 14:20:35 UTC (rev 163) @@ -22,7 +22,7 @@ /*_____________________ I N C L U D E S____________________________________ */ #include "../tuxdefs/commands.h" /*_____________________ D E F I N E S ______________________________________*/ -/* ------------------ Trame encapsulation --------------------------------- // */ +/* ------------------ Frame structure --------------------------------- // */ /* ------ Destination header ------// */ /* Destinations */ #define DEST_MASTER_DAEMON 0x00 @@ -147,7 +147,7 @@ #define DATA_STATUS_IR_CODE 0x22 #define DATA_STATUS_SOUND_COUNT 0x23 #define DATA_STATUS_PONG 0x24 -/* ------------------ Daemon to Application encapsulation ----------------- // */ +/* ------------------ Daemon to Application, frame construction ----------------- */ /*_____________________ T Y P E _ D E F ____________________________________*/ @@ -202,7 +202,7 @@ unsigned char DONGLE_status; unsigned char RF_status; unsigned char CMD_status; -unsigned char NUMBER_trames; +unsigned char NUMBER_frames; unsigned char CMD_STATUS_FLAG; unsigned char pong_received; Modified: daemon/trunk/libs/USBDaemon_usb_readWrite.c =================================================================== --- daemon/trunk/libs/USBDaemon_usb_readWrite.c 2007-03-14 13:15:09 UTC (rev 162) +++ daemon/trunk/libs/USBDaemon_usb_readWrite.c 2007-03-14 14:20:35 UTC (rev 163) @@ -93,11 +93,11 @@ cmd_dispatch[0] = data[0];cmd_dispatch[1] = data[1]; cmd_dispatch[2] = data[2];cmd_dispatch[3] = data[3]; update_system_status_table(cmd_dispatch); - if(SHOW_TRAMES) - printf("RF_st: %.2x CMD_st: %.2x NB_trames : %d idx : %d\n", RF_status, CMD_status, NUMBER_trames, idx); - if((NUMBER_trames > 0) && (NUMBER_trames < 16)) + if(SHOW_FRAMES) + printf("RF_st: %.2x CMD_st: %.2x NB_frames : %d idx : %d\n", RF_status, CMD_status, NUMBER_frames, idx); + if((NUMBER_frames > 0) && (NUMBER_frames < 16)) { - for(i = 0;i < NUMBER_trames;i++) + for(i = 0;i < NUMBER_frames;i++) { cmd_dispatch[0] = data[((i + 1)*4) + 0]; cmd_dispatch[1] = data[((i + 1)*4) + 1]; Modified: daemon/trunk/main.c =================================================================== --- daemon/trunk/main.c 2007-03-14 13:15:09 UTC (rev 162) +++ daemon/trunk/main.c 2007-03-14 14:20:35 UTC (rev 163) @@ -128,9 +128,9 @@ printf("options:\n"); printf(" -d start in daemon mode\n"); printf(" -v view in shell ( for daemon mode )\n"); - printf(" -st show the structure of the usb trames\n"); - printf(" -sr show all raw statutes\n"); - printf(" -si show only invalid raw statutes\n"); + printf(" -st show the structure of the usb frames\n"); + printf(" -sr show all raw status\n"); + printf(" -si show only invalid raw status\n"); printf(" -h show this usage list\n"); } @@ -159,7 +159,7 @@ /* Program arguments */ daemonized = 0; shell_view = 0; - SHOW_TRAMES = 0; + SHOW_FRAMES = 0; SHOW_RAW_STATUS = 0; SHOW_INVALID_RAW = 0; if (argc > 1) @@ -171,7 +171,7 @@ else if (!strcmp("-d", argv[i])) daemonized = 1; else if (!strcmp("-st", argv[i])) - SHOW_TRAMES = 1; + SHOW_FRAMES = 1; else if (!strcmp("-sr", argv[i])) SHOW_RAW_STATUS = 1; else if (!strcmp("-si", argv[i])) |