SDK

IXPAND

Introduction

The SanDisk® iXpand is a family of storage accessories for devices running Apple’s iOS. iXpand devices enable transfer and storage of photos, music, videos and files between iPhones, iPads, PCs and Mac computers. iXpand accessories are accessible over Lightning® and USB connectors.

The SanDisk iXpand SDK enables third party application developers to access and manage iXpand devices from their own iOS applications through the Lightning interface.

The SDK includes the binaries, libraries, simulator, demo and information for creating your app, using native Swift iOS code and examples. These are intended to show basic developer use of the iXpand device through the API in a iOS development environment.

The development process is to integrate the iXpand SDK into your app, perform your validation process, and submit your app to Western Digital to obtain the Product Plan ID (PPID) code that will be asked for when you submit your app to Apple.

The following figure shows the high level architecture for applications developed on the iXpand SDK:

 

 

Figure 1 - Conceptual Block Diagram

SDK HOME

You will need a free WD Developer Portal account to download the binaries and libraries for the iXpand SDK - click here to sign up. After you have a WD Developer Portal account, click here to download the iXpand SDK.

 

SDK REQUIREMENTS

  • Mac® OS X® 10.8.5 or higher
  • 2 GB RAM or More
  • 8 GB or more hard disk space
  • Xcode 10.2 or above

 

LICENSES

Two external licensed code components are used in the SDK.

MBProgressHUD component:

Present in iXpandSDKDemo Application is subject to the following MIT License:

Copyright© 2011 Matej Bukovinski

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

FATFS component license:

Present in the SDK is the FatFs - Generic FAT Filesystem Module Rx.xx

Copyright (C) 2013, ChaN, all right reserved. FatFs module is an open source software. Redistribution and use of FatFs in source and binary forms, with or without modification, are permitted provided that the following condition is met:

  1. Redistributions of source code must retain the above copyright notice, this condition and the following disclaimer.

This software is provided by the copyright holder and contributors "AS IS" and any warranties related to this software are DISCLAIMED. The copyright owner or contributors be NOT LIABLE for any damages caused by use of this software.

The FATFS open source taken from following link http://elm-chan.org/fsw/ff/00index_e.html. For further information on use and licensing, refer to the following link http://elm-chan.org/fsw/ff/doc/appnote.html#license

^ Top

 

Concepts

The iXpand SDK contains two sets of API's:

  • File System API's
  • System API's

File system API's provide familiar filesystem API to the iXpand device for managing storage related software operations. System API's provide access to administration functionality not directly related to storage.

The iXpand SDK is available as an iOS framework file. A developer needs to include the framework and header files within the the target application’s source tree for successful integration.

^ Top

 

Modules Overview

To access the iXpand SDK, developers must first initialize “iXpandSystemController" and "FileSystemController" respectively. All system API's are accessible as part of "iXpandSystemController" and file system API's are accessible over “FileSystemController”.

To initialize the iXpand, "iXpandSystemController" instance is created first followed by calling "initDrive" and "OpenSession". When "OpenSession" is completed, iXpand is ready to communicate. Instances of "FileSystemController" can be created to deal with File System API's. When all operations with iXpand device are completed, the application can close communication with the device using "closeSession" API.

^ Top

 

COMPILATION INSTRUCTIONS

Include the “iXpandSDK.framework” along with other libraries that your application requires.

 

Figure 3 - Adding Library

In the application code, include the following header to allow access to the API's:

        #import <iXpandSDKlib/iXpandSDKlib.h>

^ Top

 

FILE WRITE EXAMPLE

The code snippet below shows how to initialize the iXpand drive:

if (![[iXpandSystemController sharedController] initDrive:accessory]) {           
            dispatch_sync(dispatch_get_main_queue(), ^{
                [self.consoleString appendString:@"Drive Initialisation failed"];
                [self updateConsole];
                    return;
            });
     } else {
    If( [[iXpandSystemController sharedController] openSession]) {
         // iXpand is successfully opened
   }
}

The following code snippet shows an example of opening a file and writing to iXpand:

