This commit was manufactured by cvs2svn to create tag 'bp_uc'.
[gnokii.git] / common / newmodules / n7110.c
index 78bffaf..9f0f205 100644 (file)
@@ -130,6 +130,7 @@ GSM_Information N7110_Information = {
   "",
   "6210|6250|7110", /* Supported models in FBUS over Irda sockets */
   "",
+  "",
   5,                     /* Max RF Level */
   0,                     /* Min RF Level */
   GRF_Arbitrary,         /* RF level units */
@@ -2460,14 +2461,14 @@ GSM_Error N7110_DeletePhonebookLocation(GSM_PhonebookEntry *entry)
     0x05, /* mem location low*/
     0x00, /* mem location high*/
     0x00, 0x00
-      };
+  };
 
-   req[12] = (entry->Location >> 8);
-   req[13] = entry->Location & 0xff;
-   req[14] = N7110_GetMemoryType(entry->MemoryType);
+  req[12] = (entry->Location >> 8);
+  req[13] = entry->Location & 0xff;
+  req[14] = N7110_GetMemoryType(entry->MemoryType);
  
 #ifdef DEBUG
-       fprintf(stdout, _("Deleting phonebook entry at location %d...\n"),entry->Location);
+  fprintf(stdout, _("Deleting phonebook entry at location %d...\n"),entry->Location);
 #endif
   
   return NULL_SendMessageSequence(50, &CurrentPhonebookError, 18, 0x03, req);
@@ -2689,7 +2690,7 @@ GSM_Error N7110_SetBitmap(GSM_Bitmap *Bitmap)
       if (NULL_SendMessageSequence (50, &CurrentGetBitmapError, 7, 0x14, req2)!=GE_NONE) break;
       if (PictureImageNum==Bitmap->number+1) break;
     }
-    if (CurrentGetBitmapError!=GE_NONE) {
+    if (PictureImageNum!=Bitmap->number+1) {
       req4[5]=0x21;
       req4[6]=0;
       req4[7]=0;
@@ -2698,15 +2699,49 @@ GSM_Error N7110_SetBitmap(GSM_Bitmap *Bitmap)
       req4[6]=PictureImageIndex/256;
       req4[7]=PictureImageIndex%256;
     }
-    count=7;
-    for (i=0;i<38;i++) req4[count++]=0x00;
+
+    /* Cleaning */
+    for (i=0;i<36;i++) req4[i+9]=0;
+
+    count=8;
+    if (strlen(Bitmap->text)==0) {
+      count+=2 ;req4[count]=0x0c;
+      count+=2 ;req4[count]=0x0d;
+      count+=2 ;req4[count]=0x0e;
+      count+=2 ;req4[count]=0x0f;
+      count+=2 ;req4[count]=0x10;
+      count+=2 ;req4[count]=0x11;
+      count+=23;req4[count]=0x02;
+      count++  ;req4[count]=0x01;
+      count+=2;
+    } else {
+      count+=2 ;req4[count]=0x54;
+      count++  ;req4[count]=0xd4;
+      count++  ;req4[count]=0x0d;
+      count+=2 ;req4[count]=0x0e;
+      count+=2 ;req4[count]=0x0f;
+      count+=2 ;req4[count]=0x10;
+      count+=2 ;req4[count]=0x11;
+      count+=21;req4[count]=0x01;
+      count+=3 ;req4[count]=0x01;
+      count+=2;
+    }
+
+    req4[count++]=0x01;
     req4[count++]=Bitmap->width;
     req4[count++]=Bitmap->height;
     req4[count++]=Bitmap->size/256;
     req4[count++]=Bitmap->size%256;
-    memcpy(reqOp+count,Bitmap->bitmap,Bitmap->size);
+    memcpy(req4+count,Bitmap->bitmap,Bitmap->size);
     count += Bitmap->size;
-    req4[count++]=0x00;
+
+    if (strlen(Bitmap->text)!=0) {
+      req4[count] = strlen(Bitmap->text);
+      GSM_PackSevenBitsToEight(0, Bitmap->text, req4+count+1);
+      count=count+req4[count];
+    } else {
+      req4[count++]=0x00;
+    }
     req4[count++]=0x00;
 
     CurrentSetBitmapError = GE_BUSY;
@@ -2854,6 +2889,7 @@ int ReturnBinRingLocation()
 
   if (strcmp(model,"NSE-5") == 0) return 0x74; //first 0x74 //7110
   if (strcmp(model,"NPE-3") == 0) return 0x89; //first is 0x89; //6210
+  if (strcmp(model,"NHM-3") == 0) return 0x89; //quess for 6250
     
   return 0;
 }
@@ -3324,7 +3360,15 @@ void N7110_Dispatch0x14Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageT
       CurrentSMSMessageError = GE_NONE;
       break;
     }
-    
+  case 0x51:
+#ifdef DEBUG
+    fprintf(stdout, _("Message: Picture Image saved OK\n"));
+    fprintf(stdout, _("  folder  : %02x\n"),MessageBuffer[4]);
+    fprintf(stdout, _("  location: %02x\n"),MessageBuffer[5]*256+MessageBuffer[6]);
+#endif /* DEBUG */
+    CurrentSetBitmapError=GE_NONE;
+    break;
+
   case 0x97:
 
 #ifdef DEBUG