hi

i must be seriously jetlagged :) or i just woke up on the wrong
side of bed today :) i am looking at getting the deviceUniqueID
for a SD card .. and, the code is as follows:

---
#ifdef PLATFORM_SD
  UInt32 expMgrVersion;
  Err    err;

  globals->idType  = uniqueID;
  globals->dataPtr = NULL;

  MemSet(globals->data.deviceUniqueID, expCardInfoStringMaxLen+1, 0);
  err = FtrGet(sysFileCExpansionMgr, expFtrIDVersion, &expMgrVersion);
  if (err == errNone)
  {
    ExpCardInfoType cardInfo;
    UInt16          slotRef;
    UInt32          slotIterator;

    slotIterator = expIteratorStart;
    while (slotIterator != expIteratorStop)
    {
      err = ExpSlotEnumerate(&slotRef, &slotIterator);
      if (err == errNone)
      {
        // suck the info from the card
        err = ExpCardInfo(slotRef, &cardInfo);
        if ((err == errNone) && (slotRef != expInvalidSlotRefNum))
        {
          StrCopy(cardInfo.deviceUniqueIDStr, globals->data.deviceUniqueID);
          if (globals->data.deviceUniqueID[0] != '\0')
            globals->dataPtr = globals->data.deviceUniqueID;
        }
#ifdef DEBUG
        else
        {
          Char str[32];

          switch (err)
          {
            case expErrCardNotPresent:
                 StrCopy(str, "Card Not Present.");
                 break;
  
            case expErrInvalidSlotRefNum:
                 StrCopy(str, "Invalid Slot Reference.");
                 break;
  
            case expErrSlotDeallocated:
                 StrCopy(str, "Slot Deallocated.");
                 break;
  
            default:
                 StrCopy(str, "invalid slot reference.");
                 break;
          }
          FrmCustomAlert(debugAlert, "Unable to read card info", str, NULL);
        }
#endif
      }
      else goto CARD_FIND_EXIT;
    }
  }
#ifdef DEBUG
  else
    FrmCustomAlert(debugAlert, "ExpansionMgr not found.", NULL, NULL);
#endif

CARD_FIND_EXIT:

#endif

  any enlightenment? :)

// az
[EMAIL PROTECTED]
http://www.ardiri.com/


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to