If([[iXpandFileSystemController sharedController]
changeDirectoryAbsolutePath:@"\\"]){
            Int handle = [[iXpandFileSystemController sharedController]
            openFileAbsolutePath:path openMode:mode];
            if (handle != -1)
           {
                       uint32_t dataLength = 0;
                       uint32_t uintDataSize = 0;
                       uint32_t uintDataTranLen = 0;
                       uintDataSize = (uint32_t)[self returnFileSize:test0];
                       @synchronized(self){
                        while((dataLength != -1) && (uintDataSize != 0))
                             {
                                   @autoreleasepool {
                                         uintDataTranLen =
            ((uintDataSize > MAX_DATABUFFER) ? MAX_DATABUFFER : uintDataSize);
                              [[fileHandle readDataOfLength:uintDataTranLen] getBytes:byDataBuf];
                             NSData *aData = [NSData dataWithBytes:byDataBuf length:sizeof(byDataBuf)];
                             dataLength = [[iXpandFileSystemController sharedController] writeFile:handle writeBuf:aData writeSize:uintDataTranLen];
                             uintDataSize -= dataLength;
                        }
                       }
                  [[iXpandFileSystemController sharedController] closeFile:handle];
                       [fileHandle closeFile];
           }
    }
}

The following code snippet shows closing a session with iXpand after a file operation is done:

[[iXpandSystemController sharedController] closeSession];

^ Top

 

DESIGN GUIDELINES

iXpand does not generate thumbnails and metadata information of media files. The developer will need to create or use a third party application or library to render thumbnail and metadata if required.

NOTE: The iXpand accessory does not protect application specific files.

The application developer has the flexibility to organize iXpand files in any manner as intended.

We recommend you call iXpand File System API's from a non-UI thread to offer a better user experience.

^ Top

 

LIMITATIONS

- API's to notify drive contents have changed is not optimized for multiple applications

- Seek file API with out of range seek doesn’t return error value

- getFileOpenMode API returns incorrect file mode if opened with OF_CREATE and OF_EXIST

- API ‘itemExists’ returns incorrect value. Use search API alternatively.

^ Top

 

Download

You will need a free WD Developer Portal account to download the binaries and libraries for the iXpand SDK - click here to sign up. After you have a WD Developer Portal account, click here to download the iXpand SDK. You will download a file named similar to 'ixpandsdk30.zip', extract it to a project directory.

^ Top

 

IXPAND SDK APPS

The SDK includes a simulator and a debug and demo release app. You should run the simulator for testing your app on your PC, and use the Debug and Release versions for deployment to the actual iOS device.

Note: The app contains the FATFS open source taken from following link http://elm-chan.org/fsw/ff/00index_e.html. For further information on use and licensing, refer to the following link http://elm-chan.org/fsw/ff/doc/appnote.html#license

^ Top

 

SIMULATOR

1. Load Project in Xcode

Download the sample application and load in Xcode as depicted below

 

Figure 1 - Load Project in Xcode

2. Go to Edit Scheme

 

Figure 2 - Edit Scheme

3. Build Configuration

Change Build Configuration to TEST

 

Figure 3 - Test Build Configuration

4. Change Device

Change the device to an iOS Simulator

 

Figure 4 - Change to iOS Simulator

5. Run Simulator

Run the sample app and try it out, your iPhone simulator should look like the below with the iXpand simulator running in a separate window.

 

Figure 5 - Simulator Running

First you can tap on Open Session, and then you can tap on the other buttons to see the communication from the iPhone simulator to the iXpand simulator appearing at the bottom of your screen.

^ Top

 

SIMULATOR VIEWS

Here is a sample of the views that the simulator shows:

 

Figure 1 - Open Session

 

Figure 3 - Get Software Version

 

Figure 4 - Read / Create File

 

Figure 5 - Read Folder

^ Top

 

APP DEBUG BUILD

1. Load Debug into Xcode

Download the example application and load into Xcode.

 

Figure 1 - Start Here

2. Go to Edit Scheme

 

