rpms/gammu/F-9 gammu-1.20.0-sms.patch, NONE, 1.1 gammu-1.20.0-sync.patch, NONE, 1.1 gammu.spec, 1.15, 1.16
Xavier LAMIEN
laxathom at fedoraproject.org
Sat Oct 11 15:54:45 UTC 2008
Author: laxathom
Update of /cvs/pkgs/rpms/gammu/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26915
Modified Files:
gammu.spec
Added Files:
gammu-1.20.0-sms.patch gammu-1.20.0-sync.patch
Log Message:
Fix stuck on phone contact synchronization.
gammu-1.20.0-sms.patch:
--- NEW FILE gammu-1.20.0-sms.patch ---
--- gammu-1.20.0/common/service/sms/gsmsms.c 2008-05-10 17:17:26.000000000 +0200
+++ gammu-1.20.0/common/service/sms/gsmsms.c.new 2008-10-11 17:35:02.000000000 +0200
@@ -97,14 +97,15 @@
DT->Second = DecodeWithBCDAlphabet(req[5]);
/* Base for timezone is GMT. It's in quarters */
- DT->Timezone=(10*(req[6]&0x07)+(req[6]>>4))/4;
+ DT->Timezone=(10*(req[6]&0x07)+(req[6]>>4))*3600/4;
if (req[6]&0x08) DT->Timezone = -DT->Timezone;
dbgprintf("Decoding date & time: ");
dbgprintf("%s %4d/%02d/%02d ", DayOfWeek(DT->Year, DT->Month, DT->Day),
DT->Year, DT->Month, DT->Day);
- dbgprintf("%02d:%02d:%02d %02d00\n", DT->Hour, DT->Minute, DT->Second, DT->Timezone);
+ dbgprintf("%02d:%02d:%02d%+03i%02i\n", DT->Hour, DT->Minute, DT->Second,
+ DT->Timezone / 3600, abs((DT->Timezone % 3600) / 60));
return ERR_NONE;
}
@@ -498,7 +499,7 @@
/* the mask for the 8-bit data */
/* GSM 03.40 section 9.2.3.10 (TP-Data-Coding-Scheme)
* and GSM 03.38 section 4 */
- buffer[Layout.TPDCS] |= 0xf4;
+ buffer[Layout.TPDCS] |= (1 << 2);
memcpy(buffer+(Layout.Text+off), SMS->Text, SMS->Length);
size2 = size = SMS->Length+off;
#ifdef DEBUG
@@ -526,7 +527,7 @@
case SMS_Coding_Unicode_No_Compression:
/* GSM 03.40 section 9.2.3.10 (TP-Data-Coding-Scheme)
* and GSM 03.38 section 4 */
- buffer[Layout.TPDCS] |= 0x08;
+ buffer[Layout.TPDCS] |= (1 << 3);
EncodeUnicodeSpecialNOKIAChars(buffer+(Layout.Text+off), SMS->Text, UnicodeLength(SMS->Text));
size=size2=UnicodeLength(buffer+(Layout.Text+off))*2+off;
#ifdef DEBUG
@@ -591,7 +592,7 @@
/* Message Class*/
/* GSM 03.40 section 9.2.3.10 (TP-Data-Coding-Scheme) and GSM 03.38 section 4 */
if (Layout.TPDCS != 255) {
- if (SMS->Class>=0 && SMS->Class<5) buffer[Layout.TPDCS] |= (240+SMS->Class);
+ if (SMS->Class>=0 && SMS->Class<5) buffer[Layout.TPDCS] |= SMS->Class | (1 << 4);
dbgprintf("SMS class %i\n",SMS->Class);
}
gammu-1.20.0-sync.patch:
--- NEW FILE gammu-1.20.0-sync.patch ---
--- gammu-1.20.0/common/device/devfunc.c.false 2007-12-02 14:19:11.000000000 +0100
+++ gammu-1.20.0/common/device/devfunc.c 2008-10-11 17:16:12.000000000 +0200
@@ -56,7 +56,7 @@
}
return 3;
}
- /* Ususally this name also contains OBEX, preffered for irmc */
+ /* Ususally this name also contains OBEX, prefered for irmc */
if (strstr(name, "IrMC Sync") != NULL || strstr(name, "OBEX Synchronisation")) {
if (strcmp(s->CurrentConfig->Model, "obexirmc") == 0 ||
strcmp(s->CurrentConfig->Model, "seobex") == 0) {
@@ -71,6 +71,20 @@
}
return 2;
}
+ /* Phone Book Access Profile is subset of IrMC */
+ if (strstr(name, "PBAP") != NULL) {
+ if (strcmp(s->CurrentConfig->Model, "obexirmc") == 0) {
+ return 3;
+ }
+ return 2;
+ }
+ /* Object Push Profile */
+ if (strstr(name, "OPP") != NULL) {
+ if (strcmp(s->CurrentConfig->Model, "obexnone") == 0) {
+ return 3;
+ }
+ return 2;
+ }
/* Anything matching OBEX has lowest priority */
if (strstr(name, "OBEX") != NULL) return 1;
@@ -82,6 +96,8 @@
/* Motorola */
if (strstr(name, "Dial-up networking Gateway") != NULL) return 3;
if (strstr(name, "Serial port") != NULL) return 2;
+ /* Samsung */
+ if (strstr(name, "Dial-up Networking") != NULL) return 3;
/* Siemens, Thomas Eitzenberger */
if (strstr(name, "SerialPort1") != NULL) return 3;
if (strstr(name, "SerialPort") != NULL) return 2;
@@ -98,34 +114,32 @@
#if defined (GSM_ENABLE_BLUETOOTHDEVICE) || defined (GSM_ENABLE_IRDADEVICE)
+/* Windows do not have this, but we don't seem to need it there */
+#ifndef MSG_DONTWAIT
+#define MSG_DONTWAIT 0
+#endif
+
int socket_read(GSM_StateMachine *s UNUSED, void *buf, size_t nbytes, socket_type hPhone)
{
fd_set readfds;
int result = 0;
-#ifdef WIN32
struct timeval timer;
-#else
- int flags;
-#endif
FD_ZERO(&readfds);
FD_SET(hPhone, &readfds);
+
+ timer.tv_sec = 0;
+ timer.tv_usec = 0;
+
+ if (select(hPhone + 1, &readfds, NULL, NULL, &timer) > 0) {
+ result = recv(hPhone, buf, nbytes, MSG_DONTWAIT);
#ifndef WIN32
- if (select(hPhone+1, &readfds, NULL, NULL, 0) > 0) {
- flags = fcntl(hPhone, F_GETFL);
- fcntl(hPhone, F_SETFL, flags | O_NONBLOCK);
- result = read(hPhone, buf, nbytes);
if (result < 0 && errno != EINTR) {
- return 0;
- }
- fcntl(hPhone, F_SETFL, flags);
- }
-#else
- memset(&timer,0,sizeof(timer));
- if (select(0, &readfds, NULL, NULL, &timer) > 0) {
- result = recv(hPhone, buf, nbytes, 0);
- }
+ return 0;
+ }
#endif
+ }
+
return result;
}
Index: gammu.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gammu/F-9/gammu.spec,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- gammu.spec 25 Aug 2008 09:21:11 -0000 1.15
+++ gammu.spec 11 Oct 2008 15:54:15 -0000 1.16
@@ -1,6 +1,6 @@
Name: gammu
Version: 1.20.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Command Line utility to work with mobile phones
Group: Applications/System
@@ -9,6 +9,9 @@
Source0: ftp://dl.cihar.com/gammu/releases/%{name}-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch0: %{name}-%{version}-sync.patch
+Patch1: %{name}-%{version}-sms.patch
+
BuildRequires: autoconf, gettext, cmake
#enabling bluetooth fonction
BuildRequires: bluez-libs-devel
@@ -47,6 +50,9 @@
%prep
%setup -q
+%patch0 -p1 -b .sync
+%patch1 -p1 -b .sms
+
%build
mkdir build
@@ -120,6 +126,9 @@
%changelog
+* Sat Oct 11 2008 Xavier Lamien <lxtnow[at]gmail.com> - 1.20.0-2
+- Fix Stuck on Phone contact synchronization.
+
* Mon Aug 25 2008 Xavier Lamien <lxtnow[at]gmail.com> - 1.20.0-1
- Update release.
More information about the fedora-extras-commits
mailing list