diff options
Diffstat (limited to 'libgammu/phone/nokia/dct4s40')
-rw-r--r-- | libgammu/phone/nokia/dct4s40/6510/6510file.c | 24 | ||||
-rw-r--r-- | libgammu/phone/nokia/dct4s40/6510/6510file.h | 4 | ||||
-rw-r--r-- | libgammu/phone/nokia/dct4s40/6510/n6510.c | 49 |
3 files changed, 54 insertions, 23 deletions
diff --git a/libgammu/phone/nokia/dct4s40/6510/6510file.c b/libgammu/phone/nokia/dct4s40/6510/6510file.c index 66eba04..fa59ea5 100644 --- a/libgammu/phone/nokia/dct4s40/6510/6510file.c +++ b/libgammu/phone/nokia/dct4s40/6510/6510file.c @@ -379,7 +379,7 @@ static GSM_Error N6510_GetFileSystemStatus1(GSM_StateMachine *s, GSM_FileSystemS return GSM_WaitFor (s, req, 10, 0x6D, 4, ID_FileSystemStatus); } -static GSM_Error N6510_GetFilePart1(GSM_StateMachine *s, GSM_File *File, int *Handle UNUSED, int *Size) +static GSM_Error N6510_GetFilePart1(GSM_StateMachine *s, GSM_File *File, int *Handle UNUSED, size_t *Size) { GSM_Phone_N6510Data *Priv = &s->Phone.Data.Priv.N6510; int old; @@ -564,7 +564,7 @@ GSM_Error N6510_ReplyAddFilePart1(GSM_Protocol_Message *msg UNUSED, GSM_StateMac return ERR_NONE; } -static GSM_Error N6510_AddFilePart1(GSM_StateMachine *s, GSM_File *File, int *Pos, int *Handle UNUSED) +static GSM_Error N6510_AddFilePart1(GSM_StateMachine *s, GSM_File *File, size_t *Pos, int *Handle UNUSED) { GSM_Phone_N6510Data *Priv = &s->Phone.Data.Priv.N6510; GSM_File File2; @@ -642,7 +642,7 @@ static GSM_Error N6510_AddFilePart1(GSM_StateMachine *s, GSM_File *File, int *Po Add[12] = j / 256; Add[13] = j % 256; memcpy(Add+14,File->Buffer+(*Pos),j); - smprintf(s, "Adding file part %i %i\n",*Pos,j); + smprintf(s, "Adding file part %ld %i\n", (long)*Pos,j); error=GSM_WaitFor (s, Add, 14+j, 0x6D, 4, ID_AddFile); if (error != ERR_NONE) return error; *Pos = *Pos + j; @@ -1186,7 +1186,7 @@ static GSM_Error N6510_GetNextFileFolder2(GSM_StateMachine *s, GSM_File *File, g return error; } -static GSM_Error N6510_GetFilePart2(GSM_StateMachine *s, GSM_File *File, int *Handle, int *Size) +static GSM_Error N6510_GetFilePart2(GSM_StateMachine *s, GSM_File *File, int *Handle, size_t *Size) { int old,j; GSM_Error error; @@ -1318,7 +1318,7 @@ static GSM_Error N6510_SetFileAttributes2(GSM_StateMachine *s, GSM_File *File) return ERR_NONE; } -static GSM_Error N6510_AddFilePart2(GSM_StateMachine *s, GSM_File *File, int *Pos, int *Handle) +static GSM_Error N6510_AddFilePart2(GSM_StateMachine *s, GSM_File *File, size_t *Pos, int *Handle) { GSM_Error error; int j,P; @@ -1365,7 +1365,7 @@ static GSM_Error N6510_AddFilePart2(GSM_StateMachine *s, GSM_File *File, int *Po req[13] = j % 256; memcpy(req+14,File->Buffer+(*Pos),j); - smprintf(s, "Adding file part %i %i\n",*Pos,j); + smprintf(s, "Adding file part %ld %i\n",(long)*Pos,j); error=GSM_WaitFor (s, req, 14+j, 0x6D, 4, ID_AddFile); if (error != ERR_NONE) return error; *Pos = *Pos + j; @@ -1681,7 +1681,7 @@ GSM_Error N6510_GetNextFileFolder(GSM_StateMachine *s, GSM_File *File, gboolean return N6510_GetNextFileFolder2(s,File,start); } -GSM_Error N6510_GetFilePart(GSM_StateMachine *s, GSM_File *File, int *Handle, int *Size) +GSM_Error N6510_GetFilePart(GSM_StateMachine *s, GSM_File *File, int *Handle, size_t *Size) { GSM_File File2; char buf[20 + (2 * (GSM_MAX_FILENAME_ID_LENGTH + 1))]; @@ -1711,7 +1711,7 @@ GSM_Error N6510_GetFilePart(GSM_StateMachine *s, GSM_File *File, int *Handle, in } } -GSM_Error N6510_AddFilePart(GSM_StateMachine *s, GSM_File *File, int *Pos, int *Handle) +GSM_Error N6510_AddFilePart(GSM_StateMachine *s, GSM_File *File, size_t *Pos, int *Handle) { GSM_File File2; GSM_Error error; @@ -2126,7 +2126,8 @@ GSM_Error N6510_GetNextMMSFileInfo(GSM_StateMachine *s, unsigned char *FileID, i GSM_Phone_N6510Data *Priv = &s->Phone.Data.Priv.N6510; GSM_Error error; GSM_File file; - int Handle,Size; + int Handle; + size_t Size; if (start) { error = N6510_GetMMSFolders(s, &folders); @@ -2497,7 +2498,7 @@ GSM_Error N6510_DecodeFilesystemSMS(GSM_StateMachine *s, GSM_MultiSMSMessage *sm break; } if (unknown) { - smprintf(s, "WARNING: Unknown block 0x%02x, see <http://wammu.eu/support/bugs/> how to report\n", FFF->Buffer[pos]); + smprintf(s, "WARNING: Unknown block 0x%02x, see <https://wammu.eu/support/bugs/> how to report\n", FFF->Buffer[pos]); DumpMessage(&(s->di), FFF->Buffer + pos, 3 + (FFF->Buffer[pos + 1] << 8) + FFF->Buffer[pos + 2]); #ifdef DEBUG } else { @@ -2529,7 +2530,8 @@ GSM_Error N6510_GetNextFilesystemSMS(GSM_StateMachine *s, GSM_MultiSMSMessage *s { GSM_Phone_N6510Data *Priv = &s->Phone.Data.Priv.N6510; unsigned char folderid; - int location,Size,Handle; + int location,Handle; + size_t Size; GSM_Error error; GSM_File FFF; gboolean start2=start; diff --git a/libgammu/phone/nokia/dct4s40/6510/6510file.h b/libgammu/phone/nokia/dct4s40/6510/6510file.h index ed7e94d..12810e9 100644 --- a/libgammu/phone/nokia/dct4s40/6510/6510file.h +++ b/libgammu/phone/nokia/dct4s40/6510/6510file.h @@ -4,8 +4,8 @@ GSM_Error N6510_GetNextFileFolder (GSM_StateMachine *s, GSM_File *File, gboolea GSM_Error N6510_GetFolderListing (GSM_StateMachine *s, GSM_File *File, gboolean start); GSM_Error N6510_AddFolder (GSM_StateMachine *s, GSM_File *File); GSM_Error N6510_DeleteFolder (GSM_StateMachine *s, unsigned char *ID); -GSM_Error N6510_GetFilePart (GSM_StateMachine *s, GSM_File *File, int *Handle, int *Size); -GSM_Error N6510_AddFilePart (GSM_StateMachine *s, GSM_File *File, int *Pos, int *Handle); +GSM_Error N6510_GetFilePart (GSM_StateMachine *s, GSM_File *File, int *Handle, size_t *Size); +GSM_Error N6510_AddFilePart (GSM_StateMachine *s, GSM_File *File, size_t *Pos, int *Handle); GSM_Error N6510_DeleteFile (GSM_StateMachine *s, unsigned char *ID); GSM_Error N6510_SetFileAttributes (GSM_StateMachine *s, GSM_File *File); GSM_Error N6510_GetNextRootFolder (GSM_StateMachine *s, GSM_File *File); diff --git a/libgammu/phone/nokia/dct4s40/6510/n6510.c b/libgammu/phone/nokia/dct4s40/6510/n6510.c index 9796c74..cde4ff7 100644 --- a/libgammu/phone/nokia/dct4s40/6510/n6510.c +++ b/libgammu/phone/nokia/dct4s40/6510/n6510.c @@ -2229,8 +2229,14 @@ static GSM_Error N6510_SetConnectionSettings(GSM_StateMachine *s, GSM_MultiWAPSe if (((length + pad) % 2)) pad = 2; else pad = 0; pos += NOKIA_SetUnicodeString(s, req + pos, settings->Settings[loc1].HomePage, TRUE); - if (settings->Settings[loc1].IsContinuous) req[pos] = 0x01; pos++; - if (settings->Settings[loc1].IsSecurity) req[pos] = 0x01; pos++; + if (settings->Settings[loc1].IsContinuous) { + req[pos] = 0x01; + } + pos++; + if (settings->Settings[loc1].IsSecurity) { + req[pos] = 0x01; + } + pos++; } else if (loc2 != -1) { /* Name */ length = UnicodeLength(settings->Settings[loc2].Title); @@ -2242,8 +2248,14 @@ static GSM_Error N6510_SetConnectionSettings(GSM_StateMachine *s, GSM_MultiWAPSe if (((length + pad) % 2)) pad = 2; else pad = 0; pos += NOKIA_SetUnicodeString(s, req + pos, settings->Settings[loc2].HomePage, TRUE); - if (settings->Settings[loc2].IsContinuous) req[pos] = 0x01; pos++; - if (settings->Settings[loc2].IsSecurity) req[pos] = 0x01; pos++; + if (settings->Settings[loc2].IsContinuous) { + req[pos] = 0x01; + } + pos++; + if (settings->Settings[loc2].IsSecurity) { + req[pos] = 0x01; + } + pos++; } else { /* Name */ length = 0; @@ -2295,8 +2307,14 @@ static GSM_Error N6510_SetConnectionSettings(GSM_StateMachine *s, GSM_MultiWAPSe req[pos++] = length % 256; if (loc1 != -1) { - if (!settings->Settings[loc1].IsNormalAuthentication) req[pos]=0x01; pos++; - if (settings->Settings[loc1].IsISDNCall) req[pos]=0x01; pos++; + if (!settings->Settings[loc1].IsNormalAuthentication) { + req[pos]=0x01; + } + pos++; + if (settings->Settings[loc1].IsISDNCall) { + req[pos]=0x01; + } + pos++; switch (settings->Settings[loc1].Speed) { case WAPSETTINGS_SPEED_AUTO : break; case WAPSETTINGS_SPEED_9600 : req[pos]=0x01; break; @@ -2304,7 +2322,9 @@ static GSM_Error N6510_SetConnectionSettings(GSM_StateMachine *s, GSM_MultiWAPSe } pos++; req[pos++]=0x01; - if (!settings->Settings[loc1].ManualLogin) req[pos] = 0x01; pos++; + if (!settings->Settings[loc1].ManualLogin) { + req[pos] = 0x01; + }pos++; pos += NOKIA_SetUnicodeString(s, req + pos, settings->Settings[loc1].IPAddress, FALSE); pos += NOKIA_SetUnicodeString(s, req + pos, settings->Settings[loc1].DialUp, TRUE); @@ -2337,9 +2357,18 @@ static GSM_Error N6510_SetConnectionSettings(GSM_StateMachine *s, GSM_MultiWAPSe req[pos++] = length % 256; if (loc2 != -1) { - if (!settings->Settings[loc2].IsNormalAuthentication) req[pos] = 0x01; pos++; - if (!settings->Settings[loc2].IsContinuous) req[pos] = 0x01; pos++; - if (!settings->Settings[loc2].ManualLogin) req[pos] = 0x01; pos++; + if (!settings->Settings[loc2].IsNormalAuthentication) { + req[pos] = 0x01; + } + pos++; + if (!settings->Settings[loc2].IsContinuous) { + req[pos] = 0x01; + } + pos++; + if (!settings->Settings[loc2].ManualLogin) { + req[pos] = 0x01; + } + pos++; pos += NOKIA_SetUnicodeString(s, req + pos, settings->Settings[loc2].DialUp, FALSE); pos += NOKIA_SetUnicodeString(s, req + pos, settings->Settings[loc2].IPAddress, TRUE); |