Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

I've got an app that uses IDABASE to store information.

On the Nokia 6255 the application resets whenever I use the IDBRecord_NextField() call to move through the fields of a db.

This same code has worked on 20 - 30 other handsets... anyone else notice any problems with IDATABASE?

IDBRecord* pRecord = IDATABASE_GetRecordByID(m_pIDatabase, recordId);
if(pRecord)
{
AEEDBFieldName fieldName;
AEEDBFieldType fieldType;
uint16 fieldSize;

//want to move to the third field of the record but nokia 6255 powercycles
//on first call to IDBRECORD_NextField

IDBRECORD_NextField(pRecord, &fieldName, &fieldSize); //name
IDBRECORD_NextField(pRecord, &fieldName, &fieldSize); //info
IDBRECORD_NextField(pRecord, &fieldName, &fieldSize); //data!

void* bytes = IDBRECORD_GetField(pRecord, &fieldName, &fieldType, &fieldSize);
.
.
.

gscott2112,
I faced with the same issue on Nokia 6255, device resets when IDBRecord_NextField is called.
The only thing I found out is that if AEEDBFieldName and uint16 are created dynamically (using MALLOC, not as stack variables) IDBRECORD_NextField doesn’t reset device, but data returned is not the same data that the record was created with (even AEEDBFieldName is different):
AEEDBFieldType fieldType;
AEEDBFieldName *fn = (AEEDBFieldName *)MALLOC(sizeof(AEEDBFieldName));
int16 *fieldSize = (uint16 *)MALLOC(sizeof(uint16));
dword *data = (dword *)MALLOC(sizeof(dword));
if(fn && fieldSize && data)
{
IDBRECORD_Reset(pRecord);
while( (fieldType = IDBRECORD_NextField(pRecord, fn, fieldSize)) != AEEDB_FT_NONE)
{
if((*fn) == fieldName)
{
IDBRECORD_GetFieldDWord(pRecord, data);
retData = (*data);
break;
}
}

FREEIF(fn);
FREEIF(fieldSize);
FREEIF(data);
Did you manage to find the solusion for this?
Thank you!

gscott2112,
I faced with the same issue on Nokia 6255, device resets when IDBRecord_NextField is called.
The only thing I found out is that if AEEDBFieldName and uint16 are created dynamically (using MALLOC, not as stack variables) IDBRECORD_NextField doesn’t reset device, but data returned is not the same data that the record was created with (even AEEDBFieldName is different):
AEEDBFieldType fieldType;
AEEDBFieldName *fn = (AEEDBFieldName *)MALLOC(sizeof(AEEDBFieldName));
int16 *fieldSize = (uint16 *)MALLOC(sizeof(uint16));
dword *data = (dword *)MALLOC(sizeof(dword));
if(fn && fieldSize && data)
{
IDBRECORD_Reset(pRecord);
while( (fieldType = IDBRECORD_NextField(pRecord, fn, fieldSize)) != AEEDB_FT_NONE)
{
if((*fn) == fieldName)
{
IDBRECORD_GetFieldDWord(pRecord, data);
retData = (*data);
break;
}
}

FREEIF(fn);
FREEIF(fieldSize);
FREEIF(data);
Did you manage to find the solusion for this?
Thank you!

Yeah,
It's because the Nokia's use a different chip than most of the other phones.
For the Nokia builds (I'm using GCC) I had to remove the
-fshort_enums
flag from the make file. Once I did that, it worked like a champ.

Yeah,
It's because the Nokia's use a different chip than most of the other phones.
For the Nokia builds (I'm using GCC) I had to remove the
-fshort_enums
flag from the make file. Once I did that, it worked like a champ.

Thank you so much!
Now it works fine!!!
:D

Thank you so much!
Now it works fine!!!
:D