X-Git-Url: http://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=common%2Fprotocol%2Ffbus.c;h=e58d0c1d60ecee98676d99e6fd064b7f0fffc50d;hp=87e98fe911a79814782a673d5c84337baf3a8813;hb=refs%2Ftags%2Fbp_uc;hpb=1bbe44edac4bf7f36360bf713eeb6df2ad68b9c3 diff --git a/common/protocol/fbus.c b/common/protocol/fbus.c index 87e98fe..e58d0c1 100644 --- a/common/protocol/fbus.c +++ b/common/protocol/fbus.c @@ -239,10 +239,6 @@ void FBUS_RX_StateMachine(unsigned char rx_byte) { int i=0; -// if (CurrentConnectionType==GCT_DLR3) { -// AT_RX_StateMachine(rx_byte); -// } else { - #ifdef DEBUG /* For model sniff only display received bytes */ if (strcmp(GSM_Info->FBUSModels, "sniff")) @@ -506,22 +502,15 @@ void FBUS_RX_StateMachine(unsigned char rx_byte) { } #endif - -// } } /* Called by initialisation code to open comm port in asynchronous mode. */ bool FBUS_OpenSerial(void) { /* Uncomment, if want to test first method for DLR3 */ -// unsigned char req[3] = {"AT\r"}; -// unsigned char req2[5] = {"AT&F\r"}; -// unsigned char req3[13] = {"AT*NOKIAFBUS\r"}; - -// GSM_Error error; - -// GSM_Information *GSMINFOCOPY; -// GSM_Functions *GSMCOPY; + unsigned char req[3] = {"AT\r"}; + unsigned char req2[5] = {"AT&F\r"}; + unsigned char req3[13] = {"AT*NOKIAFBUS\r"}; switch (CurrentConnectionType) { case GCT_FBUS: @@ -555,66 +544,33 @@ bool FBUS_OpenSerial(void) /* There are 2 ways to init DLR in FBUS: Here is first described by Reuben Harris [reuben.harris@snowvalley.com] and used in Logo Manager, - 1. Firstly set the connection baud to 19200, DTR off, RTS off, - Parity on, one stop bit, - 2. Send "AT\r\n". The response should be "AT\r\n\r\nOK\r\n". - 3. Send "AT&F\r\n". The response should be "AT&F\r\n\r\nOK\r\n". - 4. Send "AT*NOKIAFBUS\r\n". The response should be - "AT*NOKIAFBUS\r\n\r\nOK\r\n". - 5. Set speed to 115200 - - This is one should be used by us, because seems to be compatible with more - phones. But we make something wrong and often phones don't want to start transmision */ + 1. Firstly set the connection baud to 19200, DTR off, RTS off, + Parity on, one stop bit, + 2. Send "AT\r\n". The response should be "AT\r\n\r\nOK\r\n". + 3. Send "AT&F\r\n". The response should be "AT&F\r\n\r\nOK\r\n". + 4. Send "AT*NOKIAFBUS\r\n". The response should be + "AT*NOKIAFBUS\r\n\r\nOK\r\n". + 5. Set speed to 115200 + This seems to be compatible with more phones*/ - /* Uncomment and test if want */ -// device_changespeed(19200); + device_changespeed(19200); /*leave RTS low, DTR low for duration of session.*/ -// device_setdtrrts(0, 0); - - /* Making copy of pointers */ -// GSMCOPY = GSM; -// GSMINFOCOPY =GSM_Info; - - /* Set pointers to relevant addresses - new "AT" module here is required */ -// GSM = &Nat_Functions; -// GSM_Info = &Nat_Information; - - /* Note: We change Protocol inside function pointed by it. - That's why in FBUS_RX_StateMachine we must check it (changing - Protocol is not enough), This is for correct work and be sure... */ -// Protocol = &AT_Functions; - -// error=N6110_SendMessageSequence (50, &CurrentGetHWError, 3, 0x00, req); -// if (error!=GE_NONE) return false; - -// error=N6110_SendMessageSequence (50, &CurrentGetHWError, 5, 0x00, req2); -// if (error!=GE_NONE) return false; - -// error=N6110_SendMessageSequence (50, &CurrentGetHWError, 13, 0x00, req3); -// if (error!=GE_NONE) return false; - - /* Returning to old protocol */ -// Protocol = &FBUS_Functions; - - /* Returning to old module */ -// GSM = GSMCOPY; -// GSM_Info = GSMINFOCOPY; - -// device_changespeed(115200); - - /* Second method for DLR3: - Used by some 7110 soft, but not compatible with some other - phones supporting DLR3 - 7160, NCP2.0 - Used in this moment in mygnokii - */ + device_setdtrrts(0, 0); + + Protocol->WritePhone (3,req );usleep(300); + Protocol->WritePhone (5,req2);usleep(300); + Protocol->WritePhone(13,req3);usleep(300); device_changespeed(115200); - /*leave RTS low, DTR low for duration of session.*/ - device_setdtrrts(0, 0); - - usleep(100000); +// /* Second method for DLR3: +// Used by some 7110 soft, but not compatible with some other +// phones supporting DLR3 - 7160, NCP2.0*/ +// device_changespeed(115200); +// /*leave RTS low, DTR low for duration of session.*/ +// device_setdtrrts(0, 0); +// usleep(100000); CurrentConnectionType=GCT_FBUS;