/[gnokii]/gnokii/common/phones/nk6100.c
ViewVC logotype

Diff of /gnokii/common/phones/nk6100.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.173 by pkot, Tue May 17 07:49:06 2005 UTC revision 1.174 by pkot, Tue May 17 10:15:14 2005 UTC
# Line 223  struct { Line 223  struct {
223          { "NHM-5",      NULL,           NK6100_CAP_PB_UNICODE }, /* 3310 */          { "NHM-5",      NULL,           NK6100_CAP_PB_UNICODE }, /* 3310 */
224          { "NHM-6",      NULL,           NK6100_CAP_PB_UNICODE }, /* 3330 */          { "NHM-6",      NULL,           NK6100_CAP_PB_UNICODE }, /* 3330 */
225          { "NHM-2",      NULL,           NK6100_CAP_PB_UNICODE }, /* 3410 */          { "NHM-2",      NULL,           NK6100_CAP_PB_UNICODE }, /* 3410 */
226          { "NSM-3D",     NULL,           NK6100_CAP_PB_UNICODE }, /* 8250 */          { "NSM-3D",     NULL,           NK6100_CAP_PB_UNICODE | NK6100_CAP_CAL_UNICODE }, /* 8250 */
227          { "RPM-1",      "-4.23",        NK6100_CAP_NBS_UPLOAD }, /* Card Phone 2.0 */          { "RPM-1",      "-4.23",        NK6100_CAP_NBS_UPLOAD }, /* Card Phone 2.0 */
228          { "NSE-8",      NULL,           NK6100_CAP_OLD_KEY_API | NK6100_CAP_NO_PSTATUS | NK6100_CAP_NO_CB }, /* 3210 */          { "NSE-8",      NULL,           NK6100_CAP_OLD_KEY_API | NK6100_CAP_NO_PSTATUS | NK6100_CAP_NO_CB }, /* 3210 */
229          { "NSE-9",      NULL,           NK6100_CAP_OLD_KEY_API }, /* 3210 */          { "NSE-9",      NULL,           NK6100_CAP_OLD_KEY_API }, /* 3210 */
# Line 766  static gn_error WritePhonebook(gn_data * Line 766  static gn_error WritePhonebook(gn_data *
766          }          }
767          *pos++ = get_memory_type(pe->memory_type);          *pos++ = get_memory_type(pe->memory_type);
768          *pos++ = pe->location;          *pos++ = pe->location;
769          if (DRVINSTANCE(state)->capabilities & NK6100_CAP_PB_UNICODE) {          if (DRVINSTANCE(state)->capabilities & NK6100_CAP_PB_UNICODE)
770                  namelen = char_unicode_encode(pos + 1, pe->name, namelen);                  namelen = char_unicode_encode(pos + 1, pe->name, namelen);
771                  *pos++ = namelen;          else
         } else {  
772                  namelen = pnok_string_encode(pos + 1, namelen, pe->name);                  namelen = pnok_string_encode(pos + 1, namelen, pe->name);
773                  *pos++ = namelen;          *pos++ = namelen;
         }  
774          pos += namelen;          pos += namelen;
775          *pos++ = numlen;          *pos++ = numlen;
776          pnok_string_encode(pos, numlen, pe->number);          pnok_string_encode(pos, numlen, pe->number);
# Line 2429  static gn_error WriteCalendarNote(gn_dat Line 2427  static gn_error WriteCalendarNote(gn_dat
2427                                   0x00}; /* The type of calendar note */                                   0x00}; /* The type of calendar note */
2428          gn_calnote *note;          gn_calnote *note;
2429          unsigned char *pos;          unsigned char *pos;
2430          unsigned int numlen;          unsigned int numlen, namelen;
2431    
2432          if (!data->calnote)          if (!data->calnote)
2433                  return GN_ERR_UNKNOWN;                  return GN_ERR_UNKNOWN;
# Line 2470  static gn_error WriteCalendarNote(gn_dat Line 2468  static gn_error WriteCalendarNote(gn_dat
2468                  pos += 7;                  pos += 7;
2469          }          }
2470                    
2471            /* FIXME: use some constant not 255 magic number */
2472          *pos = pnok_string_encode(pos+1, 255, note->text);          if (DRVINSTANCE(state)->capabilities & NK6100_CAP_CAL_UNICODE)
2473          pos += *pos+1;                  namelen = char_unicode_encode(pos + 1, note->text, 255);
2474            else
2475                    namelen = pnok_string_encode(pos + 1, 255, note->text);
2476            *pos++ = namelen;
2477            pos += namelen;
2478    
2479          if (note->type == GN_CALNOTE_CALL) {          if (note->type == GN_CALNOTE_CALL) {
2480                  *pos++ = numlen;                  *pos++ = numlen;
# Line 2558  static gn_error IncomingCalendar(int mes Line 2560  static gn_error IncomingCalendar(int mes
2560                          note->alarm.timestamp.second = *pos++;                          note->alarm.timestamp.second = *pos++;
2561                          note->alarm.enabled = (note->alarm.timestamp.year != 0);                          note->alarm.enabled = (note->alarm.timestamp.year != 0);
2562                          n = *pos++;                          n = *pos++;
2563                          pnok_string_decode(note->text, sizeof(note->text), pos, n);                          if ((DRVINSTANCE(state)->capabilities & NK6100_CAP_CAL_UNICODE))
2564                                    char_unicode_decode(note->text, pos, n);
2565                            else
2566                                    pnok_string_decode(note->text, sizeof(note->text), pos, n);
2567                          pos += n;                          pos += n;
2568    
2569                          if (note->type == GN_CALNOTE_CALL) {                          if (note->type == GN_CALNOTE_CALL) {

Legend:
Removed from v.1.173  
changed lines
  Added in v.1.174

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26