[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Remove leading spaces
From: |
Ladislav Michl |
Subject: |
[PATCH] Remove leading spaces |
Date: |
Thu, 2 Jul 2009 13:55:56 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Wed, Jul 01, 2009 at 05:56:02PM +0200, Daniele Forsi wrote:
> The gnokii project has moved the source repository from CVS to GIT.
Very nice, thank you. Here is just a test patch to prove things will work even
with git ;-)
Signed-off-by: Ladislav Michl <address@hidden>
---
common/phones/nk2110.c | 50 ++++++++++++++--------------
common/phones/nk3110.c | 83 +++++++++++++++++++++++-----------------------
common/phones/nk6100.c | 47 +++++++++++++-------------
common/phones/nk6160.c | 6 ++--
common/phones/nk6510.c | 86 ++++++++++++++++++++++++------------------------
common/phones/nk7110.c | 12 +++---
6 files changed, 141 insertions(+), 143 deletions(-)
diff --git a/common/phones/nk2110.c b/common/phones/nk2110.c
index 291147b..c740f53 100644
--- a/common/phones/nk2110.c
+++ b/common/phones/nk2110.c
@@ -27,7 +27,7 @@
Notice that this code was (partly) converted to "new" structure, but it
does not have code for bus separated. I think that separating it would
- be waste of effort... --pavel
+ be waste of effort... --pavel
*/
@@ -78,10 +78,10 @@ static char *Revision = NULL,
#define INFO \
{ \
"2110|2140|6080", /* Models */ \
- 100, /* Max RF Level */ \
+ 100, /* Max RF Level */ \
0, /* Min RF Level */ \
GRF_Percentage, /* RF level units */ \
- 100, /* Max Battery Level */ \
+ 100, /* Max Battery Level */ \
0, /* Min Battery Level */ \
GBU_Percentage, /* Battery level units */ \
GDT_None, /* No date/time support */ \
@@ -262,16 +262,16 @@ SendFrame( u8 *buffer, u8 command, u8 length )
dprintf("writing...");
LastChar = GetTime();
if (xwrite(pkt, current) == -1)
- return GN_ERR_INTERNALERROR);
+ return GN_ERR_INTERNALERROR;
if (xread(pkt2, current) == -1)
- return GN_ERR_INTERNALERROR);
+ return GN_ERR_INTERNALERROR;
dprintf("echook");
if (memcmp(pkt, pkt2, current)) {
dprintf("Bad echo?!");
msleep(1000);
- return GN_ERR_TIMEOUT);
+ return GN_ERR_TIMEOUT;
}
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
static gn_error
@@ -348,7 +348,7 @@ SMS(GSM_SMSMessage *message, int command)
return GN_ERR_BUSY;
}
SMSpos = 0;
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
@@ -428,7 +428,7 @@ GetSMSMessage(GSM_Data *data)
dprintf("Error in parsesms?\n");
msleep_poll(1000); /* If phone lost our ack, it might
retransmit data */
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
#if 0
@@ -504,7 +504,7 @@ GetRFLevel(GSM_RFUnits *units, float *level)
*level = (100* (float) val) / 60.0; /* This should be /
99.0 for some models other than nokia-2110 */
*units = GRF_Percentage;
}
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
static gn_error
@@ -525,7 +525,7 @@ GetBatteryLevel(GSM_BatteryUnits *units, float *level)
*units = GBU_Percentage;
}
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
static gn_error GetVersionInfo(void)
@@ -537,14 +537,14 @@ static gn_error GetVersionInfo(void)
strncpy( s, (void *) &PacketData[6], sizeof(VersionInfo) );
- for( Revision = s; *s != 0x0A; s++ ) if( !*s ) return GN_ERR_NONE);
+ for( Revision = s; *s != 0x0A; s++ ) if( !*s ) return GN_ERR_NONE;
*s++ = 0;
- for( RevisionDate = s; *s != 0x0A; s++ ) if( !*s ) return GN_ERR_NONE);
+ for( RevisionDate = s; *s != 0x0A; s++ ) if( !*s ) return GN_ERR_NONE;
*s++ = 0;
- for( Model = s; *s != 0x0A; s++ ) if( !*s ) return GN_ERR_NONE);
+ for( Model = s; *s != 0x0A; s++ ) if( !*s ) return GN_ERR_NONE;
*s++ = 0;
ddprintf("Revision %s, Date %s, Model %s\n", Revision, RevisionDate,
Model );
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
/* Our "Not implemented" functions */
@@ -569,15 +569,15 @@ GetMemoryStatus(GSM_MemoryStatus *Status)
Status->Free = 150;
break;
default:
- return GN_ERR_NOTIMPLEMENTED);
+ return GN_ERR_NOTIMPLEMENTED;
}
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
static bool
SendRLPFrame(RLP_F96Frame *frame, bool out_dtx)
{
- return (false);
+ return false;
}
static char *
@@ -818,14 +818,14 @@ bool OpenSerial(void)
result = device_open(PortDevice, true, false, false, GCT_Serial);
if (!result) {
dprintf( "Failed to open %s ...\n", PortDevice);
- return (false);
+ return false;
}
ddprintf("%s opened...\n", PortDevice);
device_changespeed(9600);
device_setdtrrts(1, 1);
- return (true);
+ return true;
}
static gn_error
@@ -1173,7 +1173,7 @@ GetPhonebookLocation(GSM_PhonebookEntry *entry)
entry->Empty = false;
entry->Group = 0;
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
/* Routine to write phonebook location in phone. Designed to be called by
@@ -1202,7 +1202,7 @@ WritePhonebookLocation(GSM_PhonebookEntry *entry)
printf("type= %x\n", PacketData[5]);
printf("location= %x\n", PacketData[6]);
printf("status= %x\n", PacketData[7]);
- return GN_ERR_NONE);
+ return GN_ERR_NONE;
}
static gn_error
@@ -1266,10 +1266,10 @@ gn_error P2110_Functions(GSM_Operation op, GSM_Data
*data, GSM_Statemachine *sta
err = SMS(data->SMSMessage, 3);
break;
case GOP_ReadPhonebook:
- err = GetPhonebookLocation(data->PhonebookEntry);
+ err = GetPhonebookLocation(data->PhonebookEntry);
break;
case GOP_WritePhonebook:
- err = WritePhonebookLocation(data->PhonebookEntry);
+ err = WritePhonebookLocation(data->PhonebookEntry);
break;
case GOP_OnSMS:
OnSMSFn = data->OnSMS;
@@ -1280,7 +1280,7 @@ gn_error P2110_Functions(GSM_Operation op, GSM_Data
*data, GSM_Statemachine *sta
CheckIncomingSMS(4);
CheckIncomingSMS(5);
err = SMS_Reserve(state);
- }
+ }
else err = SMS_UnReserve(state);
break;
case GOP_PollSMS: /* Our phone is able to notify
us... but we do not want to burn 100% CPU polling */
diff --git a/common/phones/nk3110.c b/common/phones/nk3110.c
index 077104f..9ee8887 100644
--- a/common/phones/nk3110.c
+++ b/common/phones/nk3110.c
@@ -359,7 +359,7 @@ static gn_error P3110_GetSMSMessage(gn_data *data, struct
gn_statemachine *state
* stored in DRVINSTANCE(state)->user_data, because trying to catch
* all the user data frames using sm_block() would create a race
* condition. */
-
+
timeout.tv_sec = 10;
timeout.tv_usec = 0;
gettimeofday(&now, NULL);
@@ -373,7 +373,7 @@ static gn_error P3110_GetSMSMessage(gn_data *data, struct
gn_statemachine *state
if (DRVINSTANCE(state)->user_data_count < data->raw_sms->length)
return GN_ERR_TIMEOUT;
-
+
/* the data has been received, copy it to the right place */
memcpy(data->raw_sms->user_data, DRVINSTANCE(state)->user_data,
data->raw_sms->length);
@@ -429,8 +429,8 @@ static gn_error P3110_SendSMSMessage(gn_data *data, struct
gn_statemachine *stat
/* The phone expects ASCII data instead of 7bit packed data, which
* is the format used in raw_sms. So the data has to be unpacked
* again. */
-
- ulength = char_7bit_unpack(0, data->raw_sms->user_data_length,
+
+ ulength = char_7bit_unpack(0, data->raw_sms->user_data_length,
sizeof(udata),
data->raw_sms->user_data, udata);
#else
@@ -478,7 +478,7 @@ static gn_error P3110_SendSMSMessage(gn_data *data, struct
gn_statemachine *stat
/* for blocks other than the last one, wait for ack;
* for last block, wait for reply message instead */
-
+
if (uremain == 0) break;
error = sm_block_ack(state);
@@ -509,13 +509,13 @@ static gn_error P3110_SendSMSMessage(gn_data *data,
struct gn_statemachine *stat
static gn_error P3110_ReadPhonebook(gn_data *data, struct gn_statemachine
*state)
{
unsigned char req[2];
-
+
req[0] = get_memory_type(data->phonebook_entry->memory_type);
req[1] = data->phonebook_entry->location;
-
+
if (sm_message_send(2, 0x43, req, state) != GN_ERR_NONE)
return GN_ERR_NOTREADY;
-
+
return sm_block(0x46, data, state);
}
@@ -523,22 +523,22 @@ static gn_error P3110_WritePhonebook(gn_data *data,
struct gn_statemachine *stat
{
int namelen, numberlen;
unsigned char req[256];
-
+
req[0] = get_memory_type(data->phonebook_entry->memory_type);
req[1] = data->phonebook_entry->location;
-
+
namelen = strlen(data->phonebook_entry->name);
numberlen = strlen(data->phonebook_entry->number);
-
+
req[2] = namelen;
memcpy(req + 3, data->phonebook_entry->name, namelen);
-
+
req[3 + namelen] = numberlen;
memcpy(req + 3 + namelen + 1, data->phonebook_entry->number, numberlen);
if (sm_message_send(3 + namelen + 1 + numberlen, 0x42, req, state) !=
GN_ERR_NONE)
return GN_ERR_NOTREADY;
-
+
return sm_block(0x44, data, state);
}
@@ -546,7 +546,7 @@ static gn_error P3110_MakeCall(gn_data *data, struct
gn_statemachine *state)
{
unsigned char req[256], call_type;
int pos = 0, numlen;
-
+
switch (data->call_info->type) {
case GN_CALL_Voice:
call_type = 0x05;
@@ -565,15 +565,15 @@ static gn_error P3110_MakeCall(gn_data *data, struct
gn_statemachine *state)
req[pos++] = call_type;
req[pos++] = 0x01; /* Address / number type? */
req[pos++] = numlen;
-
+
memcpy(req + pos, data->call_info->number, numlen);
pos += numlen;
-
+
/* Magic bytes taken from gnokii 0.3.5 code
* These probably set up some timers or something...
* According to old comments, InitField1 is not needed for
* voice calls, but doesn't seem to do any harm. */
-
+
req[pos++] = 0x07; /* Length of InitField1 */
req[pos++] = 0xa2; /* InitField1 content */
req[pos++] = 0x88;
@@ -584,11 +584,11 @@ static gn_error P3110_MakeCall(gn_data *data, struct
gn_statemachine *state)
req[pos++] = 0xa8;
req[pos++] = 0x00; /* Length of InitField2 */
- req[pos++] = 0x00; /* Length of InitField2 */
+ req[pos++] = 0x00; /* Length of InitField2 */
if (sm_message_send(pos, 0x0a, req, state) != GN_ERR_NONE)
return GN_ERR_NOTREADY;
-
+
return sm_block_no_retry_timeout(0x0e, 500, data, state);
}
@@ -596,17 +596,17 @@ static gn_error P3110_MakeCall(gn_data *data, struct
gn_statemachine *state)
static gn_error P3110_SendRLPFrame(gn_data *data, struct gn_statemachine
*state)
{
unsigned char req[31];
-
+
req[0] = (data->rlp_out_dtx) ? 0x01 : 0x00;
memcpy(req + 1, (unsigned char *) data->rlp_frame, 30);
-
+
return sm_message_send(31, 0x01, req, state);
}
static gn_error P3110_SetRLPRXCallback(gn_data *data, struct gn_statemachine
*state)
{
DRVINSTANCE(state)->rlp_rx_callback = data->rlp_rx_callback;
-
+
return GN_ERR_NONE;
}
@@ -619,20 +619,20 @@ static gn_error P3110_IncomingNothing(int messagetype,
unsigned char *message, i
static gn_error P3110_IncomingRLPFrame(int messagetype, unsigned char
*message, int length, gn_data *data, struct gn_statemachine *state)
{
gn_rlp_f96_frame frame;
-
+
if (!DRVINSTANCE(state)->rlp_rx_callback) return GN_ERR_NONE;
frame.Header[0] = message[2];
frame.Header[1] = message[3];
-
+
memcpy(frame.Data, message + 4, 25);
-
+
frame.FCS[0] = message[29];
frame.FCS[1] = message[30];
frame.FCS[2] = message[31];
-
+
DRVINSTANCE(state)->rlp_rx_callback(&frame);
-
+
return GN_ERR_NONE;
}
@@ -875,7 +875,6 @@ static gn_error P3110_IncomingSMSHeader(int messagetype,
unsigned char *message,
else
data->raw_sms->udh_indicator = 0;
-
data->raw_sms->dcs = message[7];
/* FIXME the DCS is set to indicate an 8-bit message in order
* to avoid the conversion from 7bit in gsm-sms.c
@@ -907,7 +906,7 @@ static gn_error P3110_IncomingSMSHeader(int messagetype,
unsigned char *message,
* strings with a length byte. So first the data is copied to
* a temp string, zero termination is added and the result is
* fed to a BCD conversion function. */
-
+
strncpy(smsc, message + 17, smsc_length);
smsc[smsc_length] = '\0';
smsc_number_type = (smsc[0] == '+') ?
GN_GSM_NUMBER_International : GN_GSM_NUMBER_Unknown;
@@ -1073,8 +1072,8 @@ static gn_error P3110_IncomingSMSInfo(int messagetype,
unsigned char *message, i
message + 14 + option_number_length,
center_number_length);
data->message_center->smsc.number[center_number_length]
= '\0';
- data->message_center->smsc.type =
- (data->message_center->smsc.number[0] == '+') ?
+ data->message_center->smsc.type =
+ (data->message_center->smsc.number[0] == '+') ?
GN_GSM_NUMBER_International :
GN_GSM_NUMBER_Unknown;
}
@@ -1113,7 +1112,7 @@ static gn_error P3110_IncomingSMSInfo(int messagetype,
unsigned char *message, i
static gn_error P3110_IncomingPhonebookRead(int messagetype, unsigned char
*message, int length, gn_data *data, struct gn_statemachine *state)
{
int namelen, numberlen;
-
+
if(!data->phonebook_entry) return GN_ERR_INTERNALERROR;
switch (message[0]) { /* unfold message type */
@@ -1132,23 +1131,23 @@ static gn_error P3110_IncomingPhonebookRead(int
messagetype, unsigned char *mess
/* empty locations are reported with empty name and number, so
* check for that case here */
-
+
if (message[2] == 0x00 && message[3] == 0x00)
return GN_ERR_EMPTYLOCATION;
data->phonebook_entry->caller_group = 0;
data->phonebook_entry->subentries_count = 0;
-
+
namelen = message[2];
memcpy(data->phonebook_entry->name, message + 3, namelen);
*(data->phonebook_entry->name + namelen) = '\0';
numberlen = message[3 + namelen];
-
+
memcpy(data->phonebook_entry->number, message + 3 + namelen + 1,
numberlen);
*(data->phonebook_entry->number + numberlen) = '\0';
-
+
return GN_ERR_NONE;
}
@@ -1218,7 +1217,7 @@ static gn_error P3110_IncomingStatusInfo(int messagetype,
unsigned char *message
}
/* Only output connection status byte now as the RF and Battery
- levels are displayed by the main gnokii code. */
+ levels are displayed by the main gnokii code. */
dprintf("Status: %s, Battery level: %d, RF level: %d.\n",
StatusStr[message[2]], message[4], message[3]);
return GN_ERR_NONE;
@@ -1265,12 +1264,12 @@ static int sms_header_encode(gn_data *data, struct
gn_statemachine *state, unsig
/* SMSC and remote number are in BCD format, but the phone wants them
* in plain ASCII, so we have to convert. */
-
+
snprintf(smsc, sizeof(smsc), "%s",
char_bcd_number_get(data->raw_sms->message_center));
snprintf(remote, sizeof(remote), "%s",
char_bcd_number_get(data->raw_sms->remote_number));
dprintf("smsc:'%s' remote:'%s'\n", smsc, remote);
-
+
if (save_sms) { /* make header for saving SMS */
req[pos++] = get_memory_type(data->raw_sms->memory_type);
req[pos++] = data->raw_sms->status;
@@ -1298,12 +1297,12 @@ static int sms_header_encode(gn_data *data, struct
gn_statemachine *state, unsig
}
req[pos++] = data->raw_sms->pid;
- req[pos++] = data->raw_sms->dcs;
+ req[pos++] = data->raw_sms->dcs;
/* The following 7 bytes define validity for SMSs to be sent.
* When saving they are apparently ignored - or somehow incorporated
* into the garbage you get in the date bytes when you read a saved
- * SMS. So we'll just put validity in here now. */
+ * SMS. So we'll just put validity in here now. */
memcpy(req + pos, data->raw_sms->validity, 7);
pos += 7;
@@ -1317,7 +1316,7 @@ static int sms_header_encode(gn_data *data, struct
gn_statemachine *state, unsig
req[pos++] = strlen(smsc);
memcpy(req + pos, smsc, strlen(smsc));
- pos += strlen(smsc);
+ pos += strlen(smsc);
req[pos++] = strlen(remote);
memcpy(req + pos, remote, strlen(remote));
pos += strlen(remote);
diff --git a/common/phones/nk6100.c b/common/phones/nk6100.c
index 93c5ba3..0c0c570 100644
--- a/common/phones/nk6100.c
+++ b/common/phones/nk6100.c
@@ -210,7 +210,7 @@ struct {
char *sw_version;
int capabilities;
} static nk6100_capabilities[] = {
- /*
+ /*
* Capability setup for phone models.
* Example:
* { "NSE-3", NULL, NK6100_CAP_OLD_CALL_API }
@@ -1590,9 +1590,9 @@ static gn_error GetSMSMessage(gn_data *data, struct
gn_statemachine *state)
static gn_error SaveSMSMessage(gn_data *data, struct gn_statemachine *state)
{
- unsigned char req[256] = {FBUS_FRAME_HEADER, 0x04,
+ unsigned char req[256] = {FBUS_FRAME_HEADER, 0x04,
0x07, /* status */
- 0x02,
+ 0x02,
0x00, /* number */
0x02 }; /* type */
int len;
@@ -1605,8 +1605,8 @@ static gn_error SaveSMSMessage(gn_data *data, struct
gn_statemachine *state)
if (data->raw_sms->type == GN_SMS_MT_Deliver) { /* Inbox */
dprintf("INBOX!\n");
- req[4] = 0x03; /* SMS State -
GN_SMS_Unread */
- req[7] = 0x00; /* SMS Type */
+ req[4] = 0x03; /* SMS State -
GN_SMS_Unread */
+ req[7] = 0x00; /* SMS Type */
}
if (data->raw_sms->status == GN_SMS_Sent)
@@ -1784,7 +1784,7 @@ static gn_error IncomingSMS(int messagetype, unsigned
char *message, int length,
case 0x0b:
dprintf("Message: SMS deleted successfully.\n");
break;
-
+
/* delete sms failed */
case 0x0c:
switch (message[4]) {
@@ -2452,7 +2452,7 @@ static gn_error IncomingProfile(int messagetype, unsigned
char *message, int len
return GN_ERR_UNHANDLEDFRAME;
}
break;
-
+
/* Set ringtone OK */
case 0x37:
return GN_ERR_NONE;
@@ -2669,7 +2669,7 @@ static gn_error WriteCalendarNote(gn_data *data, struct
gn_statemachine *state)
}
/* FIXME: use some constant not 255 magic number */
- if (!strcmp(DRVINSTANCE(state)->model, "NHM-5") /* Nokia 3310 */
+ if (!strcmp(DRVINSTANCE(state)->model, "NHM-5") /* Nokia 3310 */
|| !strcmp(DRVINSTANCE(state)->model, "NHM-6")) { /* Nokia 3330 */
/* in this case we have: length, encoding indicator, text */
namelen = pnok_string_encode(pos + 2, 255, note->text);
@@ -2724,9 +2724,8 @@ static gn_error IncomingCalendar(int messagetype,
unsigned char *message, int le
return GN_ERR_MEMORYFULL;
case 0x7d:
return GN_ERR_UNKNOWN;
- case 0x81:
- /* calendar functions are busy. well, this
status code is better than nothing */
- return GN_ERR_LINEBUSY;
+ case 0x81: /* calendar functions are busy. well, this
status code is better than nothing */
+ return GN_ERR_LINEBUSY;
case 0x8d: /* waiting for PIN */
return GN_ERR_CODEREQUIRED;
default:
@@ -2777,7 +2776,7 @@ static gn_error IncomingCalendar(int messagetype,
unsigned char *message, int le
note->alarm.timestamp.second = *pos++;
note->alarm.enabled = (note->alarm.timestamp.year != 0);
n = *pos++;
- if (!strcmp(DRVINSTANCE(state)->model, "NHM-5")
/* Nokia 3310 */
+ if (!strcmp(DRVINSTANCE(state)->model, "NHM-5")
/* Nokia 3310 */
|| !strcmp(DRVINSTANCE(state)->model, "NHM-6")) {
/* Nokia 3330 */
pos++; /* skip encoding byte FIXME: decode
accordingly */
n--; /* text length */
@@ -3144,7 +3143,7 @@ static gn_error IncomingSecurity(int messagetype,
unsigned char *message, int le
data->raw_data->length = length - 20;
}
break;
-
+
/* Set bin ringtone result */
case 0xa0:
switch (message[4]) {
@@ -3467,7 +3466,7 @@ static gn_error IncomingCallInfo(int messagetype,
unsigned char *message, int le
if (DRVINSTANCE(state)->call_notification)
DRVINSTANCE(state)->call_notification(GN_CALL_Incoming,
&cinfo, state, DRVINSTANCE(state)->call_callback_data);
return GN_ERR_UNSOLICITED;
-
+
/* answered call */
case 0x07:
return GN_ERR_UNSOLICITED;
@@ -3481,7 +3480,7 @@ static gn_error IncomingCallInfo(int messagetype,
unsigned char *message, int le
if (!data->call_info) return GN_ERR_UNSOLICITED;
data->call_info->call_id = message[4];
break;
-
+
/* message after "terminated call" */
case 0x0a:
return GN_ERR_UNSOLICITED;
@@ -3551,12 +3550,12 @@ static gn_error IncomingCallInfo(int messagetype,
unsigned char *message, int le
case 0x43:
if (message[4] != 0x02) return GN_ERR_UNHANDLEDFRAME;
return GN_ERR_UNSOLICITED;
-
+
/* FIXME: response from answer1? - bozo */
case 0x44:
if (message[4] != 0x68) return GN_ERR_UNHANDLEDFRAME;
return GN_ERR_UNSOLICITED;
-
+
/* DTMF sent */
case 0x51:
break;
@@ -3621,13 +3620,13 @@ static gn_error IncomingRLPFrame(int messagetype,
unsigned char *message, int le
DRVINSTANCE(state)->rlp_rx_callback(NULL);
return GN_ERR_NONE;
}
-
+
/*
* Nokia uses 240 bit frame size of RLP frames as per GSM 04.22
* specification, so Header consists of 16 bits (2 bytes). See section
* 4.1 of the specification.
*/
-
+
frame.Header[0] = message[2];
frame.Header[1] = message[3];
@@ -3635,9 +3634,9 @@ static gn_error IncomingRLPFrame(int messagetype,
unsigned char *message, int le
* Next 200 bits (25 bytes) contain the Information. We store the
* information in the Data array.
*/
-
+
memcpy(frame.Data, message + 4, 25);
-
+
/* The last 24 bits (3 bytes) contain FCS. */
frame.FCS[0] = message[29];
frame.FCS[1] = message[30];
@@ -3732,7 +3731,7 @@ static gn_error IncomingSecurityCode(int messagetype,
unsigned char *message, in
default:
return GN_ERR_UNHANDLEDFRAME;
}
-
+
/* security code status */
case 0x08:
dprintf("Message: Security Code status received: ");
@@ -3747,12 +3746,12 @@ static gn_error IncomingSecurityCode(int messagetype,
unsigned char *message, in
}
if (data->security_code) data->security_code->type = message[4];
break;
-
+
/* security code OK */
case 0x0b:
dprintf("Message: Security code accepted.\n");
break;
-
+
default:
return GN_ERR_UNHANDLEDFRAME;
}
diff --git a/common/phones/nk6160.c b/common/phones/nk6160.c
index e102267..a87efe6 100644
--- a/common/phones/nk6160.c
+++ b/common/phones/nk6160.c
@@ -139,7 +139,7 @@ static gn_error initialise(struct gn_statemachine *state)
if (!(drvinst = malloc(sizeof(nk6160_driver_instance))))
return GN_ERR_FAILED;
state->driver.driver_instance = drvinst;
-
+
switch (state->config.connection_type) {
case GN_CT_Serial:
case GN_CT_Infrared:
@@ -174,7 +174,7 @@ static gn_error initialise(struct gn_statemachine *state)
data.model = model;
error = identify(&data, state);
- if (error)
+ if (error)
goto out;
dprintf("model: '%s'\n", model);
if ((pm = gn_phone_model_get(model)) == NULL) {
@@ -182,7 +182,7 @@ static gn_error initialise(struct gn_statemachine *state)
dump("Please read Docs/Bugs and send a bug report!\n");
error = GN_ERR_INTERNALERROR;
}
-out:
+out:
if (error) {
dprintf("Initialization failed (%d)\n", error);
free(NK6160_DRVINST(state));
diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index 6d26958..8e581e2 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -329,7 +329,7 @@ static gn_memory_type get_gn_memory_type(int memory_type);
static gn_incoming_function_type nk6510_incoming_functions[] = {
{ NK6510_MSG_RESET, NK6510_IncomingReset },
- { NK6510_MSG_FOLDER, NK6510_IncomingFolder },
+ { NK6510_MSG_FOLDER, NK6510_IncomingFolder },
{ NK6510_MSG_SMS, NK6510_IncomingSMS },
{ NK6510_MSG_PHONEBOOK, NK6510_IncomingPhonebook },
{ NK6510_MSG_NETSTATUS, NK6510_IncomingNetwork },
@@ -394,7 +394,7 @@ static gn_error NK6510_Functions(gn_operation op, gn_data
*data, struct gn_state
return pgen_terminate(data, state);
case GN_OP_GetModel:
return NK6510_GetModel(data, state);
- case GN_OP_GetRevision:
+ case GN_OP_GetRevision:
return NK6510_GetRevision(data, state);
case GN_OP_GetImei:
return NK6510_GetIMEI(data, state);
@@ -612,7 +612,7 @@ static gn_error NK6510_Initialise(struct gn_statemachine
*state)
* Data Sequence
* UUID16 : 0x0003 - RFCOMM
* Channel/Port (Integer) : 0xe
- *
+ *
* The main secret of this is that they use RFCOMM
channel 14 for their
* communication protocol."
*/
@@ -1205,7 +1205,7 @@ static gn_error NK6510_GetSMSStatus(gn_data *data, struct
gn_statemachine *state
static gn_error NK6510_GetSMSFolders_S40_30(gn_data *data, struct
gn_statemachine *state)
{
- gn_file_list fl;
+ gn_file_list fl;
gn_error error;
int j, i;
@@ -1287,7 +1287,7 @@ static gn_error NK6510_CreateSMSFolder(gn_data *data,
struct gn_statemachine *st
static gn_error NK6510_GetSMSFolderStatus_S40_30(gn_data *data, struct
gn_statemachine *state)
{
- gn_file_list fl;
+ gn_file_list fl;
gn_error error;
int j, k;
@@ -1346,7 +1346,7 @@ static gn_error NK6510_GetSMSFolderStatus(gn_data *data,
struct gn_statemachine
* Inbox and outbox messages can be either in SIM or phone memory.
* Other folders are just in the phone memory.
*/
- if ((req[5] == NK6510_MEMORY_IN) || (req[5] ==
NK6510_MEMORY_OU)) { /* special case IN/OUTBOX */
+ if ((req[5] == NK6510_MEMORY_IN) || (req[5] == NK6510_MEMORY_OU)) { /*
special case IN/OUTBOX */
dprintf("Special case IN/OUTBOX in GetSMSFolderStatus!\n");
/* Get ME folder list */
@@ -1404,7 +1404,7 @@ static gn_error NK6510_GetSMSMessageStatus(gn_data *data,
struct gn_statemachine
dprintf("Getting SMS message (%i in folder %i) status...\n",
data->raw_sms->number, data->raw_sms->memory_type);
- req[5] = get_memory_type(data->raw_sms->memory_type);
+ req[5] = get_memory_type(data->raw_sms->memory_type);
req[6] = data->raw_sms->number / 256;
req[7] = data->raw_sms->number % 256;
SEND_MESSAGE_BLOCK(NK6510_MSG_FOLDER, 10);
@@ -1594,8 +1594,8 @@ static gn_error NK6510_GetSMS(gn_data *data, struct
gn_statemachine *state)
static gn_error NK6510_GetSMS_S40_30(gn_data *data, struct gn_statemachine
*state)
{
- gn_file_list fl, fl2;
- gn_file fi;
+ gn_file_list fl, fl2;
+ gn_file fi;
gn_error error;
int j, i, cont_len, tota_len, offset;
unsigned char *bin;
@@ -1676,8 +1676,8 @@ static gn_error NK6510_GetSMS_S40_30(gn_data *data,
struct gn_statemachine *stat
static gn_error NK6510_DeleteSMS_S40_30(gn_data *data, struct gn_statemachine
*state)
{
- gn_file_list fl, fl2;
- gn_file fi;
+ gn_file_list fl, fl2;
+ gn_file fi;
gn_error error;
int j, i;
@@ -1739,15 +1739,15 @@ static gn_error NK6510_DeleteSMS_S40_30(gn_data *data,
struct gn_statemachine *s
static gn_error NK6510_SaveSMS(gn_data *data, struct gn_statemachine *state)
{
unsigned char req[256] = { FBUS_FRAME_HEADER, 0x00,
- 0x02, /* 1 = SIM, 2 =
ME */
- 0x02, /* Folder
*/
- 0x00, 0x00, /* Location
*/
- 0x03 }; /* SMS state
*/
+ 0x02, /* 1 = SIM, 2 =
ME */
+ 0x02, /* Folder
*/
+ 0x00, 0x00, /* Location
*/
+ 0x03 }; /* SMS state
*/
#if 0
unsigned char req2[200] = { FBUS_FRAME_HEADER, 0x16,
- 0x02, /* 1 = SIM, 2 =
ME */
- 0x02, /* Folder
*/
- 0x00, 0x01}; /* Location
*/
+ 0x02, /* 1 = SIM, 2 =
ME */
+ 0x02, /* Folder
*/
+ 0x00, 0x01}; /* Location
*/
unsigned char desc[10];
#endif
gn_error error = GN_ERR_NONE;
@@ -2194,7 +2194,7 @@ static gn_error NK6510_GetFileList(gn_data *data, struct
gn_statemachine *state)
unsigned char req[512] = {FBUS_FRAME_HEADER, 0x68, 0x00};
int i;
- if (!data->file_list) return GN_ERR_INTERNALERROR;
+ if (!data->file_list) return GN_ERR_INTERNALERROR;
data->file_list->file_count = 0;
i = strlen(data->file_list->path);
@@ -2211,8 +2211,8 @@ static gn_error NK6510_GetFileDetailsById(gn_data *data,
struct gn_statemachine
0x00, 0x00 }; /* Location */
int length, i;
- if (!data->file)
- return GN_ERR_INTERNALERROR;
+ if (!data->file)
+ return GN_ERR_INTERNALERROR;
length = data->file->id[0];
for (i = 0; i < length; i++) {
@@ -2231,7 +2231,7 @@ static gn_error NK6510_GetFileId(gn_data *data, struct
gn_statemachine *state)
unsigned char req[512] = {FBUS_FRAME_HEADER, 0x82, 0x00};
int i;
- if (!data->file) return GN_ERR_INTERNALERROR;
+ if (!data->file) return GN_ERR_INTERNALERROR;
i = strlen(data->file->name);
req[5] = char_unicode_encode(req+6, data->file->name, i);
@@ -2258,8 +2258,8 @@ static gn_error NK6510_GetFile(gn_data *data, struct
gn_statemachine *state)
DRVINSTANCE(state)->progress_callback_data =
data->callback_data;
}
- if (!data->file)
- return GN_ERR_INTERNALERROR;
+ if (!data->file)
+ return GN_ERR_INTERNALERROR;
i = strlen(data->file->name);
/* Get the file size */
@@ -2276,8 +2276,8 @@ static gn_error NK6510_GetFile(gn_data *data, struct
gn_statemachine *state)
/* Start the transfer */
req2[7] = char_unicode_encode(req2 + 8, data->file->name, i);
data->file->togo = 0;
- if (sm_message_send(req2[7] + 12, NK6510_MSG_FILE, req2, state))
- return GN_ERR_NOTREADY;
+ if (sm_message_send(req2[7] + 12, NK6510_MSG_FILE, req2, state))
+ return GN_ERR_NOTREADY;
err = sm_block(NK6510_MSG_FILE, data, state);
if (err != GN_ERR_NONE)
return err;
@@ -2337,8 +2337,8 @@ static gn_error NK6510_GetFileById(gn_data *data, struct
gn_statemachine *state)
DRVINSTANCE(state)->progress_callback_data =
data->callback_data;
}
- if (!data->file)
- return GN_ERR_INTERNALERROR;
+ if (!data->file)
+ return GN_ERR_INTERNALERROR;
length = data->file->id[0];
for (i = 0; i < length; i++) {
@@ -2389,15 +2389,15 @@ static gn_error NK6510_PutFile(gn_data *data, struct
gn_statemachine *state)
gn_error err;
int i;
- if (!data->file)
- return GN_ERR_INTERNALERROR;
+ if (!data->file)
+ return GN_ERR_INTERNALERROR;
i = strlen(data->file->name);
/* Start the transfer */
req1[7] = char_unicode_encode(req1+8, data->file->name, i);
data->file->togo = 0;
- if (sm_message_send(req1[7]+12, NK6510_MSG_FILE, req1, state))
- return GN_ERR_NOTREADY;
+ if (sm_message_send(req1[7]+12, NK6510_MSG_FILE, req1, state))
+ return GN_ERR_NOTREADY;
err = sm_block(NK6510_MSG_FILE, data, state);
if (err != GN_ERR_NONE)
return err;
@@ -2438,8 +2438,8 @@ static gn_error NK6510_DeleteFile(gn_data *data, struct
gn_statemachine *state)
unsigned char req[512] = {FBUS_FRAME_HEADER, 0x62, 0x00};
int i;
- if (!data->file)
- return GN_ERR_INTERNALERROR;
+ if (!data->file)
+ return GN_ERR_INTERNALERROR;
i = strlen(data->file->name);
req[5] = char_unicode_encode(req+6, data->file->name, i);
@@ -2454,8 +2454,8 @@ static gn_error NK6510_DeleteFileById(gn_data *data,
struct gn_statemachine *sta
0x00, 0x00}; /* file identifier */
int i, length;
- if (!data->file)
- return GN_ERR_INTERNALERROR;
+ if (!data->file)
+ return GN_ERR_INTERNALERROR;
length = data->file->id[0];
for (i = 0; i < length; i++) {
@@ -2482,7 +2482,7 @@ static gn_error NK6510_IncomingFile(int messagetype,
unsigned char *message, int
i = (message[8] << 8) + message[9];
memcpy(data->file->file + data->file->file_length -
data->file->togo, message+10, i);
data->file->togo -= i;
- }
+ }
break;
case 0x15: /* Answer for GetFileDetailsById */
if (!data->file || !data->file_list) {
@@ -2586,7 +2586,7 @@ static gn_error NK6510_IncomingFile(int messagetype,
unsigned char *message, int
i = (message[8] << 8) + message[9];
memcpy(data->file->file + data->file->file_length -
data->file->togo, message+10, i);
data->file->togo -= i;
- }
+ }
break;
case 0x63:
/* Deleted ok */
@@ -5547,19 +5547,19 @@ static gn_error NK6510_IncomingWAP(int messagetype,
unsigned char *message, int
dprintf(" IP: %s\n", data->wap_setting->gsm_data_ip);
pos += string_length;
- string_length = message[pos++] << 8;
+ string_length = message[pos++] << 8;
string_length = (string_length | message[pos++]) << 1;
char_unicode_decode(data->wap_setting->number, message + pos,
string_length);
dprintf(" Number: %s\n", data->wap_setting->number);
pos += string_length;
- string_length = message[pos++] << 8;
+ string_length = message[pos++] << 8;
string_length = (string_length | message[pos++]) << 1;
char_unicode_decode(data->wap_setting->gsm_data_username,
message + pos, string_length);
dprintf(" Username: %s\n",
data->wap_setting->gsm_data_username);
pos += string_length;
- string_length = message[pos++] << 8;
+ string_length = message[pos++] << 8;
string_length = (string_length | message[pos++]) << 1;
char_unicode_decode(data->wap_setting->gsm_data_password,
message + pos, string_length);
dprintf(" Password: %s\n",
data->wap_setting->gsm_data_password);
@@ -5579,13 +5579,13 @@ static gn_error NK6510_IncomingWAP(int messagetype,
unsigned char *message, int
dprintf(" Access point: %s\n",
data->wap_setting->access_point_name);
pos += string_length;
- string_length = message[pos++] << 8;
+ string_length = message[pos++] << 8;
string_length = (string_length | message[pos++]) << 1;
char_unicode_decode(data->wap_setting->gprs_ip, message + pos,
string_length);
dprintf(" IP: %s\n", data->wap_setting->gprs_ip);
pos += string_length;
- string_length = message[pos++] << 8;
+ string_length = message[pos++] << 8;
string_length = (string_length | message[pos++]) << 1;
char_unicode_decode(data->wap_setting->gprs_username, message +
pos, string_length);
dprintf(" Username: %s\n", data->wap_setting->gprs_username);
diff --git a/common/phones/nk7110.c b/common/phones/nk7110.c
index 074637f..bec50dc 100644
--- a/common/phones/nk7110.c
+++ b/common/phones/nk7110.c
@@ -1088,7 +1088,7 @@ static gn_error NK7110_IncomingFolder(int messagetype,
unsigned char *message, i
memcpy(data->raw_sms->message_center, message + 9, 12);
memcpy(data->raw_sms->remote_number, message +
get_data(T, 25, 26, 24, 22), 12);
}
- if (T == GN_SMS_MT_DeliveryReport)
+ if (T == GN_SMS_MT_DeliveryReport)
memcpy(data->raw_sms->time, message + 43, 7);
data->raw_sms->dcs = message[23];
@@ -1372,7 +1372,7 @@ static gn_error NK7110_GetSMSFolderStatus(gn_data *data,
struct gn_statemachine
dprintf("Getting SMS Folder (%i) status ...\n", req[4]);
- if (req[4] == NK7110_MEMORY_IN) { /* special case INBOX */
+ if (req[4] == NK7110_MEMORY_IN) { /* special case INBOX */
dprintf("Special case INBOX in GetSMSFolderStatus!\n");
@@ -2004,7 +2004,7 @@ static gn_error NK7110_GetCalendarNote(gn_data *data,
struct gn_statemachine *st
req[4] =
data->calnote_list->location[data->calnote->location - 1] >> 8;
req[5] =
data->calnote_list->location[data->calnote->location - 1] & 0xff;
data->calnote->time.year = tmptime.year;
-
+
error = sm_message_send(6,
NK7110_MSG_CALENDAR, req, state);
if (error == GN_ERR_NONE) {
error =
sm_block(NK7110_MSG_CALENDAR, data, state);
@@ -2386,9 +2386,9 @@ static int PackWAPString(unsigned char *dest, unsigned
char *string, int length_
static gn_error NK7110_WriteWAPSetting(gn_data *data, struct gn_statemachine
*state)
{
unsigned char req[200] = { FBUS_FRAME_HEADER, 0x18,
- 0x00 }; /* Location */
+ 0x00 }; /* Location */
unsigned char req1[200] = { FBUS_FRAME_HEADER, 0x1e,
- 0x00 }; /* Location */
+ 0x00 }; /* Location */
unsigned char req2[] = { FBUS_FRAME_HEADER, 0x15,
0x00 }; /* Location */
@@ -3366,7 +3366,7 @@ static gn_error NK7110_MakeCall(gn_data *data, struct
gn_statemachine *state)
req[pos++] = len / 2;
pos += len;
- switch (data->call_info->send_number) {
+ switch (data->call_info->send_number) {
case GN_CALL_Never: voice_end[5] = 0x01; break;
case GN_CALL_Always: voice_end[5] = 0x00; break;
case GN_CALL_Default: voice_end[5] = 0x00; break;
--
1.5.3.8