Figure 2 - Edit Scheme

3. Build Configuration

Change Build Configuration to debug.

 

Figure 3 - Debug Build Configuration

4. Change Device

Change Device to a real device.

 

Figure 4 - Change Device

5. Select Ixpand Demo Folder

Select the 'iXpandSDK_Demo' folder in the folder navigation.

 

Figure 5 - Navigate to iXpandSDK_Demo

6. Manage Signing

Enable 'Automatically manage signing' and allow it to reset the build settings.

 

Figure 6 - Manage Signing

7. Select a 'Provisioning Profile'

 

Figure 7 - Provision Profile

8. Go to Build Settings

 

Figure 8 - Build Settings

9. Change Code Signing

In 'Signing' change 'Code Signing Identity' to 'iOS Developer'.

 

Figure 9 - Sign as iOS Developer

10. Change Bundle Identifier

Go to 'General' and in 'identity' change 'Bundle Identifier' to a new one.

 

Figure 10 - Change Bundle Identifier

11. Build Demo

Click 'Try Again' in signing and start building the Debug Demo.

 

Figure 11 - Build Debug Demo

^ Top

 

APP RELEASE BUILD

1. Add app framework to Xcode

Download the sample application and open the project in Xcode.

 

Figure 1 - Open Project in Xcode

2. Edit Scheme

Go to Edit Scheme.

 

Figure 2 - Edit Scheme

3. Set Build Configuration

Change Build Configuration to debug.

 

Figure 3 - Set Build Configuration

4. Change Device

Change device to a real device.

 

Figure 4 - Change Device

5. Select App Framework

Select iXpandSDK_Demo in the folder navigation.

 

Figure 5 - Select App Framework

6. Set Signing

Enable 'Automatically manage signing'.

 

Figure 6 - Set Signing

7. Provisioning Profile

Select a 'Provisioning Profile'.

 

Figure 7 - Provisioning Profile

8. Build settings

Go to Build Settings.

 

Figure 8 - Build Settings

9. Code Signing

In 'Signing' change 'Code Signing Identity' to 'iOS Developer'.

 

Figure 9 - Code Signing

10. Change Bundle Identifier

Go to 'General' and in 'identity' change 'Bundle Identifier' to a new one.

 

Figure 10 - Change Bundle Identifier

11. Build App

Click 'Try Again' in signing and start building the Demo.

 

Figure 11 - Build App

^ Top

RELEASE HISTORY

Version 3.0

  • Updated support for SanDisk iXpand Go flash drive

Version 2.2

  • Updated sample application read implementation
  • Updated multi-app sync logic in sample App
  • Updated iXpand icons
  • Added testability and bitcode support

Version 2.1

  • Added support for SanDisk iXpand flash drive lite
  • Added iXpand icons to integrate with third party applications

Version 2.0

  • Added support for SanDisk iXpand flash drive version-2
  • Added multiple applications sync logic
  • API's signature updated for exFAT file system support
  • Added iXpand simulator with SDK

Version 1.0

  • File System and System API's provided

^ Top

 

REQUEST HARDWARE

We may be able to assist in obtaining hardware to use during your development activities. Make your request hardware here.

 

SUBMIT APP

Submit your app for us to qualify & publish in the App Catalog.

When the validation process is complete, Western Digital will associate your app with the iXpand drive with Apple and send you the Product Plan ID (PPID) code. When you submit your app to Apple, edit your metadata and include the iXpand PPID code we sent you in the Comments of your submitted request.

After your app is published, if you change code related to the iXpand API, we ask that you resubmit to us for re-validation before submitting to Apple.

 

APP SHOWCASE

Check out apps built using the iXpand SDK

 

GET SUPPORT

Send us a message if you need help or have questions.

^ Top

 

 

 

 

 

 

Do more with the
iXpand SDK

Click the buttons below to visit the iXpand Developer Home & Workflow pages

 

Developer
Home

Get started, access the SDK, build your apps, & learn more


View Home

Developer
Workflow

Register & submit your app for review and contact support


View Workflow