Пример #1
0
void DCT4GetPBKFeatures(int argc, char *argv[])
{
	GSM_MemoryType	MemoryType=0;
	GSM_Error error;
	unsigned char 	req[] = {N6110_FRAME_HEADER, 0x25,
				 0x05, 	// memory type
				 0x00};

	if (strcasecmp(argv[2],"DC") == 0) MemoryType=MEM_DC;
	if (strcasecmp(argv[2],"ON") == 0) MemoryType=MEM_ON;
	if (strcasecmp(argv[2],"RC") == 0) MemoryType=MEM_RC;
	if (strcasecmp(argv[2],"MC") == 0) MemoryType=MEM_MC;
	if (strcasecmp(argv[2],"ME") == 0) MemoryType=MEM_ME;
	if (strcasecmp(argv[2],"SM") == 0) MemoryType=MEM_SM;
	if (strcasecmp(argv[2],"VM") == 0) MemoryType=MEM_VM;
	if (strcasecmp(argv[2],"FD") == 0) MemoryType=MEM_FD;
	if (MemoryType==0) {
		printf(_("ERROR: unknown memory type (\"%s\")\n"),argv[2]);
		Terminate(2);
	}

	req[4] = NOKIA_GetMemoryType(gsm, MemoryType,N71_65_MEMORY_TYPES);
	if (req[4]==0xff) Terminate(3);

	GSM_Init(TRUE);

        CheckDCT4();

	gsm->User.UserReplyFunctions=UserReplyFunctions4;

	error=GSM_WaitFor (gsm, req, 6, 0x03, 4, ID_User3);
	Print_Error(error);

	GSM_Terminate();
}
Пример #2
0
static GSM_Error N3320_GetMemoryStatus(GSM_StateMachine *s, GSM_MemoryStatus *Status)
{
	unsigned char req[] = {N6110_FRAME_HEADER, 0x03, 0x02,
			       0x00,		/* memory type */
			       0x55, 0x55, 0x55, 0x00};

	req[5] = NOKIA_GetMemoryType(s, Status->MemoryType,N71_65_MEMORY_TYPES);
	if (Status->MemoryType == MEM_SM) return ERR_NOTSUPPORTED;
	if (req[5]==0xff) return ERR_NOTSUPPORTED;

	s->Phone.Data.MemoryStatus=Status;
	smprintf(s, "Getting memory status\n");
	return GSM_WaitFor (s, req, 10, 0x03, 4, ID_GetMemoryStatus);
}
Пример #3
0
static GSM_Error N3320_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry)
{
	unsigned char req[] = {N6110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01,
			       0xfe, 0x10, 	/* memory type */
			       0x00, 0x00, 0x00, 0x00,
			       0x00, 0x01, 	/* location */
			       0x00, 0x00, 0x01};

	req[9] = NOKIA_GetMemoryType(s, entry->MemoryType,N71_65_MEMORY_TYPES);
	if (entry->MemoryType == MEM_SM) return ERR_NOTSUPPORTED;
	if (req[9]==0xff) return ERR_NOTSUPPORTED;

	if (entry->Location==0x00) return ERR_INVALIDLOCATION;

	req[14] = entry->Location / 256;
	req[15] = entry->Location % 256;

	s->Phone.Data.Memory=entry;
	smprintf(s, "Getting phonebook entry\n");
	return GSM_WaitFor (s, req, 19, 0x03, 4, ID_GetMemory);
}