/* Obtains the contents of the firmware data segment that was specified by the index parameter.  */
LIBOPENBLT_EXPORT uint8_t* BltFirmwareGetSegment(uint32_t idx, uint32_t *address, uint32_t *len)
/* Obtains the contents of the firmware data segment that was specified by the index parameter.  */
LIBOPENBLT_EXPORT uint8_t* BltFirmwareGetSegment(uint32_t idx, uint32_t *address, uint32_t *len)
{
  uint8_t * result = NULL;
  tFirmwareSegment *segmentPtr;
  assert(idx < FirmwareGetSegmentCount());
  assert(address != NULL);
  assert(len != NULL); 
  if ((address != NULL) && (len != NULL) &&
      (idx < FirmwareGetSegmentCount()) )
  {
    segmentPtr = FirmwareGetSegment(idx);
    if (segmentPtr != NULL)
    {
      *address = segmentPtr->base;
      *len = segmentPtr->length;
      result = segmentPtr->data;
    }
  }
  return result;
}