summaryrefslogtreecommitdiffabout
path: root/gammu/emb/gammu/depend/nokia/dct4.c
Unidiff
Diffstat (limited to 'gammu/emb/gammu/depend/nokia/dct4.c') (more/less context) (show whitespace changes)
-rw-r--r--gammu/emb/gammu/depend/nokia/dct4.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gammu/emb/gammu/depend/nokia/dct4.c b/gammu/emb/gammu/depend/nokia/dct4.c
index f4ed305..4bf958d 100644
--- a/gammu/emb/gammu/depend/nokia/dct4.c
+++ b/gammu/emb/gammu/depend/nokia/dct4.c
@@ -32,13 +32,14 @@ GSM_Error CheckDCT4Only()
32 if (strstr(N3320Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true; 32 if (strstr(N3320Phone.models, s.Phone.Data.ModelInfo->model) != NULL) found = true;
33#endif 33#endif
34 if (!found) return ERR_NOTSUPPORTED; 34 if (!found) return ERR_NOTSUPPORTED;
35 35
36 if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 && 36 if (s.ConnectionType!=GCT_MBUS2 && s.ConnectionType!=GCT_FBUS2 &&
37 s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_PHONETBLUE && 37 s.ConnectionType!=GCT_FBUS2DLR3 && s.ConnectionType!=GCT_PHONETBLUE &&
38 s.ConnectionType!=GCT_IRDAPHONET && s.ConnectionType!=GCT_BLUEPHONET) { 38 s.ConnectionType!=GCT_IRDAPHONET && s.ConnectionType!=GCT_BLUEPHONET &&
39 s.ConnectionType!=GCT_FBUS2DKU5) {
39 return ERR_OTHERCONNECTIONREQUIRED; 40 return ERR_OTHERCONNECTIONREQUIRED;
40 } 41 }
41 return ERR_NONE; 42 return ERR_NONE;
42} 43}
43 44
44static void CheckDCT4() 45static void CheckDCT4()
@@ -882,12 +883,14 @@ void DCT4GetT9(int argc, char *argv[])
882 i+=T9Size; 883 i+=T9Size;
883 } 884 }
884 885
885 fclose(T9File); 886 fclose(T9File);
886} 887}
887 888
889#ifdef GSM_ENABLE_NOKIA6510
890
888extern GSM_Error N6510_SetLight(GSM_StateMachine *s, N6510_PHONE_LIGHTS light, bool enable); 891extern GSM_Error N6510_SetLight(GSM_StateMachine *s, N6510_PHONE_LIGHTS light, bool enable);
889 892
890void DCT4SetLight(int argc, char *argv[]) 893void DCT4SetLight(int argc, char *argv[])
891{ 894{
892 int i; 895 int i;
893 N6510_PHONE_LIGHTS type; 896 N6510_PHONE_LIGHTS type;
@@ -918,12 +921,13 @@ void DCT4SetLight(int argc, char *argv[])
918 921
919 error=N6510_SetLight(&s, type, enable); 922 error=N6510_SetLight(&s, type, enable);
920 Print_Error(error); 923 Print_Error(error);
921 924
922 GSM_Terminate(); 925 GSM_Terminate();
923} 926}
927#endif
924 928
925void DCT4DisplayTest(int argc, char *argv[]) 929void DCT4DisplayTest(int argc, char *argv[])
926{ 930{
927 unsigned char ans[200]; 931 unsigned char ans[200];
928 unsigned char req0[] = {0x00, 0x08, 0x0D, 0x00, 0x0F, 0x00}; 932 unsigned char req0[] = {0x00, 0x08, 0x0D, 0x00, 0x0F, 0x00};
929 unsigned char req[] = {0x00, 0x08, 0x0E, 0x00, 0x12, 0x01, 0x00, 0x04, 933 unsigned char req[] = {0x00, 0x08, 0x0E, 0x00, 0x12, 0x01, 0x00, 0x04,
@@ -1018,12 +1022,14 @@ void DCT4GetADC(int argc, char *argv[])
1018 printf("%s\n",DCT4ADC[i].unit); 1022 printf("%s\n",DCT4ADC[i].unit);
1019 i++; 1023 i++;
1020 if (DCT4ADC[i].name[0] == 0x00) break; 1024 if (DCT4ADC[i].name[0] == 0x00) break;
1021 } 1025 }
1022} 1026}
1023 1027
1028#ifdef GSM_ENABLE_NOKIA6510
1029
1024 static double RadioFreq; 1030 static double RadioFreq;
1025 static unsigned char RadioName[100]; 1031 static unsigned char RadioName[100];
1026 1032
1027static GSM_Error DCT4_ReplyTuneRadio(GSM_Protocol_Message msg, GSM_StateMachine *s) 1033static GSM_Error DCT4_ReplyTuneRadio(GSM_Protocol_Message msg, GSM_StateMachine *s)
1028{ 1034{
1029 int length; 1035 int length;
@@ -1171,12 +1177,13 @@ void DCT4TuneRadio(int argc, char *argv[])
1171 1177
1172 error=GSM_WaitFor (&s, Disable, 6, 0x3E, 4, ID_User3); 1178 error=GSM_WaitFor (&s, Disable, 6, 0x3E, 4, ID_User3);
1173 Print_Error(error); 1179 Print_Error(error);
1174 1180
1175 GSM_Terminate(); 1181 GSM_Terminate();
1176} 1182}
1183#endif
1177 1184
1178void DCT4PlaySavedRingtone(int argc, char *argv[]) 1185void DCT4PlaySavedRingtone(int argc, char *argv[])
1179{ 1186{
1180 unsigned char req[] = {N6110_FRAME_HEADER, 1187 unsigned char req[] = {N6110_FRAME_HEADER,
1181 0x01, 1188 0x01,
1182 0x00,0x64,//id 1189 0x00,0x64,//id
@@ -1310,16 +1317,18 @@ static GSM_Reply_Function UserReplyFunctions4[] = {
1310 1317
1311 {DCT4_ReplyTestsStartup, "\x35",0x02,0x01,ID_User3}, 1318 {DCT4_ReplyTestsStartup, "\x35",0x02,0x01,ID_User3},
1312 {DCT4_ReplyTestsStartup, "\x35",0x02,0x02,ID_User3}, 1319 {DCT4_ReplyTestsStartup, "\x35",0x02,0x02,ID_User3},
1313 {DCT4_ReplyTestsNames, "\x35",0x02,0x03,ID_User1}, 1320 {DCT4_ReplyTestsNames, "\x35",0x02,0x03,ID_User1},
1314 {DCT4_ReplyTestsStatus, "\x35",0x02,0x04,ID_User2}, 1321 {DCT4_ReplyTestsStatus, "\x35",0x02,0x04,ID_User2},
1315 1322
1323#ifdef GSM_ENABLE_NOKIA6510
1316 {DCT4_ReplyTuneRadio, "\x3E",0x03,0x09,ID_User3}, 1324 {DCT4_ReplyTuneRadio, "\x3E",0x03,0x09,ID_User3},
1317 {DCT4_ReplyTuneRadio, "\x3E",0x03,0x15,ID_User3}, 1325 {DCT4_ReplyTuneRadio, "\x3E",0x03,0x15,ID_User3},
1318 {DCT4_ReplyTuneRadio, "\x3E",0x03,0x15,ID_SetFMStation}, 1326 {DCT4_ReplyTuneRadio, "\x3E",0x03,0x15,ID_SetFMStation},
1319 {DCT4_ReplyTuneRadio, "\x3E",0x03,0x16,ID_User3}, 1327 {DCT4_ReplyTuneRadio, "\x3E",0x03,0x16,ID_User3},
1328#endif
1320 1329
1321 {DCT4_ReplyGetVoiceRecord, "\x4A",0x03,0x31,ID_User4}, 1330 {DCT4_ReplyGetVoiceRecord, "\x4A",0x03,0x31,ID_User4},
1322 1331
1323 {DCT4_ReplyGetSimlock, "\x53",0x03,0x0D,ID_User6}, 1332 {DCT4_ReplyGetSimlock, "\x53",0x03,0x0D,ID_User6},
1324 {DCT4_ReplyGetSimlock, "\x53",0x03,0x13,ID_User6}, 1333 {DCT4_ReplyGetSimlock, "\x53",0x03,0x13,ID_User6},
1325 1334