diff -ur gnokii-20041126/common/cfgreader.c gnokii/common/cfgreader.c --- gnokii-20041126/common/cfgreader.c Fri Nov 26 16:00:52 2004 +++ gnokii/common/cfgreader.c Sat Nov 27 18:09:13 2004 @@ -306,6 +306,8 @@ cfg->connection_type = GN_CT_Irda; else if (!strcasecmp(val, "bluetooth")) cfg->connection_type = GN_CT_Bluetooth; + else if (!strcasecmp(val, "dku2")) + cfg->connection_type = GN_CT_DKU2; #ifndef WIN32 else if (!strcasecmp(val, "tcp")) cfg->connection_type = GN_CT_TCP; diff -ur gnokii-20041126/common/device.c gnokii/common/device.c --- gnokii-20041126/common/device.c Fri Nov 26 16:00:52 2004 +++ gnokii/common/device.c Sat Nov 27 18:09:34 2004 @@ -56,6 +56,7 @@ dprintf("Serial device: opening device %s\n", file); switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: state->device.fd = serial_opendevice(file, with_odd_parity, with_async, with_hw_handshake, state); @@ -86,6 +87,7 @@ dprintf("Serial device: closing device\n"); switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: serial_close(state->device.fd, state); @@ -124,6 +126,7 @@ dprintf("Serial device: setting RTS to %s and DTR to %s\n", rts ? "high" : "low", dtr ? "high" : "low"); switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: serial_setdtrrts(state->device.fd, dtr, rts, state); @@ -148,6 +151,7 @@ dprintf("Serial device: setting speed to %d\n", speed); switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: serial_changespeed(state->device.fd, speed, state); @@ -171,6 +175,7 @@ size_t device_read(__ptr_t buf, size_t nbytes, struct gn_statemachine *state) { switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: return (serial_read(state->device.fd, buf, nbytes, state)); @@ -193,6 +198,7 @@ size_t device_write(const __ptr_t buf, size_t n, struct gn_statemachine *state) { switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: return (serial_write(state->device.fd, buf, n, state)); @@ -215,6 +221,7 @@ int device_select(struct timeval *timeout, struct gn_statemachine *state) { switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: return serial_select(state->device.fd, timeout, state); @@ -239,6 +246,7 @@ *n = -1; switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: return serial_nreceived(state->device.fd, n, state); @@ -250,6 +258,7 @@ gn_error device_flush(struct gn_statemachine *state) { switch (state->device.type) { + case GN_CT_DKU2: case GN_CT_Serial: case GN_CT_Infrared: return serial_flush(state->device.fd, state); diff -ur gnokii-20041126/common/gsm-networks.c gnokii/common/gsm-networks.c --- gnokii-20041126/common/gsm-networks.c Fri Nov 26 16:00:52 2004 +++ gnokii/common/gsm-networks.c Sat Nov 27 16:09:11 2004 @@ -285,7 +285,7 @@ {"232 10", "3 AT"}, {"234 10", "O2"}, {"234 15", "Vodafone"}, - {"234 20", "3"}, + {"234 20", "3 UK"}, {"234 30", "T-Mobile UK"}, {"234 33", "ORANGE"}, {"234 50", "JT GSM"}, --- gnokii-20041126/common/links/fbus-phonet.c Fri Nov 26 16:00:53 2004 +++ gnokii/common/links/fbus-phonet.c Sat Nov 27 18:10:15 2004 @@ -117,7 +109,8 @@ switch (i->state) { case FBUS_RX_Sync: if (rx_byte == FBUS_PHONET_FRAME_ID || - rx_byte == FBUS_PHONET_BLUETOOTH_FRAME_ID) { + rx_byte == FBUS_PHONET_BLUETOOTH_FRAME_ID || + rx_byte == FBUS_PHONET_DKU2_FRAME_ID) { i->state = FBUS_RX_GetDestination; } break; @@ -128,6 +121,7 @@ i->state = FBUS_RX_GetSource; if (rx_byte != FBUS_DEVICE_PC && + rx_byte != FBUS_PHONET_DKU2_DEVICE_PC && rx_byte != FBUS_PHONET_BLUETOOTH_DEVICE_PC) { i->state = FBUS_RX_Sync; dprintf("The fbus stream is out of sync - expected 0x0c, got 0x%2x\n", rx_byte); @@ -239,6 +233,10 @@ out_buffer[current++] = FBUS_PHONET_BLUETOOTH_FRAME_ID; out_buffer[current++] = FBUS_DEVICE_PHONE; out_buffer[current++] = FBUS_PHONET_BLUETOOTH_DEVICE_PC; + } else if (state->config.connection_type == GN_CT_DKU2) { + out_buffer[current++] = FBUS_PHONET_DKU2_FRAME_ID; + out_buffer[current++] = FBUS_DEVICE_PHONE; + out_buffer[current++] = FBUS_PHONET_DKU2_DEVICE_PC; } else { out_buffer[current++] = FBUS_PHONET_FRAME_ID; out_buffer[current++] = FBUS_DEVICE_PHONE; /* Destination */ @@ -292,6 +290,7 @@ switch (state->config.connection_type) { case GN_CT_Infrared: case GN_CT_Irda: + case GN_CT_DKU2: case GN_CT_Bluetooth: if (phonet_open(state) == true) error = GN_ERR_NONE; diff -ur gnokii-20041126/include/gnokii/common.h gnokii/include/gnokii/common.h --- gnokii-20041126/include/gnokii/common.h Fri Nov 26 16:00:55 2004 +++ gnokii/include/gnokii/common.h Sat Dec 11 20:10:55 2004 @@ -45,7 +45,8 @@ GN_CT_Bluetooth,/* Linux Bluetooth support */ GN_CT_Tekram, /* Tekram Ir-Dongle */ GN_CT_TCP, /* TCP network connection */ - GN_CT_M2BUS /* Serial connection with M2BUS protocol */ + GN_CT_M2BUS, /* Serial connection with M2BUS protocol */ + GN_CT_DKU2 /* DKU2 usb connection */ } gn_connection_type; /* Maximum length of device name for serial port */ diff -ur gnokii-20041126/include/links/fbus-phonet.h gnokii/include/links/fbus-phonet.h --- gnokii-20041126/include/links/fbus-phonet.h Fri Nov 26 16:00:55 2004 +++ gnokii/include/links/fbus-phonet.h Sat Nov 27 18:11:41 2004 @@ -46,6 +46,9 @@ family phones. */ #define FBUS_PHONET_BLUETOOTH_FRAME_ID 0x19 +#define FBUS_PHONET_DKU2_FRAME_ID 0x1b +#define FBUS_PHONET_DKU2_DEVICE_PC 0x0c + /* Our PC in the Nokia 6310 family over Bluetooth. */ #define FBUS_PHONET_BLUETOOTH_DEVICE_PC 0